Cooperative processing method and device for polymorphic Agents, equipment and medium
By building a collaborative framework in Agent light applications and integrating frameworks for plugging and unplugging Agent plug-ins of different forms, the compatibility problems of Agent plug-ins in the existing technology are solved, and an efficient and unified development process is achieved.
Patent Information
- Application Number
- CN202411997714.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-06
AI Technical Summary
The existing Agent light applications cannot be compatible with different forms of Agent plug-ins in plug-in development, resulting in problems such as duplicate function development and lack of code uniformity.
By building a collaborative framework, the first plug-in framework for plugging and unplugging service Agent plug-ins and the second plug-in framework for plugging and unplugging mounted Agent plug-ins, the compatibility of Agent plug-ins in different forms of Agent's plug-in development for light applications is achieved.
It realizes compatibility of Agent plug-ins in different forms in Agent light application plug-in development, avoids the problems of duplicate function development and lack of code uniformity, and improves development efficiency and convenience of use.
Smart Images

Figure CN119938169A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing, and in particular, relates to a collaborative processing method, device, equipment and medium of a multi-modal Agent. Background Art
[0002] With the continuous development of information technology, Agent light applications have been widely used in fields such as data processing. Agent light applications can be divided into two categories according to whether they can be deployed and run independently. One category is service-based Agent light applications, which can be deployed independently to achieve general functions by providing services; the other category is mounted Agent light applications, which need to be attached to the host application to operate. However, these two types of Agent light applications are not compatible in plug-in development. The framework that supports service-based Agent plug-ins does not support mounted Agent plug-ins, and the framework that supports mounted Agent plug-ins does not support service-based Agent plug-ins. The plug-in development of Agent light applications is not compatible with Agent plug-ins of different forms. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus, device and medium for collaborative processing of multi-modal Agents, which can achieve compatibility of Agent plug-ins of different forms in plug-in development of Agent light applications.
[0004] In a first aspect, an embodiment of the present application provides a collaborative processing method for a multi-modal Agent, comprising: sending a processing instruction to a collaborative framework through a collaborative framework master application, the collaborative framework comprising a first plug-in framework and a second plug-in framework, the first plug-in framework being used to plug and unplug a service Agent plug-in, and the second plug-in framework being used to plug and unplug a mounted Agent plug-in; controlling the first plug-in framework to load a service Agent plug-in corresponding to the processing instruction and / or controlling the second plug-in framework to load a mounted Agent plug-in corresponding to the processing instruction according to a preset loading rule through the collaborative framework; running the loaded Agent plug-in, using the Agent plug-in to call a service function in the collaborative framework, and realizing processing indicated by the processing instruction, the Agent plug-in comprising a service Agent plug-in and / or a mounted Agent plug-in.
[0005] In a second aspect, an embodiment of the present application provides a collaborative processing device for a multi-modal Agent, comprising: an instruction initiation module, used to send a processing instruction to a collaborative framework through a collaborative framework master application, the collaborative framework comprising a first plug-in framework and a second plug-in framework, the first plug-in framework being used to plug and unplug a service Agent plug-in, and the second plug-in framework being used to plug and unplug a mounted Agent plug-in; a plug-in control module, used to control the first plug-in framework to load a service Agent plug-in corresponding to the processing instruction according to a preset loading rule through the collaborative framework, and / or control the second plug-in framework to load a mounted Agent plug-in corresponding to the processing instruction; an execution module, used to run the loaded Agent plug-in, and use the Agent plug-in to call a service function in the collaborative framework to implement processing indicated by the processing instruction, the Agent plug-in comprising a service Agent plug-in and / or a mounted Agent plug-in.
[0006] In a third aspect, an embodiment of the present application provides a collaborative processing device for polymorphic agents, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the collaborative processing method for polymorphic agents of the first aspect is implemented.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the collaborative processing method of the polymorphic agent of the first aspect is implemented.
[0008] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the collaborative processing method of the polymorphic agent of the first aspect.
[0009] The embodiments of the present application provide a collaborative processing method, device, equipment and medium for multi-form Agents, which can send processing instructions to the collaborative framework through the collaborative framework master application, and control the first plug-in framework and / or the second plug-in framework in the collaborative framework to load the service Agent plug-in and / or the mounted Agent plug-in according to the preset loading rules, and run the loaded Agent plug-in. The running loaded plug-in can call the service function in the collaborative framework, thereby realizing the processing indicated by the processing instruction. The first plug-in framework for plugging and unplugging the service Agent plug-in and the second plug-in framework for plugging and unplugging the mounted Agent plug-in are integrated in the collaborative framework. Both the service Agent plug-in and the mounted Agent plug-in can be loaded and run under the instruction of the processing instruction, realizing the compatibility of Agent plug-ins of different forms in the plug-in development of Agent light applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0011] Figure 1 A schematic diagram of an example of the category of Agent light applications provided in an embodiment of the present application;
[0012] Figure 2 A schematic diagram of an example of a collaborative framework provided in an embodiment of the present application;
[0013] Figure 3 A flowchart of a collaborative processing method of a multi-modal agent provided in an embodiment of the present application;
[0014] Figure 4 A schematic diagram of an example of an Agent plug-in, service class name, and method name provided in an embodiment of the present application;
[0015] Figure 5 A schematic diagram of an example of communication between service agent plug-ins provided in an embodiment of the present application;
[0016] Figure 6 A schematic diagram of an example of a class loading mechanism of a first application server and a second application server provided in an embodiment of the present application;
[0017] Figure 7 A schematic diagram of an example of an optimized method for plugging and unplugging a mounted Agent provided in an embodiment of the present application;
[0018] Figure 8 A schematic diagram of the structure of a collaborative processing device of a multi-modal agent provided in an embodiment of the present application;
[0019] Fig. 9 A schematic diagram of the structure of a collaborative processing device of a multi-modal agent provided in one embodiment of the present application. DETAILED DESCRIPTION
[0020] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are intended only to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application. It should be noted that the acquisition, storage, use, and processing of information and data in the embodiments of the present application are authorized by users or relevant agencies, in compliance with the relevant provisions of national laws and regulations.
[0021] With the continuous development of information technology, Agent light applications have been widely used in fields such as data processing. Agent light applications can be divided into two categories based on whether they can be deployed and run independently; for example, Figure 1 A schematic diagram of an example of the category of Agent light applications provided in an embodiment of the present application, such as Figure 1 As shown, one type is a service-type Agent light application 11, and the other type is a mounted Agent light application 12. Figure 1 An Agent light application that can be controlled by a master application and can run independently and in the same virtual machine as the target application is a service-type Agent light application 11. Figure 1 The Agent light application that can be controlled by the master application and can run independently and in a different virtual machine from the target application is a service-type Agent light application 11. Figure 1 Agent light applications cannot run independently and need to be attached to the target application. The Agent light application in the same virtual machine as the target application is a mounted Agent light application. However, service-based Agent light applications and mounted Agent light applications are not compatible in plug-in development. The framework that supports service-based Agent plug-ins does not support mounted Agent plug-ins, and the framework that supports mounted Agent plug-ins does not support service-based Agent plug-ins. The plug-in development of Agent light applications is not compatible with Agent plug-ins of different forms. Moreover, different Agent plug-ins can be developed by different service providers. Agent plug-ins developed by different service providers have problems such as repeated development of functions and lack of code uniformity, resulting in waste of resources. The use, deployment and configuration of different Agents developed by different service providers are different, which is also very difficult for users to use.
[0022] The present application provides a collaborative processing method, device, equipment and medium for multi-form Agents. By building a collaborative framework that can integrate multi-form Agent plug-ins, both service-type Agent plug-ins and mounted Agent plug-ins can be loaded and unloaded in the collaborative framework, thereby achieving compatibility of Agent plug-ins of different forms in the plug-in development of Agent light applications. During the operation of the service-type Agent plug-in and the mounted Agent plug-in, the service functions in the collaborative framework can also be called to achieve various tasks, avoiding the occurrence of problems such as repeated development of functions and lack of code uniformity.
[0023] To facilitate understanding, the collaborative framework in the embodiment of the present application is briefly described below. Figure 2 A schematic diagram of an example of a collaborative framework provided in an embodiment of the present application, such as Figure 2 As shown, the collaborative framework 20 may include a service layer 21 , a plug-in layer 22 and a capability layer 23 ; the collaborative framework 20 may be correspondingly provided with a master control application 31 , and the master control application 31 may be provided in the presentation layer 30 .
[0024] The presentation layer 30 is an upper layer application of the collaborative framework 20, which can comprehensively monitor and dynamically supervise the execution status of the collaborative framework 20. The main control application 31 in the presentation layer 30 can be used to query the running status of the Agent plug-in in the collaborative framework 20 in real time, and the main control application 31 in the presentation layer 30 can also be used to adjust the plug-in or perform other configuration processing on the collaborative framework to ensure the stability and availability of the collaborative framework 20. Agent plug-ins include service-type Agent plug-ins and mounted Agent plug-ins. In some examples, the presentation layer 30 can also set up some main control applications 32 of Agent plug-ins.
[0025] The service layer 21 can provide a variety of services to the outside world, such as traffic monitoring, service inspection, request forwarding, service governance and other services, but not limited to these. These services can ensure that the collaborative framework 20 has autonomy, responsiveness and initiative to a certain extent. Some of the services provided by the service layer 21 to the outside world can be implemented by calling the Agent plug-in in the plug-in layer 22, while the other services do not need to be implemented by calling the Agent in the plug-in layer 22. The service layer 21 can combine the sidecar mode to provide capabilities that the Hypertext Transfer Protocol (HTTP) service cannot have.
[0026] The plug-in layer 22 includes a first plug-in framework 221 and a second plug-in framework 222. The first plug-in framework 221 is used to plug and unplug the service Agent, and the second plug-in framework 222 is used to plug and unplug the mounted Agent. The plug-in and unplug here means loading and unloading. In some examples, the first plug-in framework may include but is not limited to StarBlues, and the second plug-in framework may include but is not limited to Sermant. In the plug-in layer 22, the first plug-in framework can be optimized to implement the loading and running mechanism of the service Agent plug-in, and the second plug-in framework can be improved to implement the adjustment of the mounted Agent plug-in. The Agent plug-ins can have interactive functions and can cooperate with each other to improve the efficiency and quality of the completion of the Agent plug-in's functions. Dynamic management of the Agent plug-in in the plug-in layer 22 can also be achieved through the foreground interface of the main control application 31 in the presentation layer 30.
[0027] The capability layer 32 can provide services to be called, and the services to be called are callable service functions. For example, the capability layer 32 may include support agent services 321, collaboration agent services 322, and extensible services 323. Support agent services 321 may include but are not limited to configuration unification, monitoring functions, etc. Collaboration agent services 322 may include but are not limited to data preprocessing, service access, etc. Extensible services 323 may include but are not limited to scheduled tasks, file upload and download, database configuration and operation, encryption algorithms, other language access, etc. The extensible services 323 in the capability layer 32 can be called by the agent plug-in. The capability layer 32 provides a solid basic service support for the collaborative framework 20. The service functions in the capability layer 32 are developed through unified code, which can standardize code development specifications and reduce repeated development.
[0028] The presentation layer 30, the service layer 21, the plug-in layer 22 and the capability layer 23 work together, so that the collaborative framework 20 can realize rich basic functions while providing higher functional scalability, and can effectively realize the plug-in integration of service-type Agent plug-ins and mounted Agent plug-ins, thereby realizing the integration and collaboration of multi-form Agents. The collaborative framework 20 is set on a virtual machine, such as, on the same Java Virtual Machine (JVM), which can enable the application of multiple Agent plug-ins to be implemented on a virtual machine, reducing resource consumption.
[0029] The collaborative processing method, device, equipment and medium of the multi-modal Agent provided in this application are described below respectively.
[0030] In a first aspect, the present application provides a collaborative processing method of a polymorphic agent. The collaborative processing method of a polymorphic agent is implemented based on the presentation layer 30 and the collaborative framework 20 in the above embodiment. The collaborative processing method of a polymorphic agent can be executed by a collaborative processing device of a polymorphic agent. Figure 3 A flowchart of a collaborative processing method of a multi-modal agent provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the collaborative processing method of the polymorphic Agent may include steps S401 to S403.
[0031] In step S401, a processing instruction is sent to the collaborative framework through the collaborative framework master application.
[0032] The collaborative framework master application is the main application of the collaborative framework. The specific contents of the collaborative framework master application and the collaborative framework can be found above and will not be repeated here. Users can send processing instructions to the collaborative framework by operating the collaborative framework master application. The processing instructions may represent the operations that need to be performed by the collaborative framework, which may indicate the Agent plug-ins that need to be loaded by the collaborative framework. In some examples, the processing instructions may include instructions to call a certain service provided by the collaborative framework to the outside world, and may also include input processing code instructions, etc., which are not limited here.
[0033] In step S402, the collaborative framework controls the first plug-in framework to load the service Agent plug-in corresponding to the processing instruction and / or controls the second plug-in framework to load the mount Agent plug-in corresponding to the processing instruction according to the preset loading rule.
[0034] The loading rules may include rules for loading the Agent plug-in, which are used to indicate the conditions for loading the Agent plug-in. The loading rules may be stored locally where the collaborative framework is located, or they may be stored in a remote server. If the loading rules are stored locally where the collaborative framework is located, the local loading rules may be directly read. If the loading rules are stored in a remote server, a rule acquisition request may be sent remotely, and the rule acquisition request is used to request the loading rules from the remote server, and receive the loading rules fed back by the remote server in response to the rule acquisition request. The remote server may be used to store loading rules and receive instructions to configure the loading rules. The storage of loading rules in a remote server may enable a simpler dynamic update of loading rules, and the user may modify the loading rules in the remote server. All collaborative processing devices of polymorphic agents that have a communication relationship with the remote server may obtain the latest loading rules from the remote server to avoid using invalid loading rules.
[0035] According to the processing instruction, the Agent plug-in corresponding to the processing instruction can be obtained. The Agent plug-in corresponding to the processing instruction may include a service Agent plug-in and / or a mount Agent plug-in. If the Agent plug-in corresponding to the processing instruction includes a service Agent plug-in, the first plug-in framework is controlled to load the corresponding service Agent plug-in according to the loading rule; if the Agent plug-in corresponding to the processing instruction includes a mount Agent plug-in, the second plug-in framework is controlled to load the corresponding mount Agent plug-in according to the loading rule; if the Agent plug-in corresponding to the processing instruction includes a service Agent plug-in and a mount Agent plug-in, the first plug-in framework is controlled to load the corresponding service Agent plug-in according to the loading rule, and the second plug-in framework is controlled to load the corresponding mount Agent plug-in.
[0036] In step S403, the loaded Agent plug-in is run, and the service function in the collaborative framework is called by the Agent plug-in to implement the processing indicated by the processing instruction.
[0037] Agent plug-ins include service-type Agent plug-ins and / or mounted Agent plug-ins. The operation of the loaded Agent plug-in will perform corresponding operations according to the code in the Agent plug-in, and the operation corresponding to the code in the loaded Agent plug-in may include calling the service function in the collaborative framework. The service function in the collaborative framework may include the service-type Agent plug-in in the plug-in layer of the collaborative framework and / or the to-be-called service in the capability layer configured by the collaborative framework. That is, the loaded Agent plug-in can call other service-type Agents and / or preset to-be-called services in the collaborative framework. The loaded Agent plug-in can realize the processing indicated by the processing instruction through its own functions and calling the service functions in the collaborative framework. The to-be-called service of the capability layer is written according to the same specification code, which is equivalent to providing a development template for the service-type Agent plug-in and the mounted Agent plug-in. By calling the to-be-called service of the capability layer through the Agent plug-in, repeated development can be avoided. In some examples, in addition to indicating the corresponding Agent plug-in, the processing instruction may also indicate the service of the service layer of the collaborative framework and the to-be-called service of the capability layer of the collaborative framework, that is, the processing indicated by the processing instruction can be realized by one or both of the Agent plug-in, the service of the service layer, and the to-be-called service of the capability layer.
[0038] The collaborative processing method of the polymorphic Agent can be applied to a variety of scenarios. For example, in the system migration switching scenario of channel management, at least part of the functions in the system migration switching can be implemented by instructing the collaborative framework through processing instructions. For another example, the synchronization function of common parameters can be loaded into the collaborative framework as an Agent plug-in, and the Agent plug-in is called through processing instructions to implement the synchronization function of common parameters. The application scenarios of the collaborative processing method of the polymorphic Agent are not illustrated one by one here, and the application scenarios corresponding to the functions that can be implemented by the service layer, plug-in layer, and capability layer in the collaborative framework are all within the protection scope of the embodiments of the present application.
[0039] In an embodiment of the present application, a processing instruction can be sent to the collaborative framework through the collaborative framework master application, and according to the preset loading rules, the first plug-in framework and / or the second plug-in framework in the collaborative framework are controlled to load the service Agent plug-in and / or the mounted Agent plug-in, and the loaded Agent plug-in is run. The running loaded plug-in can call the service function in the collaborative framework, thereby realizing the processing indicated by the processing instruction. The first plug-in framework for plugging and unplugging the service Agent plug-in and the second plug-in framework for plugging and unplugging the mounted Agent plug-in are integrated in the collaborative framework. Both the service Agent plug-in and the mounted Agent plug-in can be loaded and run under the instruction of the processing instruction, realizing the compatibility of Agent plug-ins of different forms in the plug-in development of Agent light applications. And the service function in the collaborative framework adopts a unified code specification, so that at least part of the functions of the Agent plug-in are realized by calling the service function, which can avoid the repeated development of functions in different Agent plug-ins and improve the development efficiency of the Agent plug-in. The collaborative framework master application enables different Agent plug-ins to have the same operation and maintenance interface, which can aggregate the operation paths. Multiple Agent plug-ins can adopt the same usage plan in the collaborative framework master application, reducing the difficulty of operation and learning cost.
[0040] In some embodiments, the loading rules may include one or more of the default loading order rules, loading order verification rules, and loading mutual exclusion verification rules. The default loading order rules represent the loading order of multiple Agent plug-ins, and it can also be considered that the default loading order rules represent the absolute loading order of multiple Agent plug-ins. The loading order verification rules represent the relative loading order between multiple Agent plug-ins, such as limiting one of the multiple Agent plug-ins to be loaded before another Agent plug-in, but whether there are other Agent plug-ins that need to be loaded between the two Agent plug-ins is not limited. The loading mutual exclusion verification rules represent mutually exclusive Agent plug-ins in multiple Agent plug-ins, and mutually exclusive Agent plug-ins cannot all be in the loading state. The loading rules can be dynamically updated to ensure the stability of the collaborative framework.
[0041] The loading mode of the Agent plug-in may include a static loading mode and a dynamic loading mode. In the static loading mode, all Agent plug-ins that need to be loaded are known, and no new Agent plug-ins are added. It is static and unchanged. The static loading mode refers to the default loading order rule, the loading order verification rule, and the loading mutual exclusion verification rule. That is, in the static loading mode, the first plug-in framework and / or the second plug-in framework are controlled to load the Agent plug-in according to the default loading order rule, and the Agent plug-in is verified according to the loading order verification rule and the loading mutual exclusion verification rule when each Agent plug-in is loaded. In the dynamic loading mode, the Agent plug-ins that need to be loaded are continuously added, and it is dynamically variable. The dynamic loading mode refers to the loading order verification rule and the loading mutual exclusion verification rule. That is, in the dynamic loading mode, the first plug-in framework and / or the second plug-in framework are controlled to load the Agent plug-in, and the Agent plug-in is verified according to the loading order verification rule and the loading mutual exclusion verification rule when each Agent plug-in is loaded. The dynamic loading mode is not affected by the default loading order rule.
[0042] For example, there are four Agent plug-ins, namely AgentA, AgentB, AgentC, and AgentD. The loading order represented by the default loading order rule is AgentA, AgentB, AgentC, AgentD. The loading order verification rule is AgentB:AgentC, which means that AgentB needs to be loaded before AgentC. The loading mutual exclusion verification rule is AgentA:AgentD, which means that AgentA and AgentD are mutually exclusive. For AgentA, AgentB, AgentC, and AgentD in static loading mode, they are loaded according to the default loading order rule. First, AgentA is loaded, then AgentB, and then AgentC. When loading AgentC, it is verified according to the loading order verification rule. It is determined that AgentB is loaded before AgentC, which satisfies the loading order verification rule. AgentD continues to be loaded. When loading AgentD, it is verified according to the loading mutual exclusion verification rule. It is found that AgentA and AgentD are mutually exclusive, so AgentD is refused to be loaded. For AgentA, AgentB, AgentC and AgentD in the static loading mode, AgentD can be loaded first, then AgentC, and then AgentB. When loading AgentB, it is checked according to the loading order verification rule to determine that AgentB is loaded after AgentC, which does not meet the loading order verification rule, and AgentB is refused to be loaded. Then AgentA is loaded. When loading AgentA, it is checked according to the loading mutual exclusion verification rule, and it is found that AgentA and AgentD are mutually exclusive, so AgentA is refused to be loaded.
[0043] In some embodiments, the service-type Agent plug-in in the collaborative framework can be used as both a service scheduler and a service provider. The loaded Agent plug-in includes a service-type Agent plug-in, and the service function called by the loaded Agent plug-in includes a service-type Agent plug-in. The above step S403 can be specifically refined as running the loaded Agent plug-in, searching the called Agent plug-in and the service class in the service mapping relationship in the cache according to the plug-in identifier and service class identifier corresponding to the processing instruction; traversing the methods under the found service class, and calling the method corresponding to the processing instruction.
[0044] The service mapping relationship includes the corresponding relationship between the plug-in identifier, the service class identifier, and the service cache. The plug-in identifier is used to identify the plug-in, and may include but is not limited to the plug-in ID, etc. The service class identifier is used to identify the service class, and the service class identifier may include but is not limited to the service class name. The service mapping relationship can be updated when the Agent plug-in is loaded and unloaded. The call information of the processing instruction or the running Agent plug-in may include the plug-in identifier, the service class identifier and the method identifier. The call information of the running Agent plug-in includes the plug-in identifier, the service class identifier, the method identifier, etc. of other Agent plug-ins called by the running Agent plug-in. The method identifier may include the method name. In order to avoid the problem of inconsistent method names in the service class caused by different Agent plug-ins being developed by different developers, the annotation name of the method can be added to the code in the Agent plug-in, and the method name in the Agent plug-in can be unified through the annotation name. Correspondingly, the call information required for the running Agent plug-in to call the method includes the pre-agreed annotation name of the method in the Agent plug-in. For example, Figure 4 A schematic diagram of an example of an Agent plug-in, service class name, and method name provided in an embodiment of the present application, such as Figure 4As shown, Agent plug-in 1 is a service scheduler, Agent plug-in 2 is a service provider, and Agent plug-in 3 is a service provider. The call information of Agent plug-in 1 may include the service class name "serviceA", the method name "methodA1" under the service class name "serviceA", the service class name "serviceB", and the method name "methodB1" under the service class name "serviceB". Agent plug-in 2 includes a service class with a service class name of "serviceA", and the service class with the service class name of "serviceA" has two methods, one of which has an annotation name of "methodA1" and an original method name of "function A(int)", and the other method has an annotation name of "methodA2" and an original method name of "function A(String)". Agent plug-in 2 includes a service class with a service class name of "serviceB", and the service class with the service class name of "serviceB" has two methods, one of which has an annotation name of "methodB1" and an original method name of "function B(int)", and the other method has an annotation name of "methodB2" and an original method name of "function B(String)". The method name in the call information of Agent plug-in 1 is the annotation name. By combining the annotation name with the traversal method, method overloading can be supported, and methods can be accurately located and called. It can also reduce the difficulty of using the collaborative framework and improve the efficiency of using the collaborative framework. The running Agent plug-in can search the service cache corresponding to the plug-in identifier in the processing instruction in the service mapping relationship, search the service class in the service cache according to the service class identifier in the processing instruction, traverse the methods under the service class, and find the method indicated by the method identifier in the processing instruction. In some examples, mutual calls between service-based agents can be implemented using the call operation interface in the dynamic proxy trigger reflection mechanism, and the call operation interface may include but is not limited to the InvocationHandler interface.
[0045] In some embodiments, when the loaded Agent plug-in calls the method corresponding to the processing instruction in the above embodiment, the call operation interface in the reflection mechanism can be triggered to actively perform data recording processing. The data recording processing may include but is not limited to operations such as log recording and call statistics. The reflection mechanism can be used to actively record data after each operation of processing instructions, which can effectively avoid the situation where the operation is missed, and can also reduce the user's operations and improve the user experience.
[0046] For example, Figure 5 A schematic diagram of an example of communication between service agent plug-ins provided in an embodiment of the present application, such as Figure 5As shown, the process of communication between the service agent plug-ins may include steps a1 to a7.
[0047] In step a1, the Agent plug-in is installed, and the service class responded by the Agent plug-in is registered in the cache.
[0048] In step a2, the Agent plug-in as a service scheduler performs service scheduling.
[0049] In step a3, it is determined whether scheduling is performed by the plug-in identifier. If yes, step a4 is executed; if not, step a7 is executed.
[0050] In step a4, the cache is obtained according to the plug-in identifier, and a search is performed in the cache according to the service class identifier.
[0051] In step a5, the methods under the service class indicated by the service class identifier are traversed to obtain the corresponding method.
[0052] In step a6, the corresponding method is scheduled through the reflection mechanism.
[0053] In step a7, the cache is traversed and searched according to the service class identifier.
[0054] The specific contents of step a1 to step a7 can be found in the relevant description in the above embodiment, which will not be repeated here.
[0055] In some embodiments, the loaded Agent plug-in includes a mountable Agent plug-in. The first target application of the mountable Agent plug-in is not compatible with the second plug-in framework. The plug-in and unplugging of the mountable Agent plug-in can be optimized so that the second plug-in framework can be loaded into the first target application, further improving the applicability of the collaborative framework. The first target application is not compatible with the second plug-in framework, and the second application server is compatible with the second plug-in framework. The class loading mechanisms of the first application server and the second application server are completely different, so that the first target application cannot use the second plug-in framework. For example, Figure 6 A schematic diagram of an example of a class loading mechanism of a first application server and a second application server provided in an embodiment of the present application, such as Figure 6As shown, the second plug-in framework is Sermant, the first target application is a war application, the first application server may be a Springboot server, and the second application server may include a jBoss server or an Upjas server; the class loading method of the Springboot server implements the loading of Sermant through inheritance among the class loader ClassLoader, the security class loader SecureClassLoader, the URL class loader URLClassLoader, and the plug-in URL class loader PluginURLClassLoader, wherein the plug-in URL class loader PluginURLClassLoader can be regarded as a plug-in location loader; the class loading method of the jBoss server or Upjas server implements the loading of the war application through inheritance among the class loader ClassLoader, the concurrent URL class loader ConcurrentURLClassLoader, and the module class loader ModuleClassLoader; the war application cannot use Sermant. Wherein, URL is the abbreviation of uniform resource locator, i.e., uniform resource locator.
[0056] In the embodiment of the present application, the system package including the core functions of the second plug-in framework can be introduced into the first target application; the module class loader of the application server corresponding to the main function of the first target application is searched, and the plug-in location loader of the second application server is obtained; the second plug-in framework is loaded into the first target application using the module class loader and the plug-in location loader. After the second plug-in framework is loaded into the first target application, the mounted Agent to be loaded can be transmitted to the first application server of the first target application and loaded into the second plug-in framework in the first target application.
[0057] For example, the second plug-in framework is Sermant, the first target application is a war application, the first application server may be a Springboot server, the second application server may include a jBoss server or an Upjas server, and the plug-in location loader is a plug-in URL class loader PluginURLClassLoader. Figure 7 A schematic diagram of an example of an optimization method for plugging and unplugging the mounting Agent provided in an embodiment of the present application, such as Figure 7As shown, when starting the operation, Sermant can be introduced into the war application as a system package. The war application or the collaborative framework master application can provide an interface for the installation and rollback of Sermant. It can be traversed in multiple target applications, and the module class loader ModuleClassLoader of the jBoss server or Upjas server can be found according to the main function of the war application. The plug-in URL class loader PluginURLClassLoader is used in conjunction with the module class loader ModuleClassLoader to load Sermant into the war application. In subsequent operations, the mounted Agent can be loaded into the Sermant in the war application, thereby expanding the adaptability of the mounted Agent.
[0058] In the embodiment of the present application, there may be two groups of monitoring parties and monitored parties. In one group of monitoring parties and monitored parties, the monitoring party is the collaborative framework master application, and the monitored party is the collaborative framework; in the other group of monitoring parties and monitored parties, the monitoring party is the collaborative framework, and the monitored party is the Agent plug-in, and the Agent plug-in may include a service-type Agent and a mounted Agent. Specifically, the collaborative framework master application may use its own driver application service to create a first port to receive the first data uploaded by the collaborative framework through the first port; the collaborative framework may use its own driver application service to create a second port to receive the second data uploaded by the Agent plug-in through the second port. For example, the driver application service may include a netty service.
[0059] In some examples, the first data includes the heartbeat data of the collaborative framework and / or the log data of the collaborative framework. The second data includes the heartbeat data of the Agent plug-in and / or the log data of the Agent plug-in. The heartbeat data is used to detect whether the monitored party is operating normally. For example, the heartbeat data of the collaborative framework is used to detect whether the collaborative framework is operating normally, and the heartbeat data of the Agent plug-in is used to detect whether the Agent plug-in is operating normally. The log data is used to record various indicator data of the monitored party. For example, the log data of the collaborative framework may include but is not limited to the start and stop of the collaborative framework and the use of the Agent plug-in; the log data of the Agent plug-in may include but is not limited to the operation record of the Agent plug-in, and the operation record may include but is not limited to installation information, uninstallation information, warning information, error information, etc.
[0060] In some embodiments, the service layer in the collaborative framework is used to provide services, and the processing instructions may instruct to call the target service in the service layer. When the called target service is executed and configured with an Agent plug-in, the first plug-in framework may be controlled to load the service-type Agent plug-in configured with the target service, and / or the second plug-in framework may be controlled to load the mounted Agent plug-in configured with the target service.
[0061] A second aspect of the present application provides a collaborative processing device for multi-modal Agents. Figure 8 A schematic diagram of the structure of a collaborative processing device of a multi-modal agent provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the collaborative processing device 500 of the polymorphic Agent may include an instruction initiating module 501 , a plug-in control module 502 , and an execution module 503 .
[0062] The instruction initiating module 501 may be used to send a processing instruction to the collaborative framework through the collaborative framework master application.
[0063] The collaboration framework includes a first plug-in framework and a second plug-in framework. The first plug-in framework is used to plug in and out the service-type Agent plug-in. The second plug-in framework is used to plug in and out the mount-type Agent plug-in.
[0064] The plug-in control module 502 can be used to control the first plug-in framework to load the service Agent plug-in corresponding to the processing instruction according to the preset loading rules through the collaborative framework, and / or control the second plug-in framework to load the mount Agent plug-in corresponding to the processing instruction.
[0065] The execution module 503 can be used to run the loaded Agent plug-in, and use the Agent plug-in to call the service function in the collaborative framework to implement the processing indicated by the processing instruction.
[0066] Agent plug-ins include service-type Agent plug-ins and / or mounted Agent plug-ins.
[0067] In some embodiments, the loading rules include one or more of a default loading order rule, a loading order verification rule, and a loading mutual exclusion verification rule. The default loading order rule represents the loading order of multiple Agent plug-ins, the loading order verification rule represents the relative loading order between multiple Agent plug-ins, and the loading mutual exclusion verification rule represents mutually exclusive Agent plug-ins among multiple Agent plug-ins.
[0068] In some examples, the plug-in control module 502 can be specifically used to: in static loading mode, control the first plug-in framework and / or the second plug-in framework to load the Agent plug-in according to the default loading order rule, and verify the Agent plug-in according to the loading order verification rule and the loading mutual exclusion verification rule when loading each Agent plug-in; in dynamic loading mode, control the first plug-in framework and / or the second plug-in framework to load the Agent plug-in, and verify the Agent plug-in according to the loading order verification rule and the loading mutual exclusion verification rule when loading each Agent plug-in.
[0069] In some embodiments, the polymorphic Agent collaborative processing device 500 may further include a sending module and a receiving module.
[0070] The sending module can be used to send a rule acquisition request to a remote server, and the remote server is used to store the loading rules and accept instructions to configure the loading rules.
[0071] The receiving module can be used to receive the loading rules fed back by the remote server in response to the rule acquisition request.
[0072] In some embodiments, the loaded Agent plug-in includes a service Agent plug-in, and the service function includes the service Agent plug-in.
[0073] The execution module 503 can be specifically used to: run the loaded Agent plug-in, search for the called Agent plug-in and service class in the service mapping relationship in the cache according to the plug-in identifier and service class identifier corresponding to the processing instruction, and the service mapping relationship includes the corresponding relationship between the plug-in identifier, the service class identifier, and the service cache; traverse the methods under the found service class and call the method corresponding to the processing instruction.
[0074] In some examples, the calling information required for the running Agent plug-in to call a method includes a pre-agreed annotated name of the method in the Agent plug-in.
[0075] In some examples, the execution module 503 may also be used to trigger a call operation interface in a reflection mechanism to actively perform data recording processing when a method corresponding to a processing instruction is called.
[0076] In some embodiments, the loaded Agent plug-in includes a mounted Agent plug-in. The collaborative processing device 500 of the polymorphic Agent may also include a loading assistance module. The loading assistance module may be used to: introduce a system package including the core functions of the second plug-in framework into the first target application, the first target application is incompatible with the second plug-in framework; find the module class loader of the first application server corresponding to the main function of the first target application, and obtain the plug-in location loader of the second application server, the second application server is compatible with the second plug-in framework; use the module class loader and the plug-in location loader to load the second plug-in framework into the first target application.
[0077] In some embodiments, the plug-in control module 502 may be specifically used to transmit the mounted Agent to be loaded to the first application server of the first target application, and load it into the second plug-in framework of the first target application.
[0078] In some examples, the service functions include services to be called that are preset in a capability layer of the collaborative framework configuration.
[0079] In some embodiments, the collaborative processing device 500 of the polymorphic Agent may further include a monitoring module. The monitoring module may be used to: create a first port through the collaborative framework master application using its own driver application service to receive first data uploaded by the collaborative framework through the first port; create a second port through the collaborative framework using its own driver application service to receive second data uploaded by the Agent plug-in through the second port.
[0080] In some examples, the first data includes heartbeat data of the collaborative framework and / or log data of the collaborative framework; the second data includes heartbeat data of the Agent plug-in and / or log data of the Agent plug-in.
[0081] In some embodiments, the collaboration framework further includes a service layer, where the service layer is used to provide services, and the processing instruction indicates calling a target service in the service layer.
[0082] The plug-in control module 502 may be specifically used to: control the first plug-in framework to load the service-type Agent plug-in of the target service configuration, and / or control the second plug-in framework to load the mount-type Agent plug-in of the target service configuration.
[0083] It should be noted that the polymorphic Agent collaborative processing device 500 is a device corresponding to the polymorphic Agent collaborative processing method described above, and all implementations in the above method embodiments are applicable to the embodiments of the device and can achieve the same technical effects.
[0084] The third aspect of the present application also provides a collaborative processing device of a multi-modal Agent. Fig. 9 A schematic diagram of the structure of a collaborative processing device of a multi-modal agent provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the collaborative processing device 600 of the polymorphic agent includes a memory 601 , a processor 602 , and a computer program stored in the memory 601 and executable on the processor 602 .
[0085] In some examples, the processor 602 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0086] The memory 601 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the collaborative processing method of the polymorphic agent according to the embodiment of the present application.
[0087] The processor 602 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 601, so as to implement the collaborative processing method of the polymorphic Agent in the above embodiment.
[0088] In some examples, the polymorphic agent collaborative processing device 600 may further include a communication interface 603 and a bus 604. Fig. 9 As shown, the memory 601, the processor 602, and the communication interface 603 are connected via a bus 604 and communicate with each other.
[0089] The communication interface 603 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 603 can also be used to access input devices and / or output devices.
[0090] The bus 604 includes hardware, software, or both, coupling the components of the co-processing device 600 of the polymorphic agent to each other. By way of example and not limitation, the bus 604 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-E) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 604 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0091] The fourth aspect of the present application also provides a computer-readable storage medium, on which a computer program instruction is stored, and when the computer program instruction is executed by a processor, the collaborative processing method of the polymorphic agent in the above-mentioned embodiment can be implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), a disk or an optical disk, etc., which is not limited here.
[0092] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the collaborative processing method of the multi-modal agent in the above embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0093] It should be clear that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. For device embodiments, equipment embodiments, and computer-readable storage medium embodiments, the relevant parts can refer to the description part of the method embodiment. The present application is not limited to the specific steps and structures described above and shown in the figures. Those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application. In addition, for the sake of brevity, a detailed description of known method technologies is omitted here.
[0094] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0095] Those skilled in the art should understand that the above embodiments are exemplary rather than restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Based on the study of the drawings, the specification and the claims, those skilled in the art should be able to understand and implement other variations of the disclosed embodiments. In the claims, the term "comprising" does not exclude other devices or steps; the quantifier "one" does not exclude multiple; the terms "first" and "second" are used to indicate names rather than to indicate any specific order. Any figure marks in the claims should not be understood as limiting the scope of protection. The functions of multiple parts appearing in the claims can be implemented by a single hardware or software module. The appearance of certain technical features in different dependent claims does not mean that these technical features cannot be combined to achieve beneficial effects.
Claims
1. A collaborative processing method of polymorphic agents, characterized in that: include: Sending a processing instruction to the collaborative framework through the collaborative framework master application, the collaborative framework includes a first plug-in framework and a second plug-in framework, the first plug-in framework is used to plug and unplug the service agent plug-in, and the second plug-in framework is used to plug and unplug the mount agent plug-in; Controlling the first plug-in framework to load the service Agent plug-in corresponding to the processing instruction and / or controlling the second plug-in framework to load the mount Agent plug-in corresponding to the processing instruction according to a preset loading rule through the collaborative framework; The loaded Agent plug-in is run, and the service function in the collaborative framework is called by the Agent plug-in to implement the processing indicated by the processing instruction. The Agent plug-in includes a service Agent plug-in and / or a mounted Agent plug-in.
2. The method according to claim 1, characterized in that The loading rules include one or more of a default loading order rule, a loading order verification rule, and a loading mutual exclusion verification rule; The default loading order rule represents the loading order of multiple Agent plug-ins, the loading order verification rule represents the relative loading order between multiple Agent plug-ins, and the loading mutual exclusion verification rule represents mutually exclusive Agent plug-ins among multiple Agent plug-ins.
3. The method according to claim 2, characterized in that The step of controlling the first plug-in framework to load the service-type Agent plug-in corresponding to the processing instruction and / or controlling the second plug-in framework to load the mount-type Agent plug-in corresponding to the processing instruction according to a preset loading rule through the collaborative framework includes: In static loading mode, the first plug-in framework and / or the second plug-in framework are controlled to load the Agent plug-in according to the default loading order rule, and the Agent plug-in is checked according to the loading order check rule and the loading mutual exclusion check rule when each Agent plug-in is loaded; In the dynamic loading mode, the first plug-in framework and / or the second plug-in framework is controlled to load the Agent plug-in, and when loading each Agent plug-in, the Agent plug-in is checked according to the loading sequence check rule and the loading mutual exclusion check rule.
4. The method according to claim 1, characterized in that Before controlling the first plug-in framework to load the service-type Agent plug-in corresponding to the processing instruction according to the preset loading rule through the collaborative framework, and / or controlling the second plug-in framework to load the mount-type Agent plug-in corresponding to the processing instruction, the method further includes: Sending a rule acquisition request to a remote server, the remote server being used to store the loading rules and accept instructions to configure the loading rules; Receive the loading rule fed back by the remote server in response to the rule acquisition request.
5. The method according to claim 1, characterized in that The loaded Agent plug-in includes a service Agent plug-in, and the service function includes a service Agent plug-in; The running of the loaded Agent plug-in and the use of the Agent plug-in to call the service function in the collaborative framework include: Run the loaded Agent plug-in, and search the called Agent plug-in and service class in the service mapping relationship in the cache according to the plug-in identifier and service class identifier corresponding to the processing instruction, wherein the service mapping relationship includes the corresponding relationship between the plug-in identifier, the service class identifier, and the service cache; Traverse the methods under the found service class and call the method corresponding to the processing instruction.
6. The method according to claim 1, characterized in that The calling information required by the running Agent plug-in to call the method includes the pre-agreed annotation name of the method in the Agent plug-in.
7. The method according to claim 5, characterized in that Also includes: When the method corresponding to the processing instruction is called, the calling operation interface in the reflection mechanism is triggered to actively perform data recording processing.
8. The method according to claim 1, characterized in that The loaded Agent plug-ins include mountable Agent plug-ins; The method further comprises: introducing a system package including core functions of the second plug-in framework into a first target application, the first target application being incompatible with the second plug-in framework; Finding a module class loader of a first application server corresponding to a main function of the first target application, and obtaining a plug-in location loader of a second application server, wherein the second application server is compatible with the second plug-in framework; The second plug-in framework is loaded into the first target application using the module class loader and the plug-in location loader.
9. The method according to claim 8, characterized in that The controlling the second plug-in framework to load the mountable Agent plug-in corresponding to the processing instruction includes: The mounted Agent to be loaded is transmitted to the first application server of the first target application, and loaded into the second plug-in framework in the first target application.
10. The method according to claim 1, characterized in that The service functions include services to be called that are preset in the capability layer of the collaborative framework configuration.
11. The method according to claim 1, characterized in that: Also includes: The collaborative framework master application uses its own driver application service to create a first port, so as to receive first data uploaded by the collaborative framework through the first port; The collaborative framework uses its own driver application service to create a second port, so as to receive the second data uploaded by the Agent plug-in through the second port.
12. The method according to claim 11, characterized in that The first data includes heartbeat data of the collaborative framework and / or log data of the collaborative framework; The second data includes heartbeat data of the Agent plug-in and / or log data of the Agent plug-in.
13. The method according to claim 1, characterized in that The collaborative framework further comprises a service layer, the service layer is used to provide services, and the processing instruction indicates to call a target service in the service layer; The controlling the first plug-in framework to load the service-type Agent plug-in corresponding to the processing instruction, and / or the controlling the second plug-in framework to load the mount-type Agent plug-in corresponding to the processing instruction, comprises: The first plug-in framework is controlled to load the service-type Agent plug-in configured for the target service, and / or the second plug-in framework is controlled to load the mount-type Agent plug-in configured for the target service.
14. A collaborative processing device of polymorphic agents, characterized in that: include: An instruction initiation module, used to send a processing instruction to the collaborative framework through the collaborative framework master application, wherein the collaborative framework includes a first plug-in framework and a second plug-in framework, wherein the first plug-in framework is used to plug and unplug the service-type Agent plug-in, and the second plug-in framework is used to plug and unplug the mount-type Agent plug-in; A plug-in control module, used to control the first plug-in framework to load the service Agent plug-in corresponding to the processing instruction according to a preset loading rule through the collaborative framework, and / or control the second plug-in framework to load the mount Agent plug-in corresponding to the processing instruction; The execution module is used to run the loaded Agent plug-in, use the Agent plug-in to call the service function in the collaborative framework, and implement the processing indicated by the processing instruction. The Agent plug-in includes a service Agent plug-in and / or a mounted Agent plug-in.
15. A collaborative processing device of polymorphic agents, characterized in that: include: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the collaborative processing method of the polymorphic agent as claimed in any one of claims 1 to 13 is implemented.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the collaborative processing method of the polymorphic agent according to any one of claims 1 to 13 is implemented.
17. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the collaborative processing method of polymorphic agents as claimed in any one of claims 1 to 13.