AI semantic model and robot interconnection method and system based on MCP protocol, and medium
Through the MCP protocol's AI semantic model and robot interconnection method, the semantic fault and real-time problems in the integration of traditional robots and AI models are solved, protocol adaptive connection and dynamic permission control are realized, data security is ensured, and an efficient human-computer interaction architecture is provided.
Patent Information
- Application Number
- CN202511209009.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-27
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-08-27
AI Technical Summary
The integration of traditional robots and AI models has semantic gaps, resulting in long development cycles. Protocol expansion requires reconstruction of the system architecture, which cannot meet real-time needs. In addition, permission control and data security measures are insufficient, making it impossible to adapt to cross-factory collaboration and dynamic equipment binding.
The AI semantic model and robot interconnection method of the MCP protocol is adopted. The natural language instructions are converted into structured operation sequences through the semantic parsing model, the service engine tool identifier and parameter template are dynamically matched, and the double closed-loop mechanism is combined for permission verification and field-level encryption, and the transmission protocol channel is dynamically selected.
It realizes adaptive connection between AI and robot protocols, dynamic permission control and data security, solves the problems of long integration cycle and real-time performance, and provides a safe and efficient human-computer interaction architecture.
Smart Images

Figure CN120791784A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent manufacturing, more particularly, to an AI semantic model and robot interconnection method, system and medium based on MCP protocol. BACKGROUND
[0002] In the field of intelligent manufacturing, the deep integration of AI large models and industrial robots has become a key technology trend to improve production flexibility. However, traditional robots rely on special industrial protocols, while AI model outputs natural language or general API instructions, and the semantic gap between the two leads developers to customize conversion middleware for each type of device, with long integration period and protocol expansion requiring system architecture reconstruction. Currently, general communication frameworks based on HTTP / RPC cannot meet the millisecond-level real-time requirements of industrial scenarios, while proprietary real-time networks cannot adapt to long-distance transmission for cross-factory collaboration, severely restricting high-precision operations. In addition, the permission control in the traditional solution relies on a static account system, which cannot dynamically bind devices and operation permissions; data security mostly uses one-way encryption at the transmission layer, with sensitive fields exposed in plaintext at the application layer.
[0003] The prior art uses a robot scheduling framework based on ROS, which optimizes local control real-time performance but does not solve the problems of protocol dynamic adaptation and cross-network reliability; and the authentication scheme lacks a device binding mechanism, leading to the risk of unauthorized operations. Therefore, there is an urgent need for a new interconnection architecture that supports protocol adaptation, device-level dynamic authentication, and easy extension to break through the technical bottleneck of AI and robot integration. SUMMARY
[0004] In view of the above problems, the purpose of the present application is to provide an AI semantic model and robot interconnection method, system and medium based on MCP protocol, which uses dynamic mapping of semantics and tools. Specifically, a semantic analysis model is used to convert natural language instructions into structured operation sequences, and semantic tags are extracted to dynamically match tool identifiers and parameter templates in the service engine. It also includes a double-loop mechanism that verifies the device binding relationship and operation range of the security token, triggers user secondary authorization for unauthorized operations, realizes permission loop, and generates secure instructions with integrity check code by performing structured encapsulation and field-level encryption on operation parameters, realizing data loop. In addition, according to the real-time flag, the protocol channel is dynamically allocated to realize protocol adaptive connection.
[0005] The first aspect of the present application provides an AI semantic model and robot interconnection method based on MCP protocol, the method comprising: obtaining a natural language instruction, and based on a preset semantic analysis model, obtaining a structured operation sequence; extracting semantic tags of the structured operation sequence, dynamically matching a pre-stored service engine, and generating an operation request including a tool identifier and a parameter template; Check whether the security token of the operation request matches the operation permission; If it is an unauthorized operation, a secondary authorization request is initiated to the user; If the permission check passes, based on the preset encryption rule, the security instruction is obtained according to the operation request; According to the real-time flag of the security instruction, a transmission protocol is dynamically selected and a transmission protocol channel is established to generate an executable instruction stream; According to the executable instruction stream, the tool is controlled to execute the instruction operation, and the execution state data is obtained; According to the execution state data, based on the preset encryption rule, the execution state is generated and fed back.
[0006] In the scheme, the check of whether the security token of the operation request matches the operation permission specifically includes: The device identifier in the security token of the operation request is extracted, and a binding relationship is established with the target robot serial number; The operation type of the target robot is matched according to the permission range in the security token; When an operation parameter out-of-range or high-risk action instruction is detected, it is determined as an unauthorized operation, triggering user authorization interception; A secondary authorization request containing operation risk description is generated, and the executable instruction stream of the target robot is suspended; When the operation permission requirement is met, it is determined as passing the check, and then the security instruction is obtained according to the operation request based on the preset encryption rule.
[0007] In the scheme, the security instruction is obtained according to the operation request based on the preset encryption rule, specifically including: The operation parameters of the operation request are structured and packaged according to the parameter template corresponding to the tool identifier to obtain structured parameters; According to the parameter template, the parameters of the set field are executed at the field level; Based on the preset JSON format check, the structured parameters after encryption are filtered; The filtered structured parameters are generated and bound with an integrity check code, and the security instruction is integrated.
[0008] In the scheme, the transmission protocol is dynamically selected and the transmission protocol channel is established according to the real-time flag of the security instruction, specifically including: According to the real-time flag of the security instruction, the instruction classification is obtained, including at least real-time control instruction, streaming feedback instruction or cross-network transmission instruction; If it is a real-time control instruction, a local process communication protocol channel is allocated; If it is a streaming feedback instruction, a long connection streaming push protocol channel is allocated; If the instruction is transmitted across the network, a broken line self-recovery transmission protocol channel is allocated; All protocol channels maintain instruction continuity through a unified session identifier.
[0009] In the scheme, the tool execution instruction operation is controlled according to the executable instruction stream, specifically including: According to the tool identification extracted from the executable instruction stream, a pre-registered robot control tool library is matched; If it is a legal tool, the structured parameters extracted from the executable instruction stream are translated into industrial control instructions based on a preset protocol conversion rule; When executing the industrial control instruction, real-time feedback data is monitored based on a pre-deployed sensor; When the feedback data triggers a preset abnormal rule, the current operation sequence is dynamically interrupted.
[0010] In the scheme, the structured parameters extracted from the executable instruction stream are translated into industrial control instructions based on a preset protocol conversion rule, specifically including: Operation parameters are obtained based on a preset JSON format analysis; An industrial protocol instruction template is obtained according to the tool identification matched with a pre-defined industrial protocol instruction mapping rule library; The operation parameters are filled into the industrial protocol instruction template; An industrial protocol check code and a tool address prefix are added to the industrial protocol instruction template after filling the parameters, and a binary instruction stream of a target industrial control bus standard is output.
[0011] The second aspect of the application provides an AI semantic model and robot interconnection system based on an MCP protocol, including an AI semantic model and robot interconnection method program based on an MCP protocol, which realizes the following steps when executed by the processor: Obtain a natural language instruction, and obtain a structured operation sequence based on a preset semantic analysis model; Extract the semantic label of the structured operation sequence, dynamically match a pre-stored service engine, and generate an operation request including a tool identification and a parameter template; Verify that the security token of the operation request matches the operation authority; If it is an unauthorized operation, a secondary authorization request is initiated to the user; If the authority verification is passed, a secure instruction is obtained based on a preset encryption rule according to the operation request; According to the real-time flag of the secure instruction, a transmission protocol is dynamically selected and a transmission protocol channel is established to generate an executable instruction stream; According to the executable instruction stream, control tool execution instruction operation, and obtain execution state data; According to the execution state data, generate and feedback execution state based on a preset encryption rule.
[0012] In the scheme, the security token of the operation request is matched with the operation permission, and specifically includes: Extract the device identifier in the security token of the operation request, and establish a binding relationship with the target robot serial number; According to the permission range in the security token, match the operation type of the target robot; When detecting that the operation parameter is out of bounds or a high-risk action instruction, it is determined as an unauthorized operation, and user authorization interception is triggered; Generate a secondary authorization request containing operation risk description, and suspend the executable instruction stream of the target robot; When the operation permission requirement is met, it is determined as passing the check, and then based on the preset encryption rule, the security instruction is obtained according to the operation request.
[0013] In the scheme, the security instruction is obtained according to the operation request based on the preset encryption rule, and specifically includes: The operation parameters of the operation request are structured and packaged according to the parameter template corresponding to the tool identifier, to obtain structured parameters; According to the parameter template, the parameters of the set field are executed at the field level; Based on the preset JSON format verification, the structured parameters after encryption are filtered; Generate and bind the integrity check code for the filtered structured parameters, and integrate to obtain the security instruction.
[0014] The third aspect of the application provides a computer readable storage medium, the computer readable storage medium includes a MCP protocol based AI semantic model and robot interconnection method program, when the MCP protocol based AI semantic model and robot interconnection method program is executed by the processor, the steps of the MCP protocol based AI semantic model and robot interconnection method are realized.
[0015] The application provides an AI semantic model and robot interconnection method, system and medium based on an MCP protocol, receives a natural language instruction and generates a structured operation sequence through a semantic analysis model; semantic tags in the sequence are extracted to dynamically match a service engine, an operation request containing a tool identifier and a parameter template is generated; based on a security token check, operation permissions are checked, if the operation is unauthorized, a user secondary authorization is triggered, if the permissions are passed, the operation request is encapsulated into a secure instruction according to an encryption rule; based on a real-time flag, a transmission protocol channel is dynamically selected, an executable instruction stream is generated, so as to drive a target tool to execute an operation and feed back execution state data; the application solves the heterogeneous problem of AI and robot instructions through dynamic matching of semantics and robot tools, intercepts unauthorized operations based on permission verification, guarantees data security through field-level encryption, and provides a safe and efficient human-machine interaction architecture for intelligent manufacturing. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some of the embodiments of the application, and therefore should not be regarded as a limitation on the scope.
[0017] Figure 1 A flowchart of an AI semantic model and robot interconnection method based on an MCP protocol of the application is shown; Figure 2 A matching flowchart of an operation permission provided by the embodiment of the application is shown; Figure 3 A generation flowchart of a secure instruction provided by the embodiment of the application is shown; Figure 4 A block diagram of an AI semantic model and robot interconnection system based on an MCP protocol of the application is shown. DETAILED DESCRIPTION
[0018] The technical solutions in the embodiments of the application will be described clearly and completely in the following with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the application.
[0019] Unless otherwise defined, all terms (including technical and scientific terms) used in the embodiments of the application have the same meanings as commonly understood by those skilled in the art to which the application belongs. It should also be understood that terms such as those defined in generally used dictionaries should be interpreted as having meanings consistent with their meanings in the context of the relevant art, and should not be interpreted in an idealized or overly formal sense, unless the embodiments of the application explicitly define otherwise.
[0020] The terms "first", "second", and similar terms do not denote any order, quantity, or importance, but are used to distinguish different components. The terms "one", "a", or "the" do not denote a quantity restriction, but denote the presence of at least one. Similarly, the terms "include" or "contain" and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, without excluding other elements or objects. The terms "connect" or "connected" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The steps before or after the method of the embodiments of the present application do not necessarily proceed in order. On the contrary, the steps can be processed in reverse order or simultaneously. In addition, other operations can be added to these processes, or one or more steps can be removed from these processes.
[0021] In addition, the functional modules in various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0022] Figure 1 A flowchart of an AI semantic model and robot interconnection method based on the MCP protocol is shown.
[0023] As shown in Figure 1 The first aspect of the present application discloses an AI semantic model and robot interconnection method based on the MCP protocol, which comprises: S102, obtaining a natural language instruction, and obtaining a structured operation sequence based on a preset semantic analysis model; S104, extracting a semantic label of the structured operation sequence, dynamically matching a pre-stored service engine, and generating an operation request comprising a tool identifier and a parameter template; S106, verifying that the security token of the operation request matches the operation authority; S108, if it is an unauthorized operation, initiating a secondary authorization request to the user; S110, if the authority verification is passed, obtaining a security instruction based on a preset encryption rule according to the operation request; S112, dynamically selecting a transmission protocol and establishing a transmission protocol channel according to a real-time flag of the security instruction, and generating an executable instruction stream; S114, controlling a tool to execute an instruction operation according to the executable instruction stream, and obtaining execution state data; S116, generating and feeding back the execution state based on a preset encryption rule according to the execution state data.
[0024] It should be noted that in the embodiment, the flow is first started by receiving a natural language instruction, which is disassembled into a structured operation sequence by a preset semantic analysis model, and the action type, target object and parameter constraint are determined. Then the semantic tags in the sequence are extracted, and the pre-stored robot tool identifier and parameter template in the service engine are dynamically associated to generate an operation request containing tool call path and input specification. Secondly, it is verified whether the permission range of the security token in the operation request covers the current operation type. If parameter out-of-bound or high-risk instruction is detected, the secondary authorization mechanism of the user is triggered and the instruction flow is suspended, and after manual confirmation, the restriction is released; if the permission verification is passed, the operation request is structured and packaged according to the encryption rule, and the sensitive fields such as coordinates and device number are implemented field-level encryption, and a session identifier is bound to generate a secure instruction. Then, according to the real-time flag bit in the instruction, a transmission protocol channel is dynamically allocated, as an implementation manner, the key control instruction is directly connected to the local process communication channel, the long-time task is allocated to the streaming push channel, and the cross-network instruction enables the disconnection self-healing channel. Finally, the target tool is driven to execute the industrial operation through the protocol adapted instruction flow, the sensor data is collected and the execution state is fed back in real time, and a closed-loop control from semantic understanding to physical execution is formed.
[0025] Figure 2 An operation permission matching flowchart provided by an embodiment of the application is shown.
[0026] According to the embodiment of the application, as shown in Figure 2 The operation permission matching operation of the security token of the operation request is verified, and specifically includes: S202, extracting the device identifier in the security token of the operation request, and establishing a binding relationship with the target robot serial number; S204, matching the operation type of the target robot according to the permission range in the security token; S206, when detecting that the operation parameter is out of bound or the high-risk action instruction, it is determined as an unauthorized operation, and the user authorization interception is triggered; S208, generating a secondary authorization request containing operation risk description, and suspending the executable instruction flow of the target robot; S210, when the operation permission requirement is met, it is determined as passing the verification, and a secure instruction is obtained based on the operation request according to the preset encryption rule.
[0027] It should be noted that in the present embodiment, the security token verification process is performed, first, the device identifier is extracted to establish a hardware-level binding with the target robot serial number, ensuring that the instruction only acts on the specified device. Then match the token authority scope with the compatibility of the operation type, for example, the robot arm movement needs to have the "robot_move" authority, and the force control operation needs the "robot_force_control" high-level authority. When the parameter detection module identifies that the speed, torque and other numerical values exceed the preset safety threshold, or the instruction involves emergency stop, high power mode and other high-risk actions, it is determined as an unauthorized operation and the user authorization interceptor is activated. When it is determined as an unauthorized operation, the system also generates a secondary authorization request containing risk details and pushes it to the user end, for example, the risk details are "30% overspeed, 25% collision risk"; In addition, all pending instructions of the robot are frozen simultaneously. Until the user returns the permission signal through the confirmation interface, the system unblocks the frozen state and injects the encrypted security instruction into the transmission process, realizing a double confirmation mechanism for risk operations.
[0028] Figure 3 A flowchart of a security instruction generation process provided by an embodiment of the present application is shown.
[0029] According to the present embodiment, as shown in Figure 3 According to the present embodiment, as shown in S302, the operation parameters of the operation request are structured and packaged according to the parameter template corresponding to the tool identifier, to obtain structured parameters; S304, according to the parameter template, the parameters of the set field are executed for field-level encryption; S306, based on the preset JSON format verification, the encrypted structured parameters are filtered; S308, the structured parameters after filtering are generated and bound with integrity check code, and the security instruction is integrated.
[0030] It should be noted that in the present embodiment, when the generation process of the encrypted security instruction is executed, the operation parameters are first structured and reorganized. As an implementation manner, the original input is normalized into a key-value pair structure according to the parameter template corresponding to the tool identifier; for example, the coordinate parameters are encapsulated as {x: 1.2, y: 3.4}. Then, for sensitive fields such as position coordinates and device serial numbers, field-level encryption is implemented using a dynamic key bound to a session to ensure that a single data leak does not affect the overall security. Secondly, non-structured data and potential injection codes are filtered through a mandatory JSON format verification layer to block malicious instruction penetration. Then, an integrity check code based on the session identifier is generated for the encrypted data set; the check code can verify whether the data has been tampered with during transmission. Finally, the security instruction package containing the encrypted parameters, the check code and the tool call path is formed, providing standardized input for subsequent protocol transmission.
[0031] According to the embodiment of the present application, the real-time flag of the security instruction is used to dynamically select a transmission protocol and establish a transmission protocol channel, which specifically includes: According to the real-time flag of the security instruction, an instruction classification is obtained, including at least real-time control instructions, streaming feedback instructions or cross-network transmission instructions; If it is a real-time control instruction, a local process communication protocol channel is allocated; If it is a streaming feedback instruction, a long connection streaming push protocol channel is allocated; If it is a cross-network transmission instruction, a broken line self-healing transmission protocol channel is allocated; All protocol channels are maintained by a unified session identifier to maintain instruction continuity.
[0032] It should be noted that in the present embodiment, when the protocol dynamic selection mechanism is executed, the real-time flag in the security instruction is first analyzed and classified into three scenarios, including real-time control instructions, streaming feedback instructions and cross-network transmission instructions. For the real-time control instruction scenario, such as a motion control instruction, the instruction is allocated to a local process communication protocol channel, and the instruction is directly transmitted to the robot drive layer through memory sharing to eliminate the influence of network delay. For the streaming feedback instruction, such as a task progress information transmission set instruction, the instruction is allocated to a long connection streaming push channel for continuous transmission of percentage state updates. For the cross-network instruction scenario, such as a cloud collaboration instruction, the instruction is allocated to a broken line self-healing transmission protocol channel, which has session caching and automatic reconnection capability within 50 ms. In the present embodiment, all channels are embedded with a unified session identifier, which automatically inherits the task context when the protocol is switched, and guarantees task continuity through instruction queue reordering and state snapshot recovery, ensuring that the industrial control timing is maintained under extreme network fluctuations.
[0033] According to the embodiment of the present application, the executable instruction stream is used to control the tool to execute the instruction operation, which specifically includes: According to the executable instruction stream extraction tool identification, a pre-registered robot control tool library is matched; If it is a legal tool, the structured parameters extracted by the executable instruction stream are translated into industrial control instructions based on preset protocol conversion rules; When the industrial control instructions are executed, feedback data is monitored in real time based on pre-deployed sensors; When the feedback data triggers a preset exception rule, the current operation sequence is dynamically interrupted.
[0034] It should be noted that in the embodiment, when the robot tool is in the execution phase, the pre-registered tool library is first searched according to the tool identification in the instruction stream, and the protocol conversion engine is started after verifying the legality of the tool. During protocol conversion, the JSON structured parameters are translated into target industrial protocol instructions according to the mapping rules, for example, {speed: 0.8} is translated into target motor speed control function code 0x06 and speed register address write instruction. Feedback data such as force sensors and vision systems are received in real time during the execution of the instructions. When the data triggers a preset exception rule, for example, the torque suddenly increases and exceeds the threshold or a person is detected to intrude into the area, the current operation sequence is immediately interrupted and the related equipment is frozen. The system automatically generates an exception recovery workflow, including a safety fallback path and a protocol channel switching, and re-executes the task according to the optimized sequence after the environmental risk is removed.
[0035] According to the embodiment of the application, the structured parameters extracted by the executable instruction stream are translated into industrial control instructions based on preset protocol conversion rules, specifically including: Operation parameters are obtained based on preset JSON format analysis; An industrial protocol instruction template is obtained by matching a pre-defined industrial protocol instruction mapping rule library according to the tool identification; The operation parameters are filled into the industrial protocol instruction template; An industrial protocol check code and a tool address prefix are added to the industrial protocol instruction template after filling the parameters, and a binary instruction stream of a target industrial control bus standard is output.
[0036] It should be noted that in the embodiment, the protocol converter first analyzes the JSON parameters and extracts key operation values, matches the industrial protocol instruction mapping rule library according to the tool identification, and locates the target protocol template. Then the parameter values are filled into the specified fields of the protocol template, and data type conversion is performed. Then the necessary check code and device address prefix of the industrial protocol are added, and finally the underlying control instruction conforming to the industrial bus standard is generated. The protocol conversion process ensures that the semantic instructions output by the AI are zero-error adapted to heterogeneous industrial devices.
[0037] It is worth mentioning that it also includes: When a registration request of a new robot tool is received; generating a second tool identifier; extracting a second semantic label and a second parameter template in the registration request; storing the second tool identifier and the second semantic label to the service engine after association; updating a robot capability list and broadcasting to all AI semantic model nodes.
[0038] It should be noted that in the embodiment, when a registration request of a new tool is received, an extension process of the new tool is triggered. First, a globally unique tool identifier is generated, and a semantic label and a parameter template in the description text are extracted. Then, the mapping relationship between the tool identifier and the semantic label is stored to the service discovery engine, and the global robot capability list is updated. Then, the update message is pushed to all AI semantic model nodes through the broadcast mechanism, and the function description and the calling interface of the new tool are provided. In subsequent natural language instruction analysis, the semantic label matching module automatically associates the new tool, realizes instant discovery and calling of new device capabilities, and does not need to retrain the AI model.
[0039] It is worth mentioning that the dynamic authentication chain logic including operation permission judgment is also included, specifically: According to the security token of the operation request, it is judged whether it is issued by a legal user and whether it is expired; If yes, it is verified whether the device identifier in the security token matches the target robot; If yes, it is verified whether the permission range in the security token includes the operation type of the target tool; If yes, it is detected whether the real-time environmental parameter triggers the high-risk operation rule library; If no, it is determined that the permission verification is passed.
[0040] It should be noted that the embodiment provides a four-level authentication verification mechanism. The first authentication is used to confirm that the security token is issued by a legal server and is not expired. Secondly, the device binding authentication is executed, and it is verified that the device identifier embedded in the token completely matches the serial number of the target robot. Then, the operation range authentication is executed, and it is verified that the token permission list contains the operation type of the current tool, for example, the "robot_grasp" permission is required to call the grasping tool. Finally, the environmental risk authentication is executed, and the sensor data is analyzed in real time, including but not limited to the area thermal imaging display that the person is close. If it matches the high-risk rule library, for example, high-speed motion is prohibited within a 1-meter radius around the person, the operation interception is triggered. Only when all four levels of verification are passed, the instruction execution is authorized, forming a depth defense system covering identity, device, operation and environment.
[0041] Figure 4 A block diagram of an AI semantic model and robot interconnection system based on the MCP protocol is shown.
[0042] As Figure 4 shown, the second aspect of the present application discloses an AI semantic model and robot interconnection system 4 based on MCP protocol, comprising a memory 41 and a processor 42, the memory comprising an AI semantic model and robot interconnection method program based on MCP protocol, the AI semantic model and robot interconnection method program based on MCP protocol is executed by the processor to realize the following steps: Obtain natural language instructions, and obtain a structured operation sequence based on a preset semantic analysis model; Extract the semantic label of the structured operation sequence, dynamically match the pre-stored service engine, and generate an operation request comprising a tool identifier and a parameter template; Verify that the security token of the operation request matches the operation authority; If it is an unauthorized operation, a secondary authorization request is initiated to the user; If the authority verification is passed, a security instruction is obtained based on the operation request according to a preset encryption rule; According to the real-time flag of the security instruction, a transmission protocol is dynamically selected and a transmission protocol channel is established, and an executable instruction stream is generated; According to the executable instruction stream, control the tool to execute the instruction operation, and obtain the execution state data; According to the execution state data, generate and feedback the execution state based on the preset encryption rule.
[0043] It should be noted that in the present embodiment, the process is first started by receiving natural language instructions, which are disassembled into structured operation sequences by a preset semantic analysis model, and the action type, target object and parameter constraints are determined. Then extract the semantic label in the sequence, dynamically associate the pre-stored robot tool identifier and parameter template in the service engine, and generate an operation request containing tool call path and input specification. Secondly, verify whether the authority range of the security token in the operation request covers the current operation type. If parameter out-of-bound or high-risk instructions are detected, the user secondary authorization mechanism is triggered and the instruction stream is suspended, and the restriction is released after manual confirmation; if the authority verification is passed, the operation request is structured and encapsulated according to the encryption rule, and the coordinate, device number and other sensitive fields are implemented at the field level, and a session identifier is bound to generate a security instruction. Then, according to the real-time flag in the instruction, a transmission protocol channel is dynamically allocated, as an implementation manner, the key control instruction is directly connected to the local process communication channel, the long-time task is allocated to the streaming push channel, and the cross-network instruction enables the disconnect self-healing channel. Finally, the target tool is driven to execute the industrial operation through the protocol adapted instruction stream, the sensor data is collected in real time and the execution state is encrypted and fed back, forming a closed-loop control from semantic understanding to physical execution.
[0044] Figure 2A matching flowchart of an operation permission is shown.
[0045] According to the embodiment of the present application, as shown in Figure 2 The security token of the operation request is matched with the operation permission, and specifically includes: The device identifier in the security token of the operation request is extracted and bound with the serial number of the target robot; The operation type of the target robot is matched according to the permission range in the security token; When the operation parameter is out of bounds or a high-risk action instruction is detected, it is determined as an unauthorized operation, and a user authorization interceptor is triggered; A secondary authorization request containing operation risk description is generated, and the executable instruction stream of the target robot is suspended; When the operation permission requirement is met, it is determined as passing the verification, and the security instruction is obtained based on the operation request according to the preset encryption rule.
[0046] It should be noted that in the present embodiment, the security token verification process is performed, first, the device identifier is bound with the serial number of the target robot at the hardware level to ensure that the instruction only acts on the specified device. Then, the compatibility of the token permission range and the operation type is matched, for example, the mechanical arm movement needs to have the "robot_move" permission, and the force control operation needs the "robot_force_control" high-level permission. When the parameter detection module identifies that the speed, torque and other values exceed the preset safety threshold, or the instruction involves emergency stop, high-power mode and other high-risk actions, it is determined as an unauthorized operation and the user authorization interceptor is activated. When it is determined as an unauthorized operation, the system also generates a secondary authorization request containing risk details and pushes it to the user end, for example, the risk details are "overspeed 30%, collision risk 25%"; in addition, all pending instruction streams of the robot are frozen. Until the user returns the permission signal through the confirmation interface, the system releases the frozen state and injects the encrypted security instruction into the transmission process, realizing the double confirmation mechanism of the risk operation.
[0047] Figure 3 A security instruction generation flowchart is shown.
[0048] According to the embodiment of the present application, as shown in Figure 3 The security instruction is obtained based on the operation request according to the preset encryption rule, and specifically includes: The operation parameters of the operation request are structured and packaged according to the parameter template corresponding to the tool identifier to obtain structured parameters; According to the parameter template, the parameters of the set field are executed at the field level; The structured parameters after encryption are filtered based on the preset JSON format verification. The filtered structured parameters are generated and bound with integrity check codes, and the security instructions are integrated.
[0049] It should be noted that in the present embodiment, when the generation process of the encrypted security instruction is performed, the operation parameters are first structured and reorganized. As an implementation manner, the original input is normalized into a key-value pair structure according to the corresponding parameter template of the tool identification; for example, the coordinate parameters are encapsulated as {x: 1.2, y: 3.4}. Then, for sensitive fields such as position coordinates and device serial numbers, field-level encryption is performed using a dynamic key bound with a session, to ensure that single data leakage does not affect the overall security. Secondly, the non-structured data and potential injection code are filtered through a mandatory JSON format verification layer, to block malicious instructions from penetrating. Then, an integrity check code based on the session identifier is generated for the encrypted data set; the check code can verify whether the data has been tampered with during transmission. Finally, the integrated security instruction package containing encrypted parameters, check codes and tool call paths is formed, to provide standardized input for subsequent protocol transmission.
[0050] According to the embodiment of the present application, the real-time flag of the security instruction is used to dynamically select a transmission protocol and establish a transmission protocol channel, and the specific process includes: According to the real-time flag of the security instruction, an instruction classification is obtained, including at least real-time control instructions, streaming feedback instructions or cross-network transmission instructions; If the instruction is a real-time control instruction, a local process communication protocol channel is allocated; If the instruction is a streaming feedback instruction, a long connection streaming push protocol channel is allocated; If the instruction is a cross-network transmission instruction, a broken line self-healing transmission protocol channel is allocated; All protocol channels are maintained through a unified session identifier to maintain the continuity of the instructions.
[0051] It should be noted that in the embodiment, when the protocol dynamic selection mechanism is executed, the real-time flag in the security instruction is first parsed, and the real-time flag is classified into three types of scenes, including real-time control instruction, streaming feedback instruction and cross-network transmission instruction. For the real-time control instruction scene, for example, the motion control instruction, the instruction is distributed to the local process communication protocol channel, and the instruction is directly transmitted to the robot drive layer through memory sharing to eliminate the influence of network delay. For the streaming feedback instruction, for example, the task progress information transmission set instruction, the instruction is distributed to the long connection streaming push channel, and the percentage state update is continuously transmitted. For the cross-network instruction scene, for example, the cloud collaboration instruction, the instruction is distributed to the broken line self-healing transmission protocol channel, and the session cache and the automatic reconnection ability within 50 ms are provided. In the embodiment, all channels are embedded with a unified session identifier, and the task context is automatically inherited when the protocol is switched, the task continuity is guaranteed through instruction queue reordering and state snapshot recovery, and the industrial control timing is maintained under extreme network fluctuations.
[0052] According to the embodiment of the application, the tool is controlled to execute the instruction operation according to the executable instruction stream, and specifically comprises: The tool identifier is extracted from the executable instruction stream, and is used to match a pre-registered robot control tool library; If the tool is legal, the structured parameters extracted from the executable instruction stream are translated into industrial control instructions based on a preset protocol conversion rule; When the industrial control instruction is executed, the feedback data is monitored in real time based on a pre-deployed sensor; When the feedback data triggers a preset abnormal rule, the current operation sequence is dynamically interrupted.
[0053] It should be noted that in the embodiment, when the robot tool executes, the pre-registered tool library is first searched according to the tool identifier in the instruction stream, and the protocol conversion engine is started after the legality of the tool is verified. When the protocol is converted, the JSON structured parameters are translated into target industrial protocol instructions according to the mapping rule, for example, {speed: 0.8} is translated into target motor speed control function code 0x06 and speed register address write instruction. In the instruction execution process, feedback data such as force sensor and vision system is received in real time. When the data triggers a preset abnormal rule, for example, the torque suddenly increases and exceeds the threshold or a person intrudes into the area, the current operation sequence is interrupted and the related equipment is frozen. The system automatically generates an abnormal recovery workflow, including a safety rollback path and a protocol channel switching, and re-executes the task according to the optimized sequence after the environmental risk is removed.
[0054] According to the embodiment of the application, the structured parameters extracted from the executable instruction stream are translated into industrial control instructions based on a preset protocol conversion rule, and specifically comprises: The operation parameters are obtained based on the preset JSON format analysis; Matching a predefined industrial protocol instruction mapping rule base according to the tool identifier to obtain an industrial protocol instruction template; Filling the operation parameters into the industrial protocol instruction template; An industrial protocol check code and a tool address prefix are added to the industrial protocol instruction template after the parameters are filled, and a binary instruction stream of the target industrial control bus standard is output.
[0055] It should be noted that in this embodiment, the protocol converter first parses the JSON parameters and extracts key operation values. It then matches the industrial protocol instruction mapping rule base based on the tool identifier to locate the target protocol template. The parameter values are then filled into the specified fields of the protocol template and the data type conversion is performed. The checksum and device address prefix required by the industrial protocol are then added, and finally the underlying control instructions that comply with the industrial bus standard are generated. The protocol conversion process ensures that the semantic instructions output by the AI are zero-error adapted to heterogeneous industrial equipment.
[0056] It is worth mentioning that it also includes: When a registration request for a new robot tool is received; generating a second tool identifier; Extracting the second semantic tag and the second parameter template in the registration request; After associating the second tool identifier with the second semantic tag, storing the resultant information in the service engine; Update the robot capability list and broadcast it to all AI semantic model nodes.
[0057] It should be noted that in this embodiment, when a new tool registration request is received, the expansion process of the new tool is triggered. First, a globally unique tool identifier is generated and the semantic tags and parameter templates in the description text are extracted. The mapping relationship between the tool identifier and the semantic tag is then stored in the service discovery engine, and the global robot capability list is updated. Then, an update message is pushed to all AI semantic model nodes through a broadcast mechanism, providing a functional description and calling interface of the new tool. During the subsequent natural language instruction parsing, the semantic tag matching module automatically associates the new tool, enabling instant discovery and calling of new device capabilities without the need to retrain the AI model.
[0058] It is worth mentioning that it also includes the dynamic authentication chain logic for operation permission judgment, specifically: Determine, based on the security token requested by the operation, whether it is issued by a legitimate user and has not expired; If so, check whether the device identifier in the security token matches the target robot; If so, check whether the permission scope in the security token includes the operation type of the target tool; If so, check whether the real-time environmental parameters trigger the high-risk operation rule library; If not, it is determined that the permission check is passed.
[0059] It should be noted that the embodiment provides a four-level authentication verification mechanism. First authentication is used to confirm that the security token is issued by a legal server and is not expired. Secondly, device binding authentication is performed, and the embedded device identifier in the token is matched with the serial number of the target robot. Then, operation range authentication is performed, and the token permission list is verified to contain the operation type of the current tool, for example, the "robot_grasp" permission is obtained for calling the grasping tool. Finally, environment risk authentication is performed, and sensor data is analyzed in real time, including but not limited to area thermal imaging showing that a person is close, if the high-risk rule base is matched, for example, high-speed motion is prohibited within a 1-meter radius around the person, then the operation interception is triggered. Only when all four levels of verification are passed, the instruction execution is authorized, forming a depth defense system covering identity, device, operation and environment.
[0060] The third aspect of the application provides a computer readable storage medium, wherein the computer readable storage medium comprises an AI semantic model and robot interconnection method program based on the MCP protocol, and the AI semantic model and robot interconnection method program based on the MCP protocol is executed by the processor to realize the steps of the AI semantic model and robot interconnection method based on the MCP protocol as described in any one of the above.
[0061] In summary, the application provides an AI semantic model and robot interconnection method, system and medium based on the MCP protocol, which receives natural language instructions and generates a structured operation sequence through a semantic analysis model; extracts semantic tags in the sequence to dynamically match a service engine, generates an operation request containing a tool identifier and parameter template; based on the verification of the security token, the operation permission is verified, if the operation is exceeded, the user is authorized again, if the permission is passed, the operation request is encapsulated into a secure instruction according to the encryption rule; based on the real-time flag bit, the transmission protocol channel is dynamically selected, and an executable instruction stream is generated, so as to drive the target tool to execute the operation and feedback the execution state data; the application solves the heterogeneous problem of AI and robot instructions by dynamically matching semantics and robot tools, intercepts the operation exceeding the authority based on the permission check, and guarantees the data security by field-level encryption, and provides a safe and efficient human-computer interaction architecture for intelligent manufacturing.
[0062] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0063] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for interconnecting an AI semantic model and a robot based on the MCP protocol, characterized in that: The method comprises: Obtain natural language instructions and obtain a structured operation sequence based on a preset semantic parsing model; Extracting semantic tags of the structured operation sequence, dynamically matching with a pre-stored service engine, and generating an operation request including a tool identifier and a parameter template; Verify that the security token of the operation request matches the operation authority; If it is an unauthorized operation, a secondary authorization request will be sent to the user; If the permission check passes, a security instruction is obtained according to the operation request based on the preset encryption rules; According to the real-time flag of the security instruction, a transmission protocol is dynamically selected and a transmission protocol channel is established to generate an executable instruction stream; According to the executable instruction stream, the control tool executes instruction operations and obtains execution status data; According to the execution status data, based on preset encryption rules, an execution status is generated and fed back.
2. The method for interconnecting an AI semantic model and a robot based on the MCP protocol according to claim 1, characterized in that: Verifying that the security token of the operation request matches the operation authority specifically includes: Extract the device identifier from the security token of the operation request and establish a binding relationship with the target robot serial number; Match the target robot's operation type based on the permission scope in the security token; When an operation parameter exceeds the limit or a high-risk action instruction is detected, it is determined to be an unauthorized operation and triggers user authorization interception; Generate a secondary authorization request containing an operational risk description and suspend the executable instruction flow of the target robot; When the operation authority requirements are met, it is determined that the verification has been passed, and based on the preset encryption rules, a security instruction is obtained according to the operation request.
3. The method for interconnecting an AI semantic model and a robot based on the MCP protocol according to claim 2, characterized in that: The obtaining of a security instruction based on the preset encryption rule and the operation request specifically includes: Structurally encapsulate the operation parameters of the operation request according to the parameter template corresponding to the tool identifier to obtain structured parameters; Perform field-level encryption on the parameters of the set fields according to the parameter template; Filter the encrypted structured parameters based on the preset JSON format verification; An integrity check code is generated and bound to the filtered structured parameters, and the security instructions are obtained by integration.
4. The method for interconnecting an AI semantic model and a robot based on the MCP protocol according to claim 1, characterized in that: The dynamically selecting a transmission protocol and establishing a transmission protocol channel according to the real-time flag of the security instruction specifically includes: According to the real-time flag of the security instruction, an instruction classification is obtained, which at least includes a real-time control instruction, a streaming feedback instruction or a cross-network transmission instruction; If it is a real-time control instruction, a local process communication protocol channel is allocated; If it is a streaming feedback instruction, a long connection streaming push protocol channel is allocated; If it is a cross-network transmission instruction, a disconnection self-healing transmission protocol channel is allocated; All protocol channels use a unified session identifier to maintain command continuity.
5. The method for interconnecting an AI semantic model and a robot based on the MCP protocol according to claim 1, characterized in that: The controlling tool to execute instruction operations according to the executable instruction stream specifically includes: Extracting a tool identifier according to the executable instruction stream for matching a pre-registered robot control tool library; If the tool is legitimate, translating the structured parameters extracted from the executable instruction stream into industrial control instructions based on preset protocol conversion rules; When executing industrial control instructions, real-time monitoring feedback data is based on pre-deployed sensors; When feedback data triggers preset exception rules, the current operation sequence is dynamically interrupted.
6. The method for interconnecting an AI semantic model and a robot based on the MCP protocol according to claim 5, characterized in that: The method of translating the structured parameters extracted from the executable instruction stream into industrial control instructions based on preset protocol conversion rules specifically includes: Obtain operation parameters based on the preset JSON format parsing; Matching a predefined industrial protocol instruction mapping rule base according to the tool identifier to obtain an industrial protocol instruction template; Filling the operation parameters into the industrial protocol instruction template; An industrial protocol check code and a tool address prefix are added to the industrial protocol instruction template after the parameters are filled, and a binary instruction stream of the target industrial control bus standard is output.
7. An AI semantic model and robot interconnection system based on the MCP protocol, characterized in that: The system includes a memory and a processor. The memory includes an AI semantic model and robot interconnection method program based on the MCP protocol. When the AI semantic model and robot interconnection method program based on the MCP protocol is executed by the processor, the following steps are implemented: Obtain natural language instructions and obtain a structured operation sequence based on a preset semantic parsing model; Extracting semantic tags of the structured operation sequence, dynamically matching with a pre-stored service engine, and generating an operation request including a tool identifier and a parameter template; Verify that the security token of the operation request matches the operation authority; If it is an unauthorized operation, a secondary authorization request will be sent to the user; If the permission check passes, a security instruction is obtained according to the operation request based on the preset encryption rules; According to the real-time flag of the security instruction, a transmission protocol is dynamically selected and a transmission protocol channel is established to generate an executable instruction stream; According to the executable instruction stream, the control tool executes instruction operations and obtains execution status data; According to the execution status data, based on preset encryption rules, an execution status is generated and fed back.
8. The AI semantic model and robot interconnection system based on the MCP protocol according to claim 7, characterized in that: Verifying that the security token of the operation request matches the operation authority specifically includes: Extract the device identifier from the security token of the operation request and establish a binding relationship with the target robot serial number; Match the target robot's operation type based on the permission scope in the security token; When an operation parameter exceeds the limit or a high-risk action instruction is detected, it is determined to be an unauthorized operation and triggers user authorization interception; Generate a secondary authorization request containing an operational risk description and suspend the executable instruction flow of the target robot; When the operation authority requirements are met, it is determined that the verification has been passed, and based on the preset encryption rules, a security instruction is obtained according to the operation request.
9. The AI semantic model and robot interconnection system based on the MCP protocol according to claim 8, characterized in that: The obtaining of a security instruction based on the preset encryption rule and the operation request specifically includes: Structurally encapsulate the operation parameters of the operation request according to the parameter template corresponding to the tool identifier to obtain structured parameters; Perform field-level encryption on the parameters of the set fields according to the parameter template; Filter the encrypted structured parameters based on the preset JSON format verification; An integrity check code is generated and bound to the filtered structured parameters, and the security instructions are obtained by integration.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer-readable storage medium includes a method program for interconnecting an AI semantic model and a robot based on the MCP protocol. When the method program for interconnecting an AI semantic model and a robot based on the MCP protocol is executed by a processor, the steps of the method for interconnecting an AI semantic model and a robot based on the MCP protocol are implemented as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Internet of Things data transmission method and device, medium and electronic equipment
CN111274268A
Permission verification method and device, equipment and storage medium
CN117332435A
Equipment management method and system based on industrial internet identification analysis system
CN120091071A
Agent-based tool combination and task processing method and device, equipment and medium
CN120276875A
Security protection method, system and device for target network and medium
CN120321646A
Cited By
Method and device for interaction between robot and environment and electronic equipment
CN121245923A
Method, apparatus, and electronic device for robot interaction with environment
CN121245923B
Robot guide explanation task planning method and system based on multi-modal large model
CN122195587A