An AI large model and heterogeneous system dynamic calling method and system based on an MCP protocol
By building a data dictionary and model pool, extending the MCP protocol, deploying a heterogeneous system adaptation layer and a dynamic calling layer, and combining large and micro AI models, the problem of intelligent management between system entities in cold chain warehouses has been solved, achieving environmental perception and seamless connection between devices, thereby improving operational efficiency and safety.
Patent Information
- Application Number
- CN202511163717.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-08-20
AI Technical Summary
There are complex relationships and interactions between system entities in cold chain warehouses, making it difficult for existing technologies to achieve effective intelligent management. The accuracy and reliability of environmental perception are low, the heterogeneity of system protocols makes it difficult for devices to connect seamlessly and share data, and the extraction and quantitative comparison of semantic description variables are insufficient.
By constructing a data dictionary and model pool, extending the MCP protocol, deploying a heterogeneous system adaptation layer and a dynamic calling layer, and combining large and micro AI models, the system achieves unified adaptation and decision optimization. A multi-objective optimization problem modeling and rule verification mechanism is adopted to ensure the security and compliance of decisions.
It enables comprehensive perception and real-time monitoring of the cold chain warehouse environment, solves the problem of protocol heterogeneity between devices, improves system collaboration efficiency and operational efficiency, and ensures the reliability and security of decision-making.
Smart Images

Figure CN120676061B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent supply chain management, and in particular to a method and system for dynamically calling an AI large model and heterogeneous systems based on the MCP protocol. Background Art
[0002] The rapid development of the cold chain logistics industry has placed higher demands on the environmental awareness and operational efficiency of cold chain warehouse management systems. Furthermore, because cold chain warehouses involve multiple system entities, such as goods, storage locations, AGVs, forklifts, temperature sensors, orders, and tasks, and the complex relationships and interactions between these system entities, existing technologies have difficulty implementing effective, systematic, and intelligent management.
[0003] At present, the cold chain warehouse management system has the following main problems: the traditional warehouse operation system has deficiencies in environmental perception, and the fusion effect of sensor data is poor, resulting in low accuracy and reliability of environmental perception. At the same time, the existing system lacks intuitive environmental monitoring methods, making it difficult to fully grasp the real-time status of the warehouse. In terms of inventory operations, the existing system has low operating efficiency, certain safety hazards, and cannot adapt to changes in the dynamic environment. Most importantly, there is a problem of heterogeneity in system protocols between existing smart devices, which seriously hinders the collaboration between devices. Different brands and manufacturers use different communication protocols and data formats, making it difficult to achieve seamless connection and data sharing between different devices. At the same time, the existing system still needs to be improved in the extraction and quantitative comparison of semantic description variables, and it is necessary to more accurately determine the environmental control task labels that match the cold chain warehouse.
[0004] The rapid development of big model technology and the rapid popularization of the MCP protocol have provided new ideas for intelligent supply chain management. The market urgently needs a solution based on the MCP protocol and combined with AI big models to implement heterogeneous system calls, thereby promoting cold chain warehouse management. Summary of the Invention
[0005] One of the purposes of the present invention is to provide a dynamic calling method for AI large models and heterogeneous systems based on the MCP protocol to solve the problem in the existing technology that there are complex associations and interactions between system entities in cold chain warehouses, and the existing technology is difficult to carry out effective intelligent management.
[0006] The present invention is implemented through the following technical solution: a dynamic calling method for AI large models and heterogeneous systems based on the MCP protocol, including the following steps: S100, based on the entities in the cold chain warehouse, as well as the attributes and relationships of the entities, construct a data dictionary for the cold chain warehouse, extend the standard MCP protocol through the data dictionary, identify and extract the system corresponding to the entity, and the communication protocol and API of the system according to the entity, integrate the data format and communication method supported by the entity corresponding system into a heterogeneous system adaptation layer; S200, construct a resource pool in the cloud, the resource pool includes: a data pool and a model pool, wherein the data pool Used to store MCP protocol extension specifications, heterogeneous system mapping rules, cold chain warehouse basic data, and model pools for deploying various AI models and preset rule sets; S300, building a dynamic call layer in the cloud, which calls the data in the data pool in the resource pool by dynamically calling mathematical models, and combines the AI model in the model pool with the preset rule set to generate decision recommendations, and encapsulate the decision results as MCP instruction messages; S400, the cloud sends the MCP instruction message to the edge gateway, and the edge gateway converts the MCP instruction message into a local instruction executable by the system, and sends it to the equipment in the cold chain warehouse.
[0007] Furthermore, the heterogeneous system adaptation layer is deployed in the edge gateway, and a group of protocol adapter modules are constructed in the edge gateway. Each protocol adapter module is responsible for communication conversion with one or a specific type of heterogeneous system. At the same time, each adapter module can convert the MCP protocol unified instructions from the cloud into native instructions of a specific device, and convert the original data from the device into a unified MCP message format and send it to the cloud.
[0008] Furthermore, the data dictionary of the cold chain warehouse can be constructed by adding message types and data fields for entities in the cold chain warehouse, clearly defining their field names, data types, units, value ranges / enumeration values, whether they are required, and meaning descriptions.
[0009] Furthermore, the MCP protocol extension specification includes all MCP message types, data fields, data dictionaries, units, and value ranges defined in step 1. The specification file exists in the form of JSON Schema, XML Schema, or database table structure definition and is the basis for parsing, validating, and understanding all data in the data pool.
[0010] Furthermore, the heterogeneous system mapping rules are conversion rules between the system of each entity and the MCP protocol, and the mapping rules enable the adaptation layer in the edge gateway to correctly perform data translation.
[0011] Furthermore, the basic data of the cold chain warehouse is the largest and most dynamic part of the data pool. This basic data reflects the current status and historical trajectory of the cold chain warehouse, including: equipment status and sensor data, equipment operating status, environmental control, inventory and goods data, order and task data, as well as system and resource data, and other data related to the operation of the cold chain warehouse.
[0012] Furthermore, various types of AI models can be AI models of different types and complexities, and may include: large models, which are large language models or other complex deep learning models. These large models have powerful reasoning and generalization capabilities, but usually have long processing times and high resource consumption; micro models, which are lightweight models specially trained for specific tasks or scenarios, such as simple machine learning models or optimization algorithms. They have fast processing speeds and low resource consumption, but may not perform as well as large models in complex scenarios.
[0013] Furthermore, the preset rule set can be set by the cold chain warehouse manager according to the actual situation of the warehouse.
[0014] Furthermore, the preset rule sets can include: security assurance, ensuring that mandatory control measures can be triggered when the system status does not meet security or operational requirements; real-time response, ensuring the ability to provide immediate response in emergency situations; simplified decision-making processes, ensuring that only simple logical judgment operations are required without complex calculation processes; constraints and filtering, the preset rule sets ensure that the system's decisions always meet certain fixed standards by providing logical constraints on the business, rather than relying entirely on AI output, making the system's behavior controllable and transparent.
[0015] Furthermore, S400 also includes: the devices in the cold chain warehouse receive instructions and perform corresponding operations. During or after the execution process, the execution status, results and any abnormal information are fed back to the edge gateway through its native protocol. The data pool in the cloud receives the feedback message sent by the edge gateway to form a closed-loop data flow.
[0016] Furthermore, feedback messages can be used as training data and evaluation indicators for large AI models to continuously improve model performance and optimize dynamic calling strategies.
[0017] Furthermore, the dynamic call mathematical model models the dynamic call problem as a multi-objective optimization problem. By simultaneously considering multiple potentially conflicting objectives and taking into account the coordination of real-time context perception and dynamic adjustment as well as preset rules and AI decision-making, it can perceive the actual operating status of the current cold chain warehouse and dynamically adjust the decision-making strategy. The multi-objective optimization problem can be solved by solving the total cost function, which is expressed as follows:
[0018] ,in, For the moment The optimal model selection is is the model set in the model pool, is the specific model in the model pool, Indicates finding the model in the model pool that minimizes the total cost of the function; To respond to the dynamic weight of the delay cost, is the response delay cost function; is the dynamic weight of resource consumption cost, is the resource consumption cost function; is the dynamic weight of decision quality cost, is the decision quality cost function.
[0019] Furthermore, the dynamic call mathematical model is constructed through the following sub-steps:
[0020] S310, integrating the data in the data pool into a global state vector containing multiple state components,
[0021] Each component in the global state vector represents real-time information of a specific dimension, which together describe the current environment and operating status of the system;
[0022] S320: Call the preset rules of the preset rule set in the model pool to judge the global state vector and determine whether a specific preset behavior needs to be triggered.
[0023] When the global state vector is updated, the preset rule set will evaluate each rule. When the global state vector causes the condition of a rule in the preset rule set to be met, the preset rule set outputs the decision corresponding to the rule. At this time, the action corresponding to the rule is executed first, ensuring that the system can respond quickly in emergency situations.
[0024] S330: After the determination is completed, a model with the minimum total cost is selected through the total cost function, and a calling strategy is generated through the selected model.
[0025] Furthermore, the global state vector can be expressed as follows:
[0026] ,in, is the global state vector, which is a comprehensive vector that contains the All key operating information of the cold chain warehouse system; is the temperature vector of each region; is the device state vector; is the system load; It is the task queue status; The alarm level.
[0027] Furthermore, the determination of the global state vector can be expressed as follows: ,in, is a collection of preset rules; For the set rules; Each rule is a function that takes the current global state vector as input and outputs a binary value {0, 1}, where 1 indicates that the rule is triggered (i.e., the condition is met) under the current state, and 0 indicates that the rule is not triggered (i.e., the condition is not met). When a decision is made, the dynamic mathematical model evaluates all rules in the preset rule set one by one based on the current global state vector. If any rule output is 1, the corresponding action is immediately executed (i.e., the preset rule set in the model pool is called), skipping the subsequent optimization calculations.
[0028] Furthermore, the dynamic invocation of the mathematical model also includes a decision verification rule, which is used to verify that the decision generated by the model selected by the total cost function does not violate the preset rules, ensuring the security and compliance of the decision. The decision verification rule is expressed by the following formula:
[0029] ,in, For the final decision-making plan, This is the model's initial decision-making plan. It is a rule verification function used to check whether the model's initial decision plan violates any rules; It is a rule repair module used to correct the initial decision of violation. It is a correction operator, which means merging or correcting the preliminary decision with the rule repair solution.
[0030] Furthermore, the response delay cost function is expressed as follows:
[0031] ,in, For the model processing delay, is the network transmission quality factor, which is used to measure the impact of network transmission on the overall delay. The global state vector recorded when the model was last called.
[0032] Furthermore, the resource consumption cost function is expressed as follows:
[0033] ,in, For the model The unit calculation cost is is the system load, is the system load; is the energy consumption sensitivity coefficient, which is used to measure the importance of real-time energy consumption in the total cost of resource consumption.
[0034] Furthermore, the decision quality cost function is expressed as follows:
[0035] ,in, is the weight of temperature control deviation, is the temperature control deviation; is the weight of energy efficiency loss, Energy efficiency loss; The weight of the penalty for rule violation, Punishment for rule violations.
[0036] On the other hand, the present invention provides a dynamic calling system for AI large models and heterogeneous systems based on the MCP protocol, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, it implements the dynamic calling method for AI large models and heterogeneous systems based on the MCP protocol as described above.
[0037] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0038] 1. The present invention analyzes cold chain warehouse entities through the MCP protocol, constructs a data pool and a model pool, and establishes a dynamic call layer, thereby realizing comprehensive perception and real-time monitoring of the cold chain warehouse environment, overcoming the shortcomings of traditional systems that have insufficient environmental perception and difficulty in fully grasping the real-time status of the warehouse.
[0039] 2. The present invention achieves intelligent decision-making while ensuring system security through the collaborative work of preset rule sets and AI models. By establishing a unified MCP protocol adaptation layer, it solves the protocol heterogeneity problem between devices of different brands and manufacturers, realizes seamless connection and data sharing between devices, and improves the overall collaborative efficiency of the system.
[0040] 3. The present invention adopts a multi-model parallel calling mechanism, combining the advantages of large AI models and micro models, to achieve efficient utilization of system resources and rapid response to tasks, significantly improving the operating efficiency of cold chain warehouses. At the same time, by introducing rule verification and repair mechanisms, it ensures the compliance and reliability of AI decisions, effectively preventing decision-making errors caused by AI models, and improving the overall operational stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:
[0042] Figure 1 This is a flowchart of the overall method provided in Example 1 of the present invention.
[0043] Figure 2 This is a timing diagram of the overall method provided in Example 1 of the present invention.
[0044] Figure 3 This is a flow chart of the dynamic calling mathematical model provided in Example 1 of the present invention.
[0045] Figure 4 This is a timing diagram of the dynamic calling mathematical model provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0047] Example 1
[0048] This embodiment discloses a method for dynamically calling a large AI model and a heterogeneous system based on the MCP protocol. The method in this embodiment first analyzes the cold chain warehouse entity, thereby updating and expanding the MCP protocol to achieve system integration. A data pool and a model pool are constructed in the cloud, and a dynamic call layer is established. The dynamic call layer intelligently outputs a scheduling strategy to achieve adaptation and calling of heterogeneous systems, thereby realizing intelligent management of cold chain warehouses and improving warehouse operation efficiency and safety. This application solves the problem of protocol heterogeneity between devices, realizes cross-system data intercommunication and collaborative control, improves the scalability and flexibility of equipment, and builds an efficient and convenient smart home ecosystem.
[0049] Figure 1 A flow chart showing the overall method in this embodiment is shown. Figure 2 The timing diagram of the overall method in this embodiment is shown. Figure 1 It can be seen that this embodiment includes the following steps:
[0050] Step 1: Count all entities involved in the cold chain warehouse (e.g., goods, storage locations, AGVs, forklifts, temperature sensors, orders, tasks, etc.) and their key attributes and relationships. Based on the standard MCP protocol, define the cold chain warehouse's message types and data fields to obtain a cold chain warehouse data dictionary. Combine the constructed data dictionary with the MCP protocol specification to obtain an MCP protocol specification extended based on the actual conditions of the cold chain warehouse. This extended MCP protocol specification serves as the common language for communication between the cloud resource pool and the underlying heterogeneous systems in this embodiment, ensuring that all instructions and data can be accurately parsed and executed.
[0051] For example, by adding fields representing temperature, humidity, refrigerator status, equipment fault codes, and AI optimization suggestions (such as path, speed, and task priority), a detailed data dictionary can be developed to clarify the meaning, data type, unit, and value range of each field.
[0052] Specifically, the data dictionary can be constructed by adding new message types and data fields for entities in the cold chain warehouse, clearly defining their field names, data types, units, value ranges / enumeration values, whether they are required, and meaning descriptions.
[0053] By analyzing the entities involved in the cold chain warehouse, the corresponding systems are identified and the communication protocols and APIs of each system are analyzed. The data formats, communication methods (such as TCP / IP, serial ports, Modbus, OPC UA, RESTful API, and MQTT), and instruction sets supported by the systems between different entities are integrated. The data formats, communication methods, and instruction sets of these heterogeneous systems are integrated into a heterogeneous system adaptation layer, which is then uniformly called by the MCP.
[0054] Specifically, this heterogeneous system adaptation layer can be deployed in edge gateways. By building a set of protocol adapter modules, each module is responsible for communication conversion with a specific type or class of heterogeneous systems. Each adapter module converts the unified MCP protocol instructions from the cloud into native instructions for a specific device. It also converts raw data from the device into a unified MCP message format and sends it to the cloud.
[0055] Step 2: Build a resource pool in the cloud. The resource pool includes a data pool and a model pool.
[0056] The data pool is used to store the extended MCP protocol specifications, heterogeneous system mapping rules, and cold chain warehouse basic data.
[0057] The extended MCP protocol specification file includes all MCP message types, data fields, data dictionaries, units, value ranges, etc. defined in step 1. These specification files can exist in the form of JSON Schema, XML Schema, or database table structure definitions and are the basis for parsing, validating, and understanding all data in the data pool.
[0058] Heterogeneous system mapping rules are the conversion rules between the systems of each entity in the cold chain warehouse and the MCP protocol. Examples include the correspondence between Modbus register addresses and MCP fields, and the mapping between RESTful API endpoints and MCP commands. These mapping rules enable the adaptation layer in the edge gateway to correctly translate data.
[0059] Cold chain warehouse basic data is the largest and most dynamic component of the data pool. This basic data reflects the current status and historical trajectory of the cold chain warehouse. Specifically, it includes: equipment status and sensor data, equipment operating status, environmental control, inventory and product data, order and task data, system and resource data, and other data related to the operation of the cold chain warehouse.
[0060] The model pool is used to deploy various AI models and rules preset based on actual conditions. The models in the model pool can be of different types and complexities. For example, in this embodiment, the model pool may include: large models, which are large language models or other complex deep learning models. These large models have strong reasoning and generalization capabilities, but generally have long processing times and high resource consumption; micro models, which are lightweight models specially trained for specific tasks or scenarios, such as simple machine learning models or optimization algorithms. They have fast processing speeds and low resource consumption, but may not perform as well as large models in complex scenarios.
[0061] The preset rules in the model pool can be a customized preset rule set, which can be set by the cold chain warehouse manager according to the actual situation of the warehouse. For example, the most commonly used temperature thresholds and emergency response rules in the cold chain warehouse can be set to high temperature alarm and refrigeration start, low temperature alarm and refrigeration stop, or rules for temperature sensor failure.
[0062] Step 3: Build a dynamic call layer in the cloud. The dynamic call layer integrates the operating rules, equipment performance, task modes, and environmental impacts of different heterogeneous systems in the cold chain warehouse by calling resources in the resource pool.
[0063] The core of the dynamic call layer is the dynamic call mathematical model, which generates decision recommendations by calling the data in the data pool in the resource pool and combining the AI model in the model pool with preset rules. The decision results are encapsulated as extended MCP instruction messages. These messages clearly specify the target device, execution action, parameters and priority.
[0064] In this embodiment, the core goal of constructing a dynamic mathematical model is to intelligently select the most appropriate decision-making tool during the real-time operation of a cold chain warehouse, balancing speed, effectiveness, and resource consumption. This solves the problem of dynamic invocation in cold chain warehouses and enables the selection of the most appropriate decision-making model (which can be a large AI model, a small AI model, or a preset rule set) under different real-time conditions. The mathematical model in this embodiment models the dynamic invocation problem as a multi-objective optimization problem. By simultaneously considering multiple potentially conflicting objectives, and balancing real-time contextual awareness with dynamic adjustments and the synergy between preset rules and AI decision-making, the entire system can perceive the actual operating status of the cold chain warehouse (such as temperature, equipment status, system load, etc.) and dynamically adjust its decision-making strategy based on this perception. For certain urgent or clear scenarios, preset rules (such as immediately initiating cooling if the temperature exceeds the limit) are assigned high priority, eliminating the need for AI model intervention. In other cases, the AI model makes the optimal decision.
[0065] Figure 3 The flowchart of the dynamic calling mathematical model in this embodiment is shown. As can be seen from the figure, the dynamic calling mathematical model in this embodiment includes the following sub-steps:
[0066] 1) First, based on the data in the cloud data pool, a global state vector containing multiple state components is constructed. Each component in the global state vector represents real-time information of a specific dimension. This information collectively describes the current environment and operating status of the system.
[0067] Specifically, in this implementation, the global state vector can be expressed as follows:
[0068] ,
[0069] in, is the global state vector, which is a comprehensive vector that contains the All key operating information of the cold chain warehouse system; is the temperature vector of each area, including the temperature of different areas in the cold storage at time Real-time temperature data at the time of is the device state vector, which is used to describe the key equipment in the cold chain warehouse (such as refrigerators, automated guided vehicles AGV, fans, etc.) at time The running status at that time; System load, which indicates the current load of the infrastructure supporting the entire cold chain warehouse management system (such as server CPU usage, memory usage, and network bandwidth usage). This is an important indicator that directly affects the response speed and reliability of model calls. If the system load is too high, even if the model itself is fast, it may still cause delays due to infrastructure bottlenecks. The task queue status indicates how many tasks are currently waiting to be processed in the system. These tasks may be inbound or outbound instructions, sensor data processing tasks, or other operations that require scheduling (for example, the amount of goods waiting to be turned over and out of the warehouse). The longer the task queue, the more likely the system's processing capacity may be insufficient or it may be facing peak demand, thus affecting the urgency of decision-making. The alarm level reflects whether there is an abnormality in the current system and the urgency of the abnormality. It indicates the severity level of abnormal events generated by the preset rule set or other monitoring systems.
[0070] 2) Then, by calling custom preset rules in the model pool, the global state vector is determined to determine whether specific preset behaviors need to be triggered. The purpose of the preset rule set is to ensure that the system can make decisions quickly in specific situations. It does not rely on the reasoning of complex large AI models, but instead implements automatic control based on clear business rules or security rules.
[0071] In other words, when the global state vector is updated, the preset rule set evaluates each rule. If a rule's condition is met, the preset rule set outputs the corresponding decision. If a rule in the preset rule set is triggered, the system prioritizes the corresponding action without going through the AI model optimization process, ensuring that the system can react instantly in emergency situations.
[0072] For example, in this embodiment, the preset rule set may include:
[0073] Safety assurance ensures that mandatory control measures can be triggered when the system status does not meet safety or operational requirements. For example, when the temperature of the cold storage exceeds the safety threshold, the refrigeration equipment needs to be started immediately or the alarm needs to be processed without waiting for complex calculations of AI.
[0074] Real-time response: In some very urgent situations, the AI model may not be able to make decisions quickly. However, preset rules can be used to provide instant response capabilities. For example, when equipment fails or the temperature is too high, the rules can ensure immediate processing without waiting for the optimization process.
[0075] Simplify the decision-making process. Certain operations only require simple logical judgment rather than complex calculations. For example, if the length of the task queue exceeds a certain threshold, the rules can directly determine whether to prioritize the task without going through AI's multi-objective optimization calculations.
[0076] Constraints and filtering: preset rule sets can provide some business logical constraints to ensure that the system's decisions always meet certain fixed standards, rather than relying entirely on AI output, making the system's behavior more controllable and transparent.
[0077] Specifically, the determination of the global state vector by the preset rule set in this embodiment can be expressed by the following formula:
[0078] ,
[0079] in, is a collection of preset rules; For the set rules; Each rule is a function that takes the current global state vector as input and outputs a binary value {0, 1}, where 1 indicates that the rule is triggered (i.e., the condition is met) under the current state, and 0 indicates that the rule is not triggered (i.e., the condition is not met). When a decision is made, the dynamic mathematical model evaluates all rules in the preset rule set one by one based on the current global state vector. If any rule output is 1, the corresponding action is immediately executed (i.e., the preset rule set in the model pool is called), skipping the subsequent optimization calculations.
[0080] 3) The multi-objective optimization problem is then transformed into a single-objective utility maximization problem through the total cost function. The purpose of the total cost function is to quantify the selection of an AI model that can bring the maximum total benefit under a given state and use this model to generate decisions.
[0081] Specifically, in this embodiment, the total cost function can be expressed by the following formula:
[0082] ,
[0083] in, For the moment The optimal model selection is is the model set in the model pool, is the specific model in the model pool, It means finding the model in the model pool that minimizes the total cost of the function; To respond to the dynamic weight of the delay cost, is the response delay cost function; is the dynamic weight of resource consumption cost, is the resource consumption cost function; is the dynamic weight of decision quality cost, is the decision quality cost function.
[0084] In this embodiment, the three core cost functions can be expressed by the following formulas respectively, where:
[0085] (1) The response delay cost function can be expressed as follows:
[0086] ,
[0087] in, For the model The processing delay of the model The average time required to complete computation and inference is an inherent performance attribute of the model; The network transmission quality factor is used to measure the impact of network transmission on overall latency and can be set according to the current network environment. The global state vector recorded when the model was last called. Represents the Euclidean distance (L2 norm) between the current global state vector and the global state vector when the model was last called. It is used to measure the degree of change in the system state since the last decision.
[0088] (2) The resource consumption cost function can be expressed as follows:
[0089] ,
[0090] in, For the model The unit calculation cost is the empirical value of resource usage preset according to the model type, reflecting the resource usage of different models. The system load is the CPU / GPU utilization of the current server. The larger the value of these two, the larger the product will be, which means the busier the system is. At this time, calling a model with high computational cost will bring a greater burden and higher cost. is the energy consumption sensitivity coefficient, which is used to measure the importance of real-time energy consumption in the total cost of resource consumption.
[0091] (3) The decision quality cost function can be expressed as follows:
[0092] ,
[0093] in, is the weight of temperature control deviation, is the temperature control deviation, which is the model The average absolute deviation between the predicted temperature of each area after the decision and the target temperature represents the loss of temperature control effect; is the weight of energy efficiency loss, Energy efficiency loss; The weight of the penalty for rule violation, Punishment for rule violations.
[0094] Specifically, in this embodiment, the temperature control deviation can be calculated by the following formula:
[0095] ,in, is the number of zones, i.e. the number of zones in the cold chain warehouse that require temperature control; For the model The forecast after decision The temperature of the area; For the The closer the temperature predicted by the model is to the target temperature, the smaller the temperature control deviation is, and the higher the decision quality is.
[0096] The energy efficiency loss can be calculated by the following formula:
[0097] ,in, is the max function symbol; For the model Estimated total energy consumption after decision making; is the historical average baseline energy consumption. This formula indicates that if the decision results in energy consumption higher than the baseline, energy efficiency loss occurs. The max function ensures that a positive cost is only incurred when the energy consumption is higher than the baseline.
[0098] The penalty for rule violation can be calculated as follows:
[0099] ,in, is the indicator function. If the rule In the current state, it is not triggered, but the model If the decision of the rule will cause it to be triggered or deviate from the rule target, then this item is 1; otherwise, it is 0; For the The weight of a rule indicates the severity of a rule violation. The purpose of the rule violation penalty is to prevent the model from making decisions that, while not currently considered urgent, could potentially lead to rule violations in the future. For example, a model might determine the need for energy conservation based on semantic judgment. To conserve energy, the model might output a policy that raises the temperature close to a threshold. While approaching the threshold doesn't trigger the emergency rule, it increases risk. This formula assigns a negative penalty to such decisions.
[0100] In addition, it should be noted that, in this embodiment, the weight coefficients of the cost function can be dynamically adjusted according to the alarm level. Specifically, the three weight coefficients in this embodiment can be calculated by the following formulas:
[0101] , the formula indicates that when the alarm level is low (not urgent), the weight value will become smaller, and the response delay does not need to be taken too seriously at this time (that is, the penalty for high delay is relatively light). When the alarm level is high (urgent), the weight value will become larger, which means that the response delay should be taken seriously at this time, and the model with long processing time will be strongly penalized.
[0102] , the formula indicates that when the alarm level is low (not urgent), the weight value will become larger, which means that resource consumption will be emphasized at this time; when the alarm level is high (urgent), the weight value will become smaller, which means that resource consumption is not too important at this time. In an emergency, some resources can be sacrificed to ensure response or effect. In the above formula, and is the adjustment coefficient used to control the sensitivity of the weight; is a natural constant.
[0103] , this formula indicates that when the alarm level is low (not urgent), the weight value will become smaller, and the decision quality should be emphasized at this time, that is, the cost of insufficient decision quality will be very heavy; when the alarm level is high (urgent), the weight value will become larger, which means that the decision quality is relatively less important. In an emergency, as long as the problem can be solved, even if the decision is not so perfect, it can be accepted. Therefore, the cost weight of insufficient decision quality will be reduced.
[0104] 4) After selecting the model with the minimum total cost through the total cost function, in this embodiment, a gatekeeper mechanism can be introduced to verify that the decisions generated by the model do not violate the preset key rules, thereby ensuring the security and compliance of the final model decision.
[0105] The decision made by the model is first verified by rule checking. If the decision complies with the rules, it is used directly. Otherwise, it needs to be modified according to the rules. In this embodiment, rule checking can be expressed as follows:
[0106] ,
[0107] in, For the final decision-making plan, This is the model's initial decision-making plan. It is a rule verification function used to check whether the model's initial decision plan violates any rules; It is a rule repair module used to correct the initial decision of violation. It is a correction operator, which means merging or correcting the preliminary decision with the rule repair solution.
[0108] It's important to note that the rule validation function receives the model's output decision plan as input and evaluates whether it violates any pre-set rules. The rule validation function checks whether, if executed, the preliminary decision plan would cause the cold chain warehouse's state to enter a prohibited area or trigger a high-penalty rule. If the rule validation function outputs a 0, the decision plan passes all rule checks and is safe and compliant. A non-zero output indicates that the decision plan fails rule validation and may violate certain important rules. If a decision plan doesn't comply with the rules, the rule repair module provides a rule-based correction. This rule repair module is typically implemented using a preset rule set or other predefined logic. Its goal is to modify the preliminary decision plan as minimally as possible. Using correction operators, it prioritizes rules and directly overrides or adjusts the conflicting portions of the AI decision, while preserving the non-conflicting portions to ensure compliance. For example, if the AI's preliminary decision plan sets the temperature too high, the rule repair module might force it to fall below a safe threshold. This verification mechanism provides a secondary guarantee after the model outputs a decision, ensuring that even if the AI model is selected and generates a decision, it will not produce a solution that violates the core rules, thereby improving the robustness of the entire system.
[0109] According to the above steps, draw the timing diagram of the dynamic call mathematical model as described above, such as Figure 4 shown.
[0110] Step 4: The heterogeneous system adaptation layer of the edge gateway receives the MCP instructions sent from the cloud, and converts the MCP instructions into local instructions executable by the system of each entity according to the extended MCP protocol specification, and sends the local instructions to the equipment / system in the cold chain warehouse.
[0111] The devices / systems in the cold chain warehouse receive instructions and perform corresponding operations. During or after the execution, the devices / systems will feedback the execution status, results, and any abnormal information to the corresponding protocol adapter through their native protocol and upload them to the cloud through the edge gateway.
[0112] The cloud-based data pool receives these feedback MCP messages, forming a closed-loop data flow. This feedback data (such as actual completion time, actual energy consumption, and equipment utilization) can be used as training data and evaluation metrics for large AI models, continuously improving model performance and optimizing dynamic call strategies.
[0113] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A dynamic calling method for AI large models and heterogeneous systems based on the MCP protocol, characterized in that: The dynamic calling method includes: S100: Build a data dictionary for the cold chain warehouse based on the entities, attributes, and relationships of the entities, and extend the standard MCP protocol through the data dictionary. Based on the entity, identify and extract the system corresponding to the entity, as well as the system's communication protocol and API, and integrate the data format and communication method supported by the entity's corresponding system into a heterogeneous system adaptation layer; S200, build a resource pool in the cloud, the resource pool includes: data pool and model pool, among which, The data pool is used to store MCP protocol extension specifications, heterogeneous system mapping rules and cold chain warehouse basic data. Model pool, used to deploy various AI models and preset rule sets; S300: Construct a dynamic call layer in the cloud. The dynamic call layer dynamically calls mathematical models, calls data from the data pool in the resource pool, combines the AI model in the model pool with the preset rule set, generates decision recommendations, and encapsulates the decision results as MCP instruction messages. S400. The cloud sends the MCP instruction message to the edge gateway. The edge gateway converts the MCP instruction message into a local instruction executable by the system and sends it to the device in the cold chain warehouse.
2. The method for dynamically calling an AI large model and a heterogeneous system based on the MCP protocol according to claim 1 is characterized in that: The heterogeneous system adaptation layer is deployed in the edge gateway. A set of protocol adapter modules are built in the edge gateway. Each protocol adapter module is responsible for communication conversion with one or a class of specific heterogeneous systems. At the same time, each adapter module is able to convert the MCP protocol unified instructions from the cloud into native instructions for a specific device, and convert the original data from the device into a unified MCP message format and send it to the cloud.
3. The dynamic calling method of AI large model and heterogeneous system based on MCP protocol according to claim 1 is characterized in that: The dynamic call mathematical model is constructed by modeling the dynamic call problem as a multi-objective optimization problem. By simultaneously considering multiple potentially conflicting objectives, and taking into account real-time context perception and dynamic adjustment, as well as the coordination of preset rules and AI decision-making, the actual operating status of the current cold chain warehouse can be perceived and decision-making strategies can be dynamically adjusted. The multi-objective optimization problem can be solved by solving the total cost function, which is expressed as follows: , in, For the moment The optimal model selection is is the model set in the model pool, is the specific model in the model pool, Indicates finding the model in the model pool that minimizes the total cost of the function; To respond to the dynamic weight of the delay cost, is the response delay cost function; is the dynamic weight of resource consumption cost, is the resource consumption cost function; is the dynamic weight of decision quality cost, is the decision quality cost function.
4. The method for dynamically calling an AI large model and a heterogeneous system based on the MCP protocol according to claim 1 is characterized in that: The S400 also includes: the devices in the cold chain warehouse receive instructions and perform corresponding operations. During or after the execution, the execution status, results and any abnormal information are fed back to the edge gateway through its native protocol. The data pool in the cloud receives the feedback message sent by the edge gateway to form a closed-loop data flow.
5. The method for dynamically calling an AI large model and a heterogeneous system based on the MCP protocol according to claim 3 is characterized in that: The dynamic call mathematical model is constructed by the following sub-steps: S310, integrating the data in the data pool into a global state vector containing multiple state components, Each component in the global state vector represents real-time information of a specific dimension, which together describe the current environment and operating status of the system; S320: Call the preset rules of the preset rule set in the model pool to judge the global state vector to determine whether a specific preset behavior needs to be triggered. When the global state vector is updated, the preset rule set will evaluate each rule. When the global state vector causes the condition of a rule in the preset rule set to be met, the preset rule set outputs the decision corresponding to the rule. At this time, the action corresponding to the rule is executed first, ensuring that the system can respond quickly in emergency situations. S330: After the determination is completed, a model with the minimum total cost is selected through the total cost function, and a calling strategy is generated through the selected model.
6. The method for dynamically calling an AI large model and a heterogeneous system based on the MCP protocol according to claim 5 is characterized in that: The dynamic call mathematical model also includes a decision verification rule, which is used to verify that the decision generated by the model selected by the total cost function does not violate the preset rules, ensuring the security and compliance of the decision. The decision verification rule is expressed as follows: , in, For the final decision-making plan, This is the model’s initial decision-making plan. It is a rule verification function used to check whether the model's initial decision plan violates any rules; It is a rule repair module used to correct the initial decision of violation. It is a correction operator, which means merging or correcting the preliminary decision with the rule repair solution.
7. The method for dynamically calling an AI large model and a heterogeneous system based on the MCP protocol according to claim 3 is characterized in that: The response delay cost function is expressed by the following formula: , in, For the model processing delay, is the network transmission quality factor, which is used to measure the impact of network transmission on the overall delay. The global state vector recorded when the model was last called.
8. The method for dynamically calling an AI large model and a heterogeneous system based on the MCP protocol according to claim 3 is characterized in that: The resource consumption cost function is expressed by the following formula: , in, For the model The unit calculation cost is is the system load, is the system load; is the energy consumption sensitivity coefficient, which is used to measure the importance of real-time energy consumption in the total cost of resource consumption.
9. The method for dynamically calling an AI large model and a heterogeneous system based on the MCP protocol according to claim 3 is characterized in that: The decision quality cost function is expressed as follows: , in, is the weight of temperature control deviation, is the temperature control deviation; is the weight of energy efficiency loss, Energy efficiency loss; The weight of the penalty for rule violation, Punishment for rule violations.
10. A dynamic calling system for AI large models and heterogeneous systems based on the MCP protocol, characterized by: The dynamic calling system includes: processor; A memory storing a computer program, which, when executed by a processor, implements the dynamic calling method of the AI large model and heterogeneous system based on the MCP protocol as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Abstraction instruction conversion method and system oriented to heterogeneous cloud network equipment
CN114115998A
Cross-environment AI task cooperative execution method and device based on MCP protocol, and storage medium
CN120186142A
Cited By
Intelligent battlefield situation analysis and generation method and system based on multi-modal semantic understanding and mcp cooperation
CN122527726A