Disclosure of Invention
The present invention proposes the following technical solution to one or more of the above technical drawbacks of the prior art.
A cross-environment AI task collaborative execution method based on MCP protocol (i.e., model context protocol), the method comprising:
Packaging, namely respectively packaging a plurality of different application programs deployed on a local system into a unified interface API (application program interface), wherein each application program corresponds to one unified interface API, and the packaged unified interface API supports context awareness operation;
a context management step, namely constructing an MCP protocol at a cloud end, acquiring the current state of each application program executing task through a unified interface API based on the MCP protocol, and keeping the data among different application programs consistent through the context of the current state;
And executing, namely receiving an operation request input by a user at a cloud end, converting the operation request of the user into an MCP operation intention based on an MCP protocol, converting the MCP operation intention into an operation command of at least one application program, transmitting the operation command to a corresponding application program deployed on a local system through a unified interface API, executing corresponding operation by the application program based on the operation command, and updating the current state of the application program by using an operation result.
Further, the operation of respectively encapsulating the plurality of different locally deployed application programs into a unified interface API is that for the Web application program, data is acquired in real time through a REST/GRAPHQL API docking service and mapped to upper and lower text segments, for the tool application program, a system-level event of the local software is monitored by using an operating system hook function, an operating state is captured, interface elements are kept or identified through OCR, a tool_state field in a context is dynamically updated, and for the local private system application program, the context synchronization of the private system application program and the MCP protocol is realized by using an SDK and a middleware.
Still further, the operation of constructing the MCP protocol at the cloud end is:
The method comprises the steps of defining a context data structure, an intention layer, a data stream layer, a tool state layer, a security policy layer, a version control mechanism and a storage overhead, wherein the intention layer is used for defining task targets and constraints;
The method comprises the steps of context synchronization and conflict management, namely, real-time synchronization, broadcasting a context change event by using a publish-subscribe mode, receiving update by an associated application program through a message queue, conflict resolution strategy, manual arbitration, off-line synchronization guarantee, automatic loading of the latest valid state during task recovery, and ensuring continuity in a network-disconnection scene, wherein the conflict resolution strategy is time sequence priority, is suitable for non-critical parameters based on the change of the latest timestamp, freezes the context and informs a user of intervention treatment aiming at key data conflict;
Tool chain adaptation and execution optimization, namely forward conversion, reverse conversion, analysis of application program output and extraction of key information update context, atomization operation encapsulation, recording of local software operation sequence through CV+OS hook function, generation of reusable script instruction, context binding, and execution of script triggering meeting of context condition, wherein the forward conversion converts structured intention in MCP into operation instruction native instruction of application program;
The security and authority control comprises the steps of data security enhancement, supporting individual encryption of sensitive fields, enabling a secret key to be managed by a Hardware Security Module (HSM), ensuring that a cloud only processes ciphertext and is dynamically desensitized, returning differentiated data according to a user role, and zero trust authority management, and supporting verification of a digital certificate and role authority of an application program every time the application program accesses a context.
Further, in the executing step, task dependency analysis is performed on the MCP operation intention to be disassembled into a task subgraph, the task subgraph is converted into an operation command of a corresponding application program, a tool chain formed by the application program is dynamically scheduled based on a context state according to the operation command of the application program, so that the task is continuously executed, if a network is interrupted in the executing process, a latest context check point is loaded from a session pool, the completed operation is skipped, and a secondary confirmation flow is triggered to perform operation verification before executing a key operation, so that misoperation is prevented.
Further, the operation of dynamically scheduling the tool chain formed by the application programs based on the context state according to the operation commands of the application programs is that all operation commands obtained by converting all task subgraphs are sequenced based on task dependencies to obtain an operation command execution dependency graph, an application program calling sequence is generated based on the operation command execution dependency graph to obtain the tool chain of the application programs, the context state of the operation commands currently executed is monitored, and if the context state meets the requirement of executing the next operation command, the application program corresponding to the next operation command is called in the tool chain until all the operation commands are executed.
Further, after the operation command execution dependency graph is obtained, the cloud uses a first thread to send a first memory use request to the local system, the first memory size of the first memory use request application is determined based on a first operation command in the operation command execution dependency graph, the cloud uses a second thread to send a second memory use request to the local system, the second memory size of the second memory use request application is determined based on a second operation command in the operation command execution dependency graph, after the first operation command is completely executed, context state data executed in the first memory is sent to the cloud for storage based on a third operation command in the operation command execution dependency graph, if the third memory size is smaller than or equal to the first memory size, the third memory size is deleted, the third operation command is executed in the first memory, if the third memory size is larger than the first memory size, the second memory size is determined based on the second operation command in the operation command execution dependency graph, the third thread execution dependency graph is not executed in the local system, and if the third memory size is smaller than the first memory size, the third memory size is not required to be executed, and if the third memory size is not executed in the third memory command execution graph, the third memory size has the third memory request application, and if the third memory request is executed in the third memory command execution graph, and the third memory size is completely executed.
Furthermore, a monitoring audit layer is arranged at the cloud end and used for monitoring the state of the local system in real time and providing abnormal alarm and audit tracing.
The invention also provides a cross-environment AI task cooperative execution device based on the MCP protocol, which comprises:
The packaging unit is used for respectively packaging a plurality of different application programs deployed on the local system into a unified interface API (application program interface), wherein each application program corresponds to one unified interface API, and the packaged unified interface API supports context awareness operation;
the context management unit constructs an MCP protocol at the cloud end, obtains the current state of each application program executing task through a unified interface API based on the MCP protocol, and enables data among different application programs to be consistent through the context of the current state;
The system comprises an execution unit, a unified interface API and a local system, wherein the execution unit receives an operation request input by a user at a cloud end, converts the operation request of the user into an MCP operation intention based on an MCP protocol, converts the MCP operation intention into an operation command of at least one application program, and transmits the operation command to the corresponding application program deployed on the local system through the unified interface API, and the application program executes corresponding operation based on the operation command and uses an operation result to update the current state of the application program.
Further, the operation of respectively encapsulating the plurality of different locally deployed application programs into a unified interface API is that for the Web application program, data is acquired in real time through a REST/GRAPHQL API docking service and mapped to upper and lower text segments, for the tool application program, a system-level event of the local software is monitored by using an operating system hook function, an operating state is captured, interface elements are kept or identified through OCR, a tool_state field in a context is dynamically updated, and for the local private system application program, the context synchronization of the private system application program and the MCP protocol is realized by using an SDK and a middleware.
Still further, the operation of constructing the MCP protocol at the cloud end is:
The method comprises the steps of defining a context data structure, an intention layer, a data stream layer, a tool state layer, a security policy layer, a version control mechanism and a storage overhead, wherein the intention layer is used for defining task targets and constraints;
The method comprises the steps of context synchronization and conflict management, namely, real-time synchronization, broadcasting a context change event by using a publish-subscribe mode, receiving update by an associated application program through a message queue, conflict resolution strategy, manual arbitration, off-line synchronization guarantee, automatic loading of the latest valid state during task recovery, and ensuring continuity in a network-disconnection scene, wherein the conflict resolution strategy is time sequence priority, is suitable for non-critical parameters based on the change of the latest timestamp, freezes the context and informs a user of intervention treatment aiming at key data conflict;
Tool chain adaptation and execution optimization, namely forward conversion, reverse conversion, analysis of application program output and extraction of key information update context, atomization operation encapsulation, recording of local software operation sequence through CV+OS hook function, generation of reusable script instruction, context binding, and execution of script triggering meeting of context condition, wherein the forward conversion converts structured intention in MCP into operation instruction native instruction of application program;
The security and authority control comprises the steps of data security enhancement, supporting individual encryption of sensitive fields, enabling a secret key to be managed by a Hardware Security Module (HSM), ensuring that a cloud only processes ciphertext and is dynamically desensitized, returning differentiated data according to a user role, and zero trust authority management, and supporting verification of a digital certificate and role authority of an application program every time the application program accesses a context.
Furthermore, in the execution unit, task dependency analysis is performed on the MCP operation intention to be disassembled into a task subgraph, the task subgraph is converted into an operation command of a corresponding application program, a tool chain formed by the application program is dynamically scheduled based on a context state according to the operation command of the application program, so that the task is continuously executed, if a network is interrupted in the execution process, a latest context check point is loaded from a session pool, the completed operation is skipped, and a secondary confirmation flow is triggered to perform operation verification before the key operation is executed, so that misoperation is prevented.
Further, the operation of dynamically scheduling the tool chain formed by the application programs based on the context state according to the operation commands of the application programs is that all operation commands obtained by converting all task subgraphs are sequenced based on task dependencies to obtain an operation command execution dependency graph, an application program calling sequence is generated based on the operation command execution dependency graph to obtain the tool chain of the application programs, the context state of the operation commands currently executed is monitored, and if the context state meets the requirement of executing the next operation command, the application program corresponding to the next operation command is called in the tool chain until all the operation commands are executed.
Further, after the operation command execution dependency graph is obtained, the cloud uses a first thread to send a first memory use request to the local system, the first memory size of the first memory use request application is determined based on a first operation command in the operation command execution dependency graph, the cloud uses a second thread to send a second memory use request to the local system, the second memory size of the second memory use request application is determined based on a second operation command in the operation command execution dependency graph, after the first operation command is completely executed, context state data executed in the first memory is sent to the cloud for storage based on a third operation command in the operation command execution dependency graph, if the third memory size is smaller than or equal to the first memory size, the third memory size is deleted, the third operation command is executed in the first memory, if the third memory size is larger than the first memory size, the second memory size is determined based on the second operation command in the operation command execution dependency graph, the third thread execution dependency graph is not executed in the local system, and if the third memory size is smaller than the first memory size, the third memory size is not required to be executed, and if the third memory size is not executed in the third memory command execution graph, the third memory size has the third memory request application, and if the third memory request is executed in the third memory command execution graph, and the third memory size is completely executed.
Furthermore, a monitoring audit layer is arranged at the cloud end and used for monitoring the state of the local system in real time and providing abnormal alarm and audit tracing.
The invention also proposes a computer readable storage medium having stored thereon computer program code which, when executed by a computer, performs any of the methods described above.
The method and device for executing the cross-environment AI task cooperatively based on the MCP protocol and the storage medium have the technical effects that the packaging step S101 respectively packages a plurality of different application programs deployed on a local system into a unified interface API, each application program corresponds to one unified interface API, the packaged unified interface API supports context awareness operation, the context management step S102 builds the MCP protocol in the cloud and obtains the current state of each application program executing task through the unified interface API based on the MCP protocol, the data among the different application programs are kept consistent through the context of the current state, the execution step S103 receives an operation request input by a user, converts the operation request of the user into an operation intention of the MCP based on the MCP protocol, converts the operation intention of the MCP into an operation command of at least one application program, and transmits the operation command to the corresponding application program deployed on the local system through the unified interface API, and the application program executes corresponding operation based on the operation command and updates the current state of the application program by using an operation result. According to the invention, a bidirectional operation path of cloud AI and local non-API software is established, a tool chain barrier is broken, local sensitive data is available and invisible, the cloud is ensured to only acquire a desensitization result, local hardware resources and cloud computing power are dynamically coordinated, an elastic hybrid computing architecture is constructed, and mechanisms such as off-network continuous transmission, operation verification and the like are supported, so that the success rate of a cross-environment task is improved.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the present application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Fig. 1 shows a cross-environment AI task collaborative execution method based on MCP protocol, which includes:
A packaging step S101, in which a plurality of different application programs deployed on a local system are respectively packaged into a unified interface API, each application program corresponds to a unified interface API, and the packaged unified interface API supports a context awareness operation;
A context management step S102, namely constructing an MCP protocol at a cloud end, acquiring the current state of each application program execution task through a unified interface API based on the MCP protocol, and keeping the data among different application programs consistent through the context of the current state;
Step S103 is executed, an operation request input by a user is received at the cloud end, the operation request of the user is converted into an MCP operation intention based on an MCP protocol, the MCP operation intention is converted into an operation command of at least one application program, the operation command is transmitted to a corresponding application program deployed on a local system through a unified interface API, the application program executes corresponding operation based on the operation command, and the current state of the application program is updated by using an operation result.
For example, the operation request input by the user is 'please obtain the attendance record list of the employee in March', the MCP protocol can be converted into the MCP operation intention, for example, the operation intention is to check whether the user has the identity of an attendance manager, if so, the personnel systems such as a login attendance system, a nailing and card punching system and the like obtain the attendance data of the employee in March, and finally, a local system command needing to be called is generated, for example, a web-based attendance data acquisition command, a nailing and card punching data acquisition command, an excel form generation command and the like, so that the interaction between the AI application and the local application program is realized.
In the invention, a plurality of different application programs deployed on a local system are respectively packaged into unified interface APIs (application program interfaces), each application program corresponds to one unified interface API, the packaged unified interface APIs support context-aware operation, an MCP (micro control protocol) protocol is built in the cloud end, the current state of each application program executing task is obtained through the unified interface APIs based on the MCP protocol, data among the different application programs are kept consistent through the context of the current state, finally, an operation request input by a user is received at the cloud end, the operation request of the user is converted into an MCP operation intention based on the MCP protocol, the MCP operation intention is converted into an operation command of at least one application program, the operation command is transmitted to the corresponding application program deployed on the local system through the unified interface APIs, the application program executes corresponding operation based on the operation command, and the current state of the application program is updated through operation results, namely, the invention realizes interaction between an AI (application program) and the application program of the traditional local system based on the MCP protocol, and can be based on the MCP,
The context of the protocol performs data synchronization among a plurality of applications, namely, a hybrid control channel is constructed through the MCP protocol, a bidirectional operation path of cloud AI and local non-API software is established, a tool chain barrier is broken through, and the software operation efficiency is improved, which is an important invention point of the invention.
In one embodiment, the operation of respectively encapsulating the plurality of different application programs deployed locally into a unified interface API is that for a Web application program, data is acquired in real time through a REST/GRAPHQL API docking service and mapped to upper and lower text segments, for a tool application program, a system-level event of local software is monitored by using an operating system hook function, an operating state is captured, an interface element is maintained or identified through OCR, a tool_state field in a context is dynamically updated, and for a local private system application program, the context synchronization of the private system application program and an MCP protocol is realized by using an SDK and middleware.
The invention encapsulates heterogeneous tools (Web application, local software and private system) into a unified interface to support context-aware operation, thereby being capable of operating by using MCP protocol context, improving the intelligent level of local non-AI application, and further improving the application efficiency, which is another important invention conception of the invention.
In one embodiment, the operation of constructing the MCP protocol in the cloud comprises defining a context data structure, an intention layer, a data stream layer, a tool state layer, a security policy layer, a version control mechanism, a storage increment difference (Delta) and a storage overhead reduction, wherein the intention layer is used for defining task targets and constraints, the data stream layer is used for recording data sources and output paths, the tool state layer is used for storing real-time snapshots of all application programs, the security policy layer is used for configuring access control rules, encryption algorithms and desensitization policies, and the version control mechanism is arranged, and unique version identifiers are generated by each context change;
The method comprises the steps of context synchronization and conflict management, namely, real-time synchronization, broadcasting a context change event by using a publish-subscribe mode, receiving update by an associated application program through a message queue, conflict resolution strategy, manual arbitration, off-line synchronization guarantee, automatic loading of the latest valid state during task recovery, and ensuring continuity in a network-disconnection scene, wherein the conflict resolution strategy is time sequence priority, is suitable for non-critical parameters based on the change of the latest timestamp, freezes the context and informs a user of intervention treatment aiming at key data conflict;
Tool chain adaptation and execution optimization, namely forward conversion, reverse conversion, analysis of application program output and extraction of key information update context, atomization operation encapsulation, recording of local software operation sequence through CV+OS hook function, generation of reusable script instruction, context binding, and execution of script triggering meeting of context condition, wherein the forward conversion converts structured intention in MCP into operation instruction native instruction of application program;
The security and authority control comprises the steps of data security enhancement, supporting individual encryption of sensitive fields, enabling a secret key to be managed by a Hardware Security Module (HSM), ensuring that a cloud only processes ciphertext and is dynamically desensitized, returning differentiated data according to a user role, and zero trust authority management, and supporting verification of a digital certificate and role authority of an application program every time the application program accesses a context.
According to the invention, the MCP protocol is realized at the cloud, the local non-AI application can be uniformly called in a form of packaging a uniform interface, the operation request input by a user is converted into one or more operation commands of the local non-AI application by the AI application through the MCP intention and the native instructions of the application program, the corresponding application program is called based on a certain rule, finally the required operation result of the user is obtained, the local software operation sequence is recorded through a CV+OS hook function, a reusable script instruction is generated, and the context is bound to meet the execution of a context condition triggering script, so that the efficiency and the accuracy of the operation command execution are improved, a high-reliability execution guarantee can be provided, the mechanisms such as discontinuous network transmission, operation verification and the like are supported, and the cross-environment task success rate is improved to 99.9%, which is another important conception of the invention.
In the aspect of data storage, the invention adopts a distributed database (Redis) to store the context snapshot, each context change generates an increment version, and the time stamp, the operator and the change content are recorded. The invention also supports version backtracking, and the historical state is rapidly positioned through a time axis or event labels (such as 'task start' and 'parameter update'). The security audit is supported, key operations (such as context deletion and authority change) are recorded through a persistence technology, the fact that the log is not tamperable and compliance examination is facilitated is ensured, and the security audit is an important invention conception of the invention.
In one embodiment, in the executing step S103, the MCP operation intention is decomposed into task subgraphs by task dependency analysis, the task subgraphs are converted into operation commands of corresponding application programs, a tool chain formed by the application programs is dynamically scheduled based on context states according to the operation commands of the application programs, so that the tasks are continuously executed, if a network is interrupted in the executing process, a latest context check point is loaded from a session pool, the completed operation is skipped, and a secondary confirmation flow is triggered to perform operation verification before executing a key operation, so as to prevent misoperation.
In one embodiment, the operation of dynamically scheduling the tool chain formed by the application program based on the context state according to the operation command of the application program is that all operation commands obtained by converting all task subgraphs are sequenced based on task dependence to obtain an operation command execution dependency graph, an application program calling sequence is generated based on the operation command execution dependency graph to obtain the tool chain of the application program, the context state of the operation command currently executed is monitored, and if the context state meets the requirement of executing the next operation command, the application program corresponding to the next operation command is called in the tool chain until all operation commands are executed.
Another important inventive concept of the present invention is that, because the MCP operation intention may involve a plurality of application programs, such as 'obtain attendance records of staff march' in the previous example, in order to improve the execution efficiency of the non-AI local application, it is necessary to disassemble the MCP operation intention into task subgraphs based on the MCP protocol in the cloud, where each node corresponds to the operation of an application program, and generate a tool chain of the application program based on the task subgraphs, so that the application program can be invoked in a chained manner to perform sequential processing of operation commands, thereby improving the processing efficiency, and realizing the "available invisible" local sensitive data by enhanced privacy protection, so as to ensure that the cloud only obtains the desensitization result, such as only obtaining the attendance records of the user from the human system, but not obtaining other private data of the user in the human system. This is another important invention point of the present invention.
In an embodiment, after the operation command execution dependency graph is obtained, the cloud end uses a first thread to send a first memory usage request to the local system, a first memory size applied by the first memory usage request is determined based on a first operation command in the operation command execution dependency graph, the cloud end uses a second thread to send a second memory usage request to the local system, a second memory size applied by the second memory usage request is determined based on a second operation command in the operation command execution dependency graph, after the first operation command is detected to be executed, context state data executed in the first memory is sent to the cloud end for storage, meanwhile, a third memory size is determined based on a third operation command in the operation command execution dependency graph, if the third memory size is smaller than or equal to the first memory size, context state data in the first memory is deleted, the third operation command is executed in the first memory, if the third memory size is larger than the first memory size, the second memory size is larger than the second memory size applied by the mirror image application dependency graph, the third memory size is not executed by the mirror image application system, and if the third memory size is smaller than the first memory size, the third memory size is not executed in the mirror image application graph, and the third memory command is executed until all the memory commands can be executed, and all the memory commands in the memory request are completely executed, and the third memory requests can be executed.
In the invention, because the operation request of the user generally relates to the operation of a plurality of non-AI local applications, more than three are generally defaulted to meet the complex requirement of the user, and therefore, a great deal of non-local applications are called at the same time, if the non-local applications are processed locally, the performance of the local system is greatly influenced, the invention creatively provides that the general first and second applications are executed locally, the third application is executed in the cloud, if the memory does not meet the requirement, the third application is executed in the cloud, the corresponding mirror image is required to be loaded in the cloud to execute the corresponding operation, of course, the second operation command is executed in the cloud, but the mirror image of the application is wasted, based on the prior art, the performance of the local system is generally higher, so that the third operation command is judged to be executed or not, and the occupation of a great deal of bandwidth is avoided, and the performance of the local system is also prevented from being excessively influenced, thereby realizing the dynamic coordination of local hardware resources and architecture resources, and the construction of the elastic hybrid computing is an important concept of the invention.
In one embodiment, a monitoring audit layer is arranged at the cloud end and is used for monitoring the state of the local system in real time and providing abnormal alarm and audit tracing. For example, by Prometaus monitoring resource utilization (e.g., GPU load, memory usage), a visualization panel is generated in conjunction with Grafana. E.g. exception handling, automatic alarm, triggering SMS/mail notification when an exception is detected (e.g. tool response time-out). And (3) preserving the context snapshot, namely preserving the context version when the abnormality occurs, and supporting the retrospective analysis after the manual intervention.
Fig. 2 shows a cross-environment AI task cooperative execution apparatus based on MCP protocol of the present invention, the apparatus includes:
the packaging unit 201 packages a plurality of different application programs deployed on the local system into a unified interface API respectively, each application program corresponds to a unified interface API, and the packaged unified interface API supports context-aware operations;
The context management unit 202 builds an MCP protocol at the cloud end, obtains the current state of each application program executing task through the unified interface API based on the MCP protocol, and enables data among different application programs to be consistent through the context of the current state;
The execution unit 203 receives an operation request input by a user at the cloud, converts the operation request of the user into an MCP operation intention based on an MCP protocol, converts the MCP operation intention into an operation command of at least one application program, and transmits the operation command to a corresponding application program deployed on a local system through a unified interface API, wherein the application program executes a corresponding operation based on the operation command, and updates a current state of the application program using an operation result.
For example, the operation request input by the user is 'please obtain the attendance record list of the employee in March', the MCP protocol can be converted into the MCP operation intention, for example, the operation intention is to check whether the user has the identity of an attendance manager, if so, the personnel systems such as a login attendance system, a nailing and card punching system and the like obtain the attendance data of the employee in March, and finally, a local system command needing to be called is generated, for example, a web-based attendance data acquisition command, a nailing and card punching data acquisition command, an excel form generation command and the like, so that the interaction between the AI application and the local application program is realized.
In the invention, a plurality of different application programs deployed on a local system are respectively packaged into unified interface APIs (application program interfaces), each application program corresponds to one unified interface API, the packaged unified interface APIs support context-aware operation, an MCP (micro control protocol) protocol is built in the cloud end, the current state of each application program executing task is obtained through the unified interface APIs based on the MCP protocol, data among the different application programs are kept consistent through the context of the current state, finally, an operation request input by a user is received at the cloud end, the operation request of the user is converted into an MCP operation intention based on the MCP protocol, the MCP operation intention is converted into an operation command of at least one application program, the operation command is transmitted to the corresponding application program deployed on the local system through the unified interface APIs, the application program executes corresponding operation based on the operation command, and the current state of the application program is updated through operation results, namely, the invention realizes interaction between an AI (application program) and the application program of the traditional local system based on the MCP protocol, and can be based on the MCP,
The context of the protocol performs data synchronization among a plurality of applications, namely, a hybrid control channel is constructed through the MCP protocol, a bidirectional operation path of cloud AI and local non-API software is established, a tool chain barrier is broken through, and the software operation efficiency is improved, which is an important invention point of the invention.
In one embodiment, the operation of respectively encapsulating the plurality of different application programs deployed locally into a unified interface API is that for a Web application program, data is acquired in real time through a REST/GRAPHQL API docking service and mapped to upper and lower text segments, for a tool application program, a system-level event of local software is monitored by using an operating system hook function, an operating state is captured, an interface element is maintained or identified through OCR, a tool_state field in a context is dynamically updated, and for a local private system application program, the context synchronization of the private system application program and an MCP protocol is realized by using an SDK and middleware.
The invention encapsulates heterogeneous tools (Web application, local software and private system) into a unified interface to support context-aware operation, thereby being capable of operating by using MCP protocol context, improving the intelligent level of local non-AI application, and further improving the application efficiency, which is another important invention conception of the invention.
In one embodiment, the operation of constructing the MCP protocol in the cloud comprises defining a context data structure, an intention layer, a data stream layer, a tool state layer, a security policy layer, a version control mechanism, a storage increment difference (Delta) and a storage overhead reduction, wherein the intention layer is used for defining task targets and constraints, the data stream layer is used for recording data sources and output paths, the tool state layer is used for storing real-time snapshots of all application programs, the security policy layer is used for configuring access control rules, encryption algorithms and desensitization policies, and the version control mechanism is arranged, and unique version identifiers are generated by each context change;
The method comprises the steps of context synchronization and conflict management, namely, real-time synchronization, broadcasting a context change event by using a publish-subscribe mode, receiving update by an associated application program through a message queue, conflict resolution strategy, manual arbitration, off-line synchronization guarantee, automatic loading of the latest valid state during task recovery, and ensuring continuity in a network-disconnection scene, wherein the conflict resolution strategy is time sequence priority, is suitable for non-critical parameters based on the change of the latest timestamp, freezes the context and informs a user of intervention treatment aiming at key data conflict;
Tool chain adaptation and execution optimization, namely forward conversion, reverse conversion, analysis of application program output and extraction of key information update context, atomization operation encapsulation, recording of local software operation sequence through CV+OS hook function, generation of reusable script instruction, context binding, and execution of script triggering meeting of context condition, wherein the forward conversion converts structured intention in MCP into operation instruction native instruction of application program;
The security and authority control comprises the steps of data security enhancement, supporting individual encryption of sensitive fields, enabling a secret key to be managed by a Hardware Security Module (HSM), ensuring that a cloud only processes ciphertext and is dynamically desensitized, returning differentiated data according to a user role, and zero trust authority management, and supporting verification of a digital certificate and role authority of an application program every time the application program accesses a context.
According to the invention, the MCP protocol is realized at the cloud, the local non-AI application can be uniformly called in a form of packaging a uniform interface, the operation request input by a user is converted into one or more operation commands of the local non-AI application by the AI application through the MCP intention and the native instructions of the application program, the corresponding application program is called based on a certain rule, finally the required operation result of the user is obtained, the local software operation sequence is recorded through a CV+OS hook function, a reusable script instruction is generated, and the context is bound to meet the execution of a context triggering script, so that the execution efficiency and accuracy of the operation command are improved.
In the aspect of data storage, the invention adopts a distributed database (Redis) to store the context snapshot, each context change generates an increment version, and the time stamp, the operator and the change content are recorded. The invention also supports version backtracking, and the historical state is rapidly positioned through a time axis or event labels (such as 'task start' and 'parameter update'). The security audit is supported, key operations (such as context deletion and authority change) are recorded through a persistence technology, the fact that the log is not tamperable and compliance examination is facilitated is ensured, and the security audit is an important invention conception of the invention.
In one embodiment, in the executing unit 203, the MCP operation intention performs task dependency analysis and disassembles the task dependency analysis into task subgraphs, converts the task subgraphs into operation commands of corresponding application programs, dynamically schedules a tool chain formed by the application programs based on context states according to the operation commands of the application programs, so that the tasks are continuously executed, if a network is interrupted during execution, a latest context check point is loaded from a session pool, completed operations are skipped, and a secondary confirmation flow is triggered to perform operation verification before executing a key operation, so as to prevent misoperation.
In one embodiment, the operation of dynamically scheduling the tool chain formed by the application program based on the context state according to the operation command of the application program is that all operation commands obtained by converting all task subgraphs are sequenced based on task dependence to obtain an operation command execution dependency graph, an application program calling sequence is generated based on the operation command execution dependency graph to obtain the tool chain of the application program, the context state of the operation command currently executed is monitored, and if the context state meets the requirement of executing the next operation command, the application program corresponding to the next operation command is called in the tool chain until all operation commands are executed.
Another important inventive concept of the present invention is that, because the MCP operation intention may involve a plurality of application programs, such as 'obtain attendance records of staff march' in the previous example, in order to improve the execution efficiency of the non-AI local application, it is necessary to disassemble the MCP operation intention into task subgraphs based on the MCP protocol in the cloud, where each node corresponds to the operation of an application program, and generate a tool chain of the application program based on the task subgraphs, so that the application program can be invoked in a chained manner to perform sequential processing of operation commands, thereby improving the processing efficiency, and realizing the "available invisible" local sensitive data by enhanced privacy protection, so as to ensure that the cloud only obtains the desensitization result, such as only obtaining the attendance records of the user from the human system, but not obtaining other private data of the user in the human system. This is another important invention point of the present invention.
In an embodiment, after the operation command execution dependency graph is obtained, the cloud end uses a first thread to send a first memory usage request to the local system, a first memory size applied by the first memory usage request is determined based on a first operation command in the operation command execution dependency graph, the cloud end uses a second thread to send a second memory usage request to the local system, a second memory size applied by the second memory usage request is determined based on a second operation command in the operation command execution dependency graph, after the first operation command is detected to be executed, context state data executed in the first memory is sent to the cloud end for storage, meanwhile, a third memory size is determined based on a third operation command in the operation command execution dependency graph, if the third memory size is smaller than or equal to the first memory size, context state data in the first memory is deleted, the third operation command is executed in the first memory, if the third memory size is larger than the first memory size, the second memory size is larger than the second memory size applied by the mirror image application dependency graph, the third memory size is not executed by the mirror image application system, and if the third memory size is smaller than the first memory size, the third memory size is not executed in the mirror image application graph, and the third memory command is executed until all the memory commands can be executed, and all the memory commands in the memory request are completely executed, and the third memory requests can be executed.
In the invention, because the operation request of the user generally relates to the operation of a plurality of non-AI local applications, more than three are generally defaulted to meet the complex requirement of the user, and therefore, a great deal of non-local applications are called at the same time, if the non-local applications are processed locally, the performance of the local system is greatly influenced, the invention creatively provides that the general first and second applications are executed locally, the third application is executed in the cloud, if the memory does not meet the requirement, the third application is executed in the cloud, the corresponding mirror image is required to be loaded in the cloud to execute the corresponding operation, of course, the second operation command is executed in the cloud, but the mirror image of the application is wasted, based on the prior art, the performance of the local system is generally higher, so that the third operation command is judged to be executed or not, and the occupation of a great deal of bandwidth is avoided, and the performance of the local system is also prevented from being excessively influenced, thereby realizing the dynamic coordination of local hardware resources and architecture resources, and the construction of the elastic hybrid computing is an important concept of the invention.
In one embodiment of the invention a computer storage medium is provided, on which a computer program is stored, which computer storage medium may be a hard disk, DVD, CD, flash memory or the like, which computer program, when being executed by a processor, carries out the above-mentioned method.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in the same piece or pieces of software and/or hardware when implementing the present application.
From the above description of embodiments, it will be apparent to those skilled in the art that the present application may be implemented in software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the embodiments of the present application or some parts of the described embodiments of the present application.
It should finally be noted that the above-mentioned embodiments illustrate rather than limit the technical solution of the present invention, and although the invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the present invention may be modified or equivalently replaced without departing from the spirit and scope of the present invention.