Lightweight artificial agent access method for management system-oriented
By constructing an intent catalog and performing intent matching, the high transformation cost and fragmented permissions of traditional management systems when integrating AI agents are solved. This enables intelligent transformation through natural language interaction, reduces transformation risks, and is applicable to systems across multiple industries.
Patent Information
- Application Number
- CN202611305956.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-11-27
AI Technical Summary
Traditional solutions for integrating enterprise management systems with AI agents suffer from several problems, including high costs of upgrading existing systems, disconnect between agent permissions and the original RBAC system, lack of permission binding for API tool generation, incompatibility between menu functions and natural language tools, and high costs of cross-system adaptation. These issues make it difficult to securely and efficiently upgrade existing enterprise management systems to a natural language interaction mode.
By acquiring the permission resource data of the target management system, constructing a permission directory tree and generating an intent directory based on the hierarchical association information of the permission records, matching natural language instructions with the intent directory, determining that the permission identifier of the target intent node belongs to the valid permission set, calling the tool based on the tool description information, and calling the target interface with the target user's user credentials to generate natural language response information.
Without reconstructing the original business front-end or changing the original business permission model, this method enables the intelligent transformation of traditional management systems through natural language interaction, reducing the risks of transformation, development, testing, and deployment, and avoiding issues such as unauthorized access by intelligent agents and inconsistent permission standards. It is suitable for lightweight intelligent agent access in traditional management systems across multiple industries.
Smart Images

Figure CN123178549A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the interdisciplinary field of Artificial Intelligence (AI) and enterprise information management, and in particular to a lightweight AI entity access method for management systems. Background Technology
[0002] With the rapid iteration and development of Large Language Model (LLM) and AI Agent technologies, the human-computer interaction mode of enterprise management systems is undergoing a transformation, gradually evolving from the traditional menu-based operation mode to a natural language interactive operation mode. Leveraging AI Agents, users can complete various business operations such as data querying, document processing, workflow approval, and business configuration through natural language commands, reducing the operational threshold of the system and improving the efficiency of enterprise business processing.
[0003] However, when integrating existing enterprise management systems with AI agents to achieve natural language interaction capabilities, the related technologies suffer from multiple technical defects, including high costs of modifying existing systems, fragmentation of agent permissions with the original (Role-Based Access Control, RBAC) system, lack of permission binding in application programming interface (API) tool generation, incompatibility between menu functions and natural language tool capabilities, and high costs of cross-system adaptation. These defects make it difficult to securely and efficiently upgrade existing enterprise management systems to a natural language interaction mode, thus hindering the large-scale application of AI agents in enterprise business scenarios. Summary of the Invention
[0004] The main objective of this application is to propose a lightweight AI agent access method for management systems, aiming to overcome the shortcomings of traditional solutions for accessing enterprise-level management systems to AI agents, and to safely and efficiently upgrade existing enterprise management systems to a natural language interaction mode.
[0005] To achieve the above objectives, a first aspect of this application proposes a lightweight AI agent access method for management systems, the method comprising: Obtain the permission resource data of the target management system; the permission resource data includes multiple permission records; A permission directory tree is constructed based on the hierarchical association information of the multiple permission records, and an intent directory is generated based on the leaf permission records in the permission directory tree whose permission type is operation interface. The natural language commands input by the target user are matched with the intent directory to obtain the target intent node; In response to the target permission identifier corresponding to the target intent node belonging to the valid permission set of the target user, a tool is invoked based on the tool description information corresponding to the target intent node, and the target interface corresponding to the target intent node is invoked based on the user credentials of the target user to obtain the interface return result; the tool description information is generated based on the interface metadata bound to the leaf permission record in the intent directory.
[0006] In some embodiments, constructing a permission directory tree based on the hierarchical association information of the multiple permission records includes: In response to the hierarchical association information of the first permission record indicating that the target permission record is a permission record without a parent, the first permission record is taken as the root node; the first permission record is any one or more of the plurality of permission records; The second permission record is grouped according to the hierarchical association information of the second permission record and child nodes are recursively constructed to obtain the permission directory tree; the second permission record is the other permission record among the multiple permission records except the first permission record.
[0007] In some embodiments, generating an intent directory based on leaf permission records of permission type "operation interface" in the permission directory tree includes: Obtain the path information and intent identifier of the leaf permission record with permission type "operation interface" in the permission directory tree; the path information is obtained by concatenating the display names of the permission records at all levels from the root node to the node where the leaf permission record is located in hierarchical order, and the intent identifier is obtained by concatenating the unique identifiers of the permission records at all levels in hierarchical order; Based on the path information and display name of the leaf permission record, semantic expansion is performed to obtain the extended description information of the leaf permission record; Using the intent identifier of the leaf permission record as the key and the node information containing extended description information and hierarchical priors in the leaf permission record as the value, an intent mapping table for the leaf permission record is constructed, and the intent mapping table and the permission directory tree are used as the intent directory; the hierarchical priors are set based on the node type of the node where the leaf permission record is located, and the node type includes directory nodes, menu nodes and operation interface nodes. The hierarchical priors of the directory nodes are lower than the hierarchical priors of the menu nodes, and the hierarchical priors of the menu nodes are lower than the hierarchical priors of the operation interface nodes.
[0008] In some embodiments, the step of matching the natural language command input by the target user with the intent directory to obtain the target intent node includes: Obtain natural language instructions input by the target user, and generate normalized intent text based on the natural language instructions; Based on the semantic matching results between the normalized intent text and the path information of each node in the intent directory, as well as the hierarchical priors of each node in the intent directory, the nodes in the intent directory are coarsely screened to obtain candidate path nodes. The leaf nodes in the subtree corresponding to the candidate path node in the permission directory tree, whose permission type is operation interface and are in the enabled state, are determined as the leaf candidate set. Based on the normalized intent text and the multidimensional semantic similarity between each leaf node in the leaf candidate set, the target intent node is determined from the leaf candidate set.
[0009] In some embodiments, the intent directory includes the intent path of the leaf permission record, and the method further includes: Extract the interface metadata bound to the leaf permission record from the interface document of the target management system; The tool name is generated based on the intent path of the leaf permission record, and the tool name, intent path and interface description in the interface metadata are combined to generate tool description information; The permission identifier of the leaf permission record is embedded as the target permission identifier into the metadata field of the tool description information.
[0010] In some embodiments, the method further includes: Based on the session identifier of the target user, the effective permission set of the target user is recovered, and it is detected whether the target permission identifier corresponding to the target intent node belongs to the effective permission set; In response to the fact that the target permission identifier does not belong to the set of valid permissions, a permission denial message is returned and the tool call is terminated; The encapsulated response returned by the target interface is unpacked to obtain the data fields in the encapsulated response as the interface return result.
[0011] In some embodiments, the method further includes: In response to the risk level of the operation corresponding to the target intent node being a preset high-risk level, parameter echo information is generated based on the call parameters of the call request of the target interface; the call request is constructed based on the user credentials and is used to ensure that the existing data permission verification logic of the target interface continues to be effective based on the user credentials; Upon receiving a confirmation instruction from the target user based on the parameter echo information, the invocation request is executed; In response to the encapsulated response returned by the target interface indicating that the target interface call failed, the response code and the corresponding error information in the encapsulated response are converted into a natural language description, and a response message to the natural language instruction is generated based on the natural language description.
[0012] To achieve the above objectives, a second aspect of this application proposes a lightweight AI agent access system for management systems, the system comprising: The acquisition module is used to acquire permission resource data of the target management system; the permission resource data includes multiple permission records; The directory tree construction module is used to construct a permission directory tree based on the hierarchical association information of the multiple permission records, and to generate an intent directory based on the leaf permission records in the permission directory tree whose permission type is operation interface; The intent matching module is used to match the natural language instructions input by the target user with the intent directory to obtain the target intent node; The interface invocation module is used to respond to the target permission identifier corresponding to the target intent node belonging to the valid permission set of the target user, to invoke the tool based on the tool description information corresponding to the target intent node, and to invoke the target interface corresponding to the target intent node based on the user credentials of the target user, and to obtain the interface return result; the tool description information is generated based on the interface metadata bound to the leaf permission record in the intent directory; The instruction response module is used to generate response information for the natural language instruction based on the result returned by the interface.
[0013] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the lightweight artificial intelligence agent access method for management systems described in the first aspect.
[0014] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the lightweight AI agent access method for management systems described in the first aspect.
[0015] To achieve the above objectives, a fifth aspect of the present application provides a computer program product, which includes a computer program that, when executed by a processor, implements the lightweight artificial intelligence agent access method for management systems provided in the first aspect above.
[0016] The lightweight AI agent access method, system, electronic device, computer-readable storage medium, and computer program product proposed in this application for management systems acquire permission resource data of the target management system. This permission resource data includes multiple permission records. A permission directory tree is constructed based on the hierarchical association information of each of the multiple permission records, and an intent directory is generated based on the leaf permission records in the permission directory tree whose permission type is operation interface. Natural language commands input by the target user are matched with the intent directory to obtain target intent nodes. In response to the target permission identifier corresponding to the target intent node belonging to the target user's valid permission set, a tool is invoked based on the tool description information corresponding to the target intent node, and the target interface corresponding to the target intent node is invoked based on the target user's user credentials to obtain the interface return result. The tool description information is generated based on the interface metadata bound to the leaf permission records in the intent directory. Response information for the natural language command is generated based on the interface return result.
[0017] Compared to traditional solutions for integrating enterprise-level management systems with AI agents, this application's embodiment acquires existing permission resource data from the target management system, constructs a permission directory tree based on the hierarchical association information of permission records, and generates an intent directory. This directly converts the target management system's existing RBAC permission directory tree into the agent's intent matching space. Then, by matching natural language commands with the intent directory, target intent nodes are obtained. Provided the target permission identifier belongs to the target user's valid permission set, a tool is invoked based on the tool description information, and the target interface is invoked using the target user's user credentials, ultimately generating natural language response information. Thus, this application's embodiment can achieve the intelligent transformation of traditional management systems to natural language interactive mode without reconstructing the original business front-end or changing the original business permission model, reducing the development, testing, and deployment risks of the transformation. Simultaneously, since tool calls inherit the original system's existing security links in terms of functional permissions, user sessions, and data permissions, issues such as unauthorized access by the agent and inconsistent permission definitions can be avoided. In other words, this application's embodiment effectively overcomes the shortcomings of traditional solutions for integrating enterprise-level management systems with AI agents, safely and efficiently upgrading existing enterprise management systems to a natural language interaction mode.
[0018] Furthermore, since the embodiments of this application mainly read the permission table, menu configuration and interface documentation to add an external adaptation layer in a data-driven manner, it can be applied to the lightweight intelligent agent access of traditional management systems in multiple industries, thereby reducing migration costs and facilitating cross-system and cross-industry reuse. Attached Figure Description
[0019] Figure 1A flowchart illustrating the steps of the lightweight AI agent access method for management systems provided in some embodiments of this application; Figure 2 for Figure 1 A detailed flowchart of step S102; Figure 3 for Figure 1 A schematic diagram of another detailed step in step S102; Figure 4 for Figure 1 A detailed flowchart of step S103; Figure 5 A flowchart illustrating the steps of the lightweight AI agent access method for management systems provided in this application embodiment in other embodiments; Figure 6 A flowchart illustrating the steps of the lightweight AI agent access method for management systems provided in this application embodiment; Figure 7 A flowchart illustrating the steps of the lightweight AI agent access method for management systems provided in this application embodiment; Figure 8 A schematic diagram of the overall system architecture involved in the lightweight AI agent access method for management systems provided in the embodiments of this application; Figure 9 A schematic diagram of the intent catalog construction process involved in the lightweight AI agent access method for management systems provided in the embodiments of this application; Figure 10 A schematic diagram of a secure call chain involving permission inheritance in the lightweight AI agent access method for management systems provided in this application embodiment; Figure 11 A schematic diagram illustrating the three-dimensional semantic similarity calculation of intent matching involved in the lightweight AI agent access method for management systems provided in this application embodiment; Figure 12 The electronic device provided in the embodiments of this application is shown in some embodiments as a hardware structure diagram. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0021] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0023] First, a brief explanation of the overall concept of the embodiments of this application will be given.
[0024] With the development of Large Language Modeling (LLM) and AI Agent technologies, enterprise management systems are evolving from "menu-click operation" to "natural language interactive operation." Traditional management systems (such as OA, ERP, CRM, inventory management, and IoT device management platforms) are typically built on a "User-Role-Resource" (RBAC) permission model, and have already established stable organizational permission systems, functional menu structures, interface capabilities, and audit log mechanisms. However, when integrating traditional management systems with AI Agents, traditional solutions still face the following technical challenges.
[0025] First, the costs of front-end and business process transformation are high. Some platform-based or ecosystem-based AI transformation solutions typically require embedding conversational entry points into the original system, adapting specific data connectors, or reconstructing existing functional entry points. For traditional management systems that are already running stably, front-end transformation and business process reengineering increase development, testing, and deployment risks, and are also not conducive to cross-system and cross-industry reuse.
[0026] Second, the AI agent permission system is prone to being disconnected from the original system's permission system. Traditional AI agent access solutions commonly configure agents with independent API keys, system-level tokens, independent scopes, or independent policy gateways. While this approach enables API calls, if it's not linked to the currently logged-in user's RBAC permission set, two risks may arise: first, the agent may call APIs that the current user doesn't have permission to access, resulting in unauthorized access; second, the administrator needs to maintain a separate set of agent permission policies outside the original system's permission policies, leading to inconsistent permission definitions.
[0027] Third, the conversion from OpenAPI to tools lacks a stable binding with the business permission directory. Various solutions exist in the industry for converting OpenAPI, Swagger, or API documentation into LLM Function Tools, MCP Tools, or other tool descriptions. These solutions typically generate tool schemas based on interface paths, methods, parameters, and descriptions, but the tool organization structure often relies on a flat list of APIs or interface description text. For traditional management systems containing numerous controllers and API endpoints, relying solely on interface summaries for intent identification is prone to insufficient semantic disambiguation; furthermore, if the generated tool description does not carry the original system permission identifier, it is difficult to inherit the original RBAC verification chain at runtime.
[0028] Fourth, there is a lack of unified mapping between traditional menu functions and intelligent agent tool capabilities. In traditional systems, users access functions through a permission directory tree of "directory-menu-button / API"; in intelligent agent systems, models typically call interfaces through a tool list. If the two systems are maintained separately, the functions visible and clickable on the user interface cannot be directly translated into natural language callable capabilities, and intelligent agent tools cannot be clearly mapped to the original system's menu path, permission identifier, and audit entry point.
[0029] Fifth, insufficient cross-platform versatility. Traditional solutions often rely on specific SaaS ecosystems, specific SDKs, specific front-end technology stacks, or additional agent governance platforms. For traditional management systems that heavily utilize self-built RBAC, REST APIs, and Swagger documentation, a data-driven transformation approach is needed that leverages existing permission tables, menus, and API documentation to reduce code intrusion and migration costs.
[0030] In summary, traditional technologies still lack a systematic approach that can directly transform the existing RBAC permission directory tree of traditional management systems into the intent matching space of AI agents, bind the leaf nodes of the directory tree with API metadata, stable permission identifiers and tool schemas, and inherit the original permission boundaries of the current user throughout the entire chain of natural language intent matching, tool selection, runtime agent invocation and audit logging.
[0031] To address the aforementioned issues, this application proposes a lightweight AI agent access method, system, electronic device, computer-readable storage medium, and computer program product for management systems. This aims to solve problems encountered during the AI intelligent transformation of traditional management systems, such as "high cost of original system transformation, disconnect between the intelligent agent permission system and the original RBAC, lack of permission binding in API tool generation, incompatibility between menu functions and natural language tool capabilities, and high cost of cross-system adaptation."
[0032] This application's embodiments automatically parse the existing permission directory tree (Directory→Menu→Button / API hierarchical structure) and API interface metadata (Swagger / OpenAPI / Knife4j documentation, controller annotations, or service registration metadata) of traditional management systems to construct an Intent Directory that simultaneously includes "hierarchical menu semantics, stable permission identifiers, API endpoints, parameter schemas, and audit information." Based on this, the permission-bound APIs are automatically orchestrated into Function Tools that can be called by the AIAgent. Through a permission-aware proxy layer, the current user's session identity and RBAC permission set are inherited with each Tool call. This achieves the intelligent transformation of traditional management systems into natural language interactive systems without reconstructing the original business front-end or changing the original business permission model.
[0033] In this embodiment, permission resource data of the target management system is obtained; the permission resource data includes multiple permission records; a permission directory tree is constructed based on the hierarchical association information of the multiple permission records, and an intent directory is generated based on the leaf permission records of the permission directory tree whose permission type is operation interface; the natural language command input by the target user is matched with the intent directory to obtain a target intent node; in response to the target permission identifier corresponding to the target intent node belonging to the valid permission set of the target user, a tool is invoked based on the tool description information corresponding to the target intent node, and the target interface corresponding to the target intent node is invoked based on the user credentials of the target user to obtain the interface return result; the tool description information is generated based on the interface metadata bound to the leaf permission records in the intent directory; and response information for the natural language command is generated based on the interface return result.
[0034] Compared to traditional solutions for integrating enterprise-level management systems with AI agents, this application's embodiment acquires existing permission resource data from the target management system, constructs a permission directory tree based on the hierarchical association information of permission records, and generates an intent directory. This directly converts the target management system's existing RBAC permission directory tree into the agent's intent matching space. Then, by matching natural language commands with the intent directory, target intent nodes are obtained. Provided the target permission identifier belongs to the target user's valid permission set, a tool is invoked based on the tool description information, and the target interface is invoked using the target user's user credentials, ultimately generating natural language response information. Thus, this application's embodiment can achieve the intelligent transformation of traditional management systems to natural language interactive mode without reconstructing the original business front-end or changing the original business permission model, reducing the development, testing, and deployment risks of the transformation. Simultaneously, since tool calls inherit the original system's existing security links in terms of functional permissions, user sessions, and data permissions, issues such as unauthorized access by the agent and inconsistent permission definitions can be avoided. In other words, this application's embodiment effectively overcomes the shortcomings of traditional solutions for integrating enterprise-level management systems with AI agents, safely and efficiently upgrading existing enterprise management systems to a natural language interaction mode.
[0035] Furthermore, since the embodiments of this application mainly read the permission table, menu configuration and interface documentation to add an external adaptation layer in a data-driven manner, it can be applied to the lightweight intelligent agent access of traditional management systems in multiple industries, thereby reducing migration costs and facilitating cross-system and cross-industry reuse.
[0036] Next, based on the overall concept of the above embodiments of this application, specific embodiments of the lightweight artificial intelligence agent access method, system, electronic device, computer-readable storage medium and computer program product for management systems proposed in the embodiments of this application are presented. First, each specific embodiment of the lightweight artificial intelligence agent access method for management systems proposed in the embodiments of this application is described in detail.
[0037] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0038] It should be noted that the lightweight AI agent access method for management systems provided in this application embodiment relates to the cross-technical field of artificial intelligence and enterprise information management. Specifically, this lightweight AI agent access method for management systems can be a lightweight AI agent access method for traditional management systems (IoT / OA / ERP / CRM / inventory management / any management system based on the "user-role-resource" permission model). By automatically parsing the existing permission directory tree and API interface metadata of the traditional system, an "intent directory" is constructed and the APIs bound to the permissions are orchestrated into tools that can be called by the intelligent agent, thereby realizing the natural language interactive intelligent transformation of the traditional management system under the premise of low intrusion.
[0039] The lightweight AI agent access method for management systems provided in this application can be applied to either a terminal or a server. The lightweight AI agent access method for management systems provided in this application can be software running on either the terminal or the server. In some embodiments, the terminal can be an electronic device such as a smartphone, tablet, laptop, or desktop computer. The server can be the backend server terminal device of the terminal, which can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and AI platforms. The software can be an application, a computer program, and a storage medium carrying the computer program that implements the lightweight AI agent access method for management systems. It should be understood that, based on different design needs of actual applications, the terminal, server, and software involved in this application can be used in different feasible embodiments, and other forms not listed here are also possible. The lightweight AI agent access method for management systems provided in this application does not specifically limit these aspects.
[0040] Furthermore, this application can also be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, personal computers (PCs), minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via communication networks. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0041] For ease of understanding and explanation, the following text will use the lightweight AI agent access method for management systems provided in the embodiments of this application as an example to describe the various specific embodiments of this application in detail. The implementation of the lightweight AI agent access method for management systems provided in the embodiments of this application for any of the above-described subject matter can refer to the implementation process of the lightweight AI agent access method for management systems described below.
[0042] Please refer to Figure 1 , Figure 1 The flowchart illustrates the steps of the lightweight AI agent access method for management systems provided in this application embodiment. It should be understood that, although... Figure 1 The flowcharts illustrating subsequent steps show the execution order of some method steps. However, based on different design needs in practical applications, the lightweight AI agent access method for management systems provided in this application can, of course, employ a different execution order of method steps than those shown in the figures. That is, Figure 1 The order of the method steps shown does not constitute a limitation on the execution logic order of the lightweight AI agent access method for management systems provided in the embodiments of this application. Any other method based on... Figure 1 Reasonable changes to the sequence of steps shown should be included within the protection scope of the lightweight AI agent access method for management systems provided in the embodiments of this application.
[0043] like Figure 1 As shown, in some embodiments, the lightweight AI agent access method for management systems provided in this application may include steps S101 to S105 as shown below.
[0044] Step S101: Obtain the permission resource data of the target management system; the permission resource data includes multiple permission records.
[0045] It should be noted that the target management system can be any management system built based on the "user-role-resource" permission model, such as IoT device management platforms, OA systems, ERP systems, CRM systems, and inventory management systems. Permission resource data can be data recorded in existing permission resource tables (such as the permission table) within the target management system. Each permission record can include fields such as a unique identifier, hierarchical association information (such as the parent permission identifier parentId), display name, permission identifier (such as permissionCode), permission type, and enabled status. The permission type indicates whether the permission record is a directory, menu, or operation interface. For example, a permission type value of 0 indicates a directory, 1 indicates a menu, and 2 indicates a button / API (operation interface). The enabled status value is 0 for disabled and 1 for enabled.
[0046] Terminal devices can read the permission resource table from the database of the target management system, extract the aforementioned core fields of each permission record, and thus obtain permission resource data including multiple permission records. For example, taking the IoT device management platform as an example, the permission records read by the terminal device may include: a directory permission record with a unique identifier of 1, a parent permission identifier of 0, a display name of "Device Management", a permission identifier of "iot:device", and a permission type of 0; a menu permission record with a unique identifier of 10, a parent permission identifier of 1, a display name of "Device List", a permission identifier of "iot:device:list", and a permission type of 1; an operation interface permission record with a unique identifier of 101, a parent permission identifier of 10, a display name of "Get Device Details", a permission identifier of "iot:device:detail:view", and a permission type of 2; and an operation interface permission record with a unique identifier of 102, a parent permission identifier of 10, and a display name of "Export Device List", etc.
[0047] In some embodiments, for target management systems without independent permission database tables (such as systems where permission information is stored in configuration files, annotations, or code), the terminal device can perform static analysis (such as abstract syntax tree (AST) parsing) on the target management system code, scan permission annotations on controller classes (such as Java's @RequiresPermissions, Spring Security's @PreAuthorize, etc.) to extract permission information, combine them with interface documentation (such as Swagger / OpenAPI documentation) to obtain interface metadata, and use unified modeling information of menu configuration (such as Vue Router routing table, ReactRouter configuration) to reverse-engineer the menu hierarchy relationship, thereby obtaining permission resource data.
[0048] In some embodiments, for a target management system that uses a microservice architecture and whose permissions are distributed across multiple services, the terminal device can deploy a lightweight permission collection agent in each service. By subscribing to the service registry (such as Nacos, Eureka, Consul) service list, the device can automatically discover the interface endpoints of each service, extract the binding relationship between permissions and interfaces from the interface documentation and permission annotations of each service, and finally complete the aggregation of permission resource data at the central coordination node.
[0049] Step S102: Construct a permission directory tree based on the hierarchical association information of the multiple permission records, and generate an intent directory based on the leaf permission records in the permission directory tree whose permission type is operation interface.
[0050] It should be noted that the permission directory tree can be a tree structure of "directory-menu-button / API" restored according to the hierarchical association information of permission records; the intent directory can be a directory index obtained by semantically transforming the permission directory tree. It also contains hierarchical menu semantics, stable permission identifiers, interface endpoints, parameter information and audit-related information, which are used to provide a semantic directory index for subsequent natural language intent matching.
[0051] After acquiring the permission resource data, the terminal device can organize the permission records into a tree structure based on their hierarchical association information, thus obtaining a permission directory tree. Then, based on the leaf permission records in the permission directory tree whose permission type is "operation interface," the terminal device can perform semantic expansion and identifier generation on the leaf permission records, and bind the leaf permission records to their interface metadata, thereby generating an intent directory. In this way, the existing permission directory of the target management system is transformed into an intent matching space for the intelligent agent, and the visible and clickable functions of the target management system on the interface can be directly converted into natural language callable capabilities.
[0052] Step S103: Match the natural language command input by the target user with the intent directory to obtain the target intent node.
[0053] It should be noted that the target intent node can be the executable node in the intent directory that best matches the semantics of the natural language command input by the target user, and its permission type is operation interface.
[0054] After generating the intent catalog, the terminal device can receive natural language instructions input by the target user (such as "Please check the detailed information of device SN-20250601"), and match the natural language instructions with the nodes in the intent catalog to determine the target intent node corresponding to the natural language instructions.
[0055] Step S104: In response to the target permission identifier corresponding to the target intent node belonging to the valid permission set of the target user, a tool is invoked based on the tool description information corresponding to the target intent node, and the target interface corresponding to the target intent node is invoked based on the user credentials of the target user, and the interface return result is obtained; the tool description information is generated based on the interface metadata bound to the leaf permission record in the intent directory.
[0056] It should be noted that the tool description information can be a tool description that can be directly called by the agent, obtained by automatically orchestrating and converting the interface metadata bound to the leaf permission record (such as a Tool Schema based on the large language model Function Calling mechanism); the effective permission set can be a set of permission identifiers that the target user has in the target management system and are in an enabled state; the target permission identifier can be a stable permission identifier embedded in the tool description information that is required for runtime permission verification; and the user credentials can be credentials used to identify the target user, such as session tokens, JWTs, or access tokens.
[0057] After determining the target intent node, the terminal device can first check whether the target permission identifier corresponding to the target intent node belongs to the valid permission set of the target user. If the target permission identifier belongs to the valid permission set, the terminal device makes a tool call based on the tool description information corresponding to the target intent node, and calls the target interface corresponding to the target intent node with the user credentials of the target user, without using system-level credentials that bypass the user permission boundary. This allows the existing data permissions, tenant permissions, field permissions, and business verification logic of the target interface to continue to take effect, and the interface return result is obtained.
[0058] Step S105: Generate response information for the natural language instruction based on the result returned by the interface.
[0059] After receiving the interface return result, the terminal device can extract the data content from the interface return result and convert the structured data content into a response message in natural language to present to the target user. For example, in response to the natural language command "Please show me the detailed information of device SN-20250601", the response message generated by the terminal device can be: "The detailed information of device SN-20250601 is as follows: Device name is a certain smart vending machine A-001, device status is online, network type is 4G, current temperature is 4.2°C, last opening time is 2025-06-24 10:05:32, merchant is a certain convenience store (number: M001)".
[0060] In this embodiment, the existing permission resource data of the target management system is obtained through a terminal device. A permission directory tree is constructed based on the hierarchical association information of the permission records, and an intent directory is generated. This directly converts the existing RBAC permission directory tree of the target management system into an intent matching space for the intelligent agent. Then, the terminal device matches natural language commands with the intent directory to obtain target intent nodes. Provided that the target permission identifier belongs to the target user's valid permission set, a tool is invoked based on the tool description information, and the target interface is invoked using the target user's user credentials, ultimately generating natural language response information. Thus, this embodiment can achieve the intelligent transformation of traditional management systems to natural language interactive modes without reconstructing the original business front-end or changing the original business permission model, reducing the development, testing, and deployment risks of the transformation. Simultaneously, since tool invocation inherits the existing security links of the original system in terms of functional permissions, user sessions, and data permissions, it can avoid problems such as unauthorized access by intelligent agents and inconsistent permission standards. Furthermore, since this method mainly reads the permission table, menu configuration, and interface documentation, adding an external adaptation layer in a data-driven manner, it is suitable for lightweight intelligent agent access in traditional management systems across multiple industries, reducing migration costs and facilitating cross-system and cross-industry reuse.
[0061] Please refer to Figure 2 , Figure 2 for Figure 1 A detailed flowchart of step S102.
[0062] like Figure 2 As shown, in some embodiments, the step of “constructing a permission directory tree based on the hierarchical association information of the multiple permission records” in step S102 above may include steps S201 and S202 as shown below.
[0063] Step S201: In response to the hierarchical association information of the first permission record indicating that the first permission record is a permission record without a parent, the first permission record is taken as the root node; the first permission record is any one or more of the multiple permission records.
[0064] It should be noted that permission records without a parent can be permission records that take a preset root value for hierarchical association information, such as permission records where the parent permission identifier parentId has a value of 0.
[0065] The terminal device can traverse each permission record in the permission resource data and determine the first permission record with no parent permission record as the root node, thus obtaining the root node set. For example, taking the IoT device management platform mentioned above as an example, the permission record with a unique identifier of 1, a parent permission identifier of 0, and a display name of "Device Management" is determined by the terminal device as the root node.
[0066] Step S202: Group the second permission record according to the hierarchical association information of the second permission record and recursively construct child nodes to obtain the permission directory tree; the second permission record is the other permission record among the multiple permission records except the first permission record.
[0067] After determining the root node, the terminal device can use a recursive tree construction algorithm to group the second permission records according to the parent permission identifier of the second permission record, attach each second permission record to the node corresponding to its parent permission record, and recursively construct child nodes to form a complete permission directory tree.
[0068] In some embodiments, the terminal device can define a permission tree node model (such as IntentNode) for each node in the permission directory tree. The permission tree node model may include fields such as original permission ID, display name, permission identifier, permission type, path information, intent identifier, interface endpoint, request method, operation identifier, runtime required permission identifier, operation risk level, and child node list. Among them, the intent identifier, interface endpoint, request method, and operation identifier may only have values in nodes with permission type of operation interface, and the operation risk level may include levels such as read (READ), write (WRITE), export (EXPORT), delete (DELETE), and control (CONTROL).
[0069] For example, based on the permission records of the aforementioned IoT device management platform, the permission directory tree constructed by the terminal device can be as follows: under the root node "Device Management" are the "Device List" menu node and the "Device Alarm" menu node; under the "Device List" menu node are the "Get Device Details" operation interface node and the "Export Device List" operation interface node; and under the "Device Alarm" menu node are the "Query Alarm List" operation interface node.
[0070] In this embodiment, by using the terminal device with the permission record without a parent as the root node, and grouping and recursively constructing child nodes according to the hierarchical association information of the remaining permission records, the permission records stored in the target management system in a flat manner can be automatically restored into a complete "directory-menu-button / API" tree structure without the need for manual sorting of the menu hierarchy, thereby providing an accurate hierarchical structure foundation for the construction of the intent directory.
[0071] Please refer to Figure 3 , Figure 3 for Figure 1 A schematic diagram of another detailed step in step S102.
[0072] like Figure 3 As shown, in some embodiments, the step S102 above, "generating an intent directory based on the leaf permission records of the permission type being operation interface in the permission directory tree", may include steps S301 to S303 as shown below.
[0073] Step S301: Obtain the path information and intent identifier of the leaf permission record with permission type "operation interface" in the permission directory tree; the path information is obtained by concatenating the display names of the permission records at all levels from the root node to the node where the leaf permission record is located in hierarchical order, and the intent identifier is obtained by concatenating the unique identifiers of the permission records at all levels in hierarchical order.
[0074] It should be noted that path information can be used to represent the complete hierarchical path of leaf permission records in the permission directory tree. For example, let the root node be R, the node containing the leaf permission record be N, and the ancestor node sequence of node N be {A1, A2, ..., Ak} (where A1 = R, and Ak is the direct parent node of N). Then, the terminal device can generate the path information for node N according to the formula path(N) = name(A1) + ">" + name(A2) + ... + name(Ak) + ">" + name(N); when node N is the root node, path(N) = name(N). For example, the path information for the leaf permission record corresponding to "Get Device Details" could be "Device Management > Device List > Get Device Details".
[0075] It should be noted that the intent identifier can be a unique hierarchical intent identifier for the leaf permission record. For example, the terminal device can generate the intent identifier for node N according to the formula intentId(N) = id(A1) + "." + id(A2) + ... + "." + id(N); for example, the intent identifier "1.10.101" corresponds to the path information "Device Management > Device List > Get Device Details".
[0076] Step S302: Based on the path information and display name of the leaf permission record, perform semantic expansion to obtain the extended description information of the leaf permission record.
[0077] It should be noted that, since menu names in traditional management systems are often brief business descriptions, their coverage of natural language queries is limited. Extending the description information can be used to improve the semantic coverage of nodes for natural language queries.
[0078] Terminal devices can automatically generate extended description information using path information. For example, a terminal device can generate extended description information for node N according to the formula description(N) = “in” + path(N) + “under the path” + name(N) + “function”; for example, the extended description information obtained after semantic expansion of the original display name “Get Device Details” can be “Get Device Details function under the path Device Management > Device List”.
[0079] Step S303: Using the intent identifier of the leaf permission record as the key and the node information of the leaf permission record containing extended description information and hierarchical prior as the value, construct an intent mapping table for the leaf permission record, and use the intent mapping table and the permission directory tree as the intent directory; the hierarchical prior is set based on the node type of the node where the leaf permission record is located. The node type includes directory nodes, menu nodes, and operation interface nodes. The hierarchical prior of the directory node is lower than the hierarchical prior of the menu node, and the hierarchical prior of the menu node is lower than the hierarchical prior of the operation interface node.
[0080] It should be noted that hierarchical priors can be matching priors assigned to different level nodes in the permission directory tree, used for coarse-grained path location and candidate set convergence, but the final executable tool still takes the leaf node with permission type as the operation interface as the standard.
[0081] Terminal devices can set hierarchical priors for nodes in the permission directory tree based on the node type of the node they belong to. For example, the hierarchical prior for directory nodes can be set in the range of [0.2, 0.4] for domain classification and coarse screening, with a relatively wide semantic range; the hierarchical prior for menu nodes can be set in the range of [0.5, 0.7] to determine function entry points and business scenarios; and the hierarchical prior for operation interface nodes can be set in the range of [0.8, 1.0], corresponding to executable operations, serving as final tool candidates.
[0082] Furthermore, the terminal device can construct an intent mapping table (such as a HashMap) using the intent identifier of the leaf permission record as the key and the node information containing all extended fields such as extended description information and hierarchical priors as the value, while retaining the original permission directory tree, and using the intent mapping table and permission directory tree as the intent directory. For example, the intent directory may include: a leaf intent index with the intent identifier as the key and the node information with the permission type as the operation interface as the value, used for tool generation and final execution; and a hierarchical path index with path information as the index, covering directory nodes, menu nodes, and operation interface nodes, used for intent coarse filtering and semantic disambiguation.
[0083] In this embodiment, the terminal device generates path information and intent identifiers for the leaf permission records. Based on the path information and display name, semantic expansion is performed. The node is set with progressively increasing hierarchical priors according to the node type. An intent mapping table is constructed using the intent identifier as the key. This can build an intent directory that simultaneously contains hierarchical menu semantics, stable permission identifiers, and interface binding relationships. This gives the originally short menu name path context semantics, alleviates the problem of insufficient semantic disambiguation when relying solely on interface summaries for intent recognition, and provides a hierarchical index for subsequent two-stage intent matching.
[0084] Please refer to Figure 4 , Figure 4 for Figure 1 A detailed flowchart of step S103.
[0085] like Figure 4 As shown, in some embodiments, step S103 above, which involves matching the natural language instruction input by the target user with the intent directory to obtain the target intent node, may include steps S401 to S404 as shown below.
[0086] Step S401: Obtain the natural language instructions input by the target user, and generate normalized intent text based on the natural language instructions.
[0087] The terminal device can acquire natural language commands (denoted as Q) input by the target user, and preprocess the natural language commands to generate normalized intent text.
[0088] In some embodiments, the terminal device can first perform entity recognition and extraction on the natural language instruction. That is, it can use a general named entity recognition model (such as the BERT-BiLSTM-CRF model or prompt word extraction based on a large language model) to extract key entity values (such as device number, order number, username, etc.) from the natural language instruction, obtaining a set of entity key-value pairs E = {(k1, v1), (k2, v2), ...}. Then, the terminal device can remove the entity values from the natural language instruction and replace the entity values with entity type placeholders to obtain the normalized intent text Q'. For example, in the case of the natural language instruction Q = “Help me check the details of device SN-20250601”, the set of entity key-value pairs extracted by the terminal device can be E = {("deviceCode", "SN-20250601")}, and the generated normalized intent text can be Q' = “Help me check the details of device {deviceCode}”.
[0089] Step S402: Based on the semantic matching results between the normalized intent text and the path information of each node in the intent directory, and the hierarchical priors of each node in the intent directory, the nodes in the intent directory are coarsely screened to obtain candidate path nodes.
[0090] After generating the normalized intent text, the terminal device can perform the first stage of matching, that is, use directory and menu hierarchy information to perform semantic coarse screening to determine the business domain and function path prefix of the target user's intent.
[0091] In some embodiments, the terminal device can first filter nodes in the enabled state from the hierarchical path index of the intent directory to form a coarse-screen set, and then calculate coarse-screen scores for the directory nodes, menu nodes, and operation interface nodes in the coarse-screen set respectively. For example, the terminal device can calculate the coarse-screen score according to the formula CoarseScore(Q', node) = β×S_path(Q',node) + (1 - β) × TypePrior(node.type), where S_path(Q', node) is the semantic similarity between the normalized intent text and the node path information, TypePrior(node.type) is the hierarchical prior corresponding to the node type, and β is the weight coefficient; then, the terminal device can determine the top K nodes with the highest coarse-screen scores as candidate path nodes.
[0092] Step S403: Determine the leaf nodes in the subtree corresponding to the candidate path node in the permission directory tree, whose permission type is operation interface and which are in the enabled state, as the leaf candidate set.
[0093] After obtaining the candidate path nodes, the terminal device can perform the second stage of matching, that is, expand the candidate path nodes to their downstream executable leaf nodes, and determine the leaf nodes in the subtree corresponding to the candidate path nodes in the permission directory tree that have the permission type of operation interface and are in the enabled state as the leaf candidate set, so as to select the target tool only from the executable leaf nodes.
[0094] In some embodiments, if the terminal device cannot determine the path prefix, the leaf candidate set may degenerate into all leaf nodes in the intent directory that are enabled.
[0095] Step S404: Based on the multidimensional semantic similarity between the normalized intent text and each leaf node in the leaf candidate set, determine the target intent node from the leaf candidate set.
[0096] The terminal device can comprehensively calculate the multidimensional semantic similarity of each leaf node in the leaf candidate set, and determine the target intent node from the leaf candidate set based on the multidimensional semantic similarity.
[0097] In some embodiments, multidimensional semantic similarity may include path semantic similarity, name keyword overlap, entity parameter matching, and interface description similarity.
[0098] For example, for path semantic similarity S_path, the terminal device can use a pre-trained text embedding model (such as text2vec-large-chinese or BGE-M3) to map the normalized intent text and the complete node path into vectors respectively, and calculate the cosine similarity, i.e.: S_path(Q', node) = cos(embed(Q'), embed(node.intentPath)); for name keyword overlap S_keyword, the terminal device can use Chinese word segmentation (such as jieba segmentation, HanLP segmentation, or the system's built-in dictionary) to segment the normalized intent text and the node display name respectively, and calculate the name keyword overlap according to the formula S: _keyword(Q', node) = |tokens(Q') ∩ tokens(node.name)| / max(|tokens(Q')|, |tokens(node.name)|); for entity parameter matching S_param, the terminal device can use the formula: S_param(Q', node) = |extractedEntityTypes(Q') The function `∩requiredParamTypes(node.toolSchema)| / |requiredParamTypes(node.toolSchema)|` calculates the matching degree between the extracted entity types and the set of required parameter names in the tool description information. If the set of required parameter names is empty, the entity parameter matching degree is set to 1 when no entity parameter is extracted from the target user's input; otherwise, the entity parameter matching degree is set to 0. In some other embodiments, the terminal device can also delete this dimension and renormalize the weights of the remaining dimensions. For the interface description similarity S_api, the terminal device can perform semantic similarity calculation between the normalized intent text and the interface description composed of the interface description, operation identifier, and parameter description, i.e., `S_api(Q', node) = cos(embed(Q'), embed(node.apiDescription + node.operationId +paramDescriptions))`, to compensate for the lack of information when the menu name is too short.
[0099] Furthermore, the terminal device can perform weighted fusion of the similarities in the above dimensions to obtain the fused similarity.
[0100] For example, the terminal device can calculate the fusion similarity according to the formula Similarity(Q', node) = α1 × S_path(Q',node) + α2 × S_keyword(Q', node) + α3 × S_param(Q', node) + α4 × S_api(Q',node), where α1 + α2 + α3 + α4 = 1.0. Recommended values are α1 = 0.45, α2 = 0.25, α3 = 0.20, and α4 = 0.10. This fusion similarity is kept within the range of 0 to 1, which facilitates the setting of a uniform threshold.
[0101] Afterwards, the terminal device can identify the leaf node with the highest fusion similarity in the leaf candidate set as the target intent node; when the highest fusion similarity is lower than the preset similarity threshold (e.g., 0.55, which can be adjusted according to the system), the terminal device can determine that the target user's intent exceeds the scope of system functions or is not sufficiently described, and return a clarification prompt to guide the target user to supplement the operation object or function type.
[0102] In some embodiments, after obtaining the leaf node with the highest fusion similarity, the terminal device can further filter by combining it with the target user's valid permission set: if the permission identifier corresponding to the leaf node belongs to the target user's valid permission set, the terminal device determines the leaf node as the target intent node; otherwise, the terminal device searches for candidate nodes with permissions for the target user in the leaf candidate set in descending order of fusion similarity, and determines the candidate node that satisfies the permission constraints and has the highest fusion similarity as the target intent node; if all candidate nodes in the leaf candidate set have no permissions, the terminal device returns a permission-unauthorized prompt message (e.g., "You do not have permission for this operation, please contact the administrator"). Thus, the intent matching result does not expand the original functional permission boundaries of the target user. It should be noted that the permission display name is only used for display and semantic enhancement; runtime verification prioritizes stable permission identifiers, permission IDs, or permission scopes.
[0103] In this embodiment, the terminal device first performs entity recognition and normalization on the natural language instructions, and then adopts a two-stage matching method of "hierarchical path coarse screening - leaf candidate set fine matching". It integrates the similarity of multiple dimensions such as path semantics, name keywords, entity parameters and interface descriptions, which can accurately locate the target user intent in traditional management systems containing a large number of controllers and interface endpoints, and alleviate the problem of insufficient semantic disambiguation of flat interface lists. At the same time, by first accepting the converged candidate set at the hierarchical level, the computational load of intent matching can be reduced, and intents that exceed the scope of system functions can be identified by setting a preset similarity threshold, avoiding erroneous calls.
[0104] Please refer to Figure 5 , Figure 5 The flowcharts of the lightweight AI agent access method for management systems provided in this application are illustrated in other embodiments.
[0105] like Figure 5 As shown, in some embodiments, the intent directory includes the intent path of the leaf permission record. The lightweight AI agent access method for management systems provided in this application embodiment may also include steps S501 to S503 as shown below.
[0106] Step S501: Extract the interface metadata bound to the leaf permission record from the interface document of the target management system.
[0107] It should be noted that the interface documentation can be the existing Swagger, OpenAPI, or Knife4j documentation of the target management system, or it can be controller annotations or service registration metadata.
[0108] The terminal device can automatically extract the corresponding interface metadata from the interface documentation of the target management system for each leaf permission record in the intent directory. In some embodiments, the interface metadata may include: interface address (e.g., determined by annotations such as @RequestMapping, @GetMapping / @PostMapping, e.g., / iot / v1 / device / {deviceCode} / detail), request method (e.g., GET, POST, PUT, DELETE), request parameters (e.g., determined by annotations such as @RequestParam, @PathVariable, @RequestBody and parameter types), and response structure (e.g., a unified response wrapper object JsonResult). <t>and generic data types, such as JsonResult <devicedetailvo>The following are required: interface description (such as Swagger @ApiOperation annotation or method description automatically generated by Knife4j), operation identifier (such as OpenAPIoperationId or controller method name, such as getDeviceDetail), runtime required permission identifier (such as permission table permission identifier, permission annotation value or resource key, such as iot:device:detail:view), and operation risk level inferred based on request method, interface tag and permission type (such as READ).
[0109] For example, taking an IoT device management platform as an example, for the controller method `getDeviceDetail` annotated with `@RequiresPermissions("iot:device:detail:view")` and `@GetMapping(" / {deviceCode} / detail")`, the interface metadata extracted by the terminal device may include: interface address ` / iot / v1 / device / {deviceCode} / detail`, request method `GET`, request parameter `deviceCode` (string type, path parameter, required), and response structure `JsonResult`. <devicedetailvo>The permission display name is "Get Device Details", the permission identifier is iot:device:detail:view, the runtime required permission identifier is iot:device:detail:view, the operation identifier is getDeviceDetail, the intent identifier is 1.10.101, the intent path is "Device Management > Device List > Get Device Details", and the risk level is READ.
[0110] Step S502: Generate a tool name based on the intent path of the leaf permission record, and combine the tool name, the intent path and the interface description in the interface metadata to generate tool description information.
[0111] After extracting the interface metadata, the terminal device can automatically convert each piece of interface metadata into tool description information (such as a Tool Schema in JSON Schema format) required by the intelligent agent function calling mechanism.
[0112] In some embodiments, the terminal device can use camelCase concatenation of the intent path to generate the tool name, ensuring that the tool name is unique and semantically clear. For example, the tool name corresponding to the intent path "Device Management > Device List > Get Device Details" could be deviceManagement_deviceList_getDeviceDetail.
[0113] In some embodiments, the terminal device may combine intent path and interface description to generate a tool description.
[0114] For example, the tool description could be: "Device Management > Device List > Get Device Details. Retrieves detailed information for a specified device, returning basic device information, network status, associated products, etc."
[0115] In some embodiments, the terminal device can map the programming language type of the request parameters to a structured data type, thereby generating the parameter description in the tool description information.
[0116] For example, the string type can be mapped to {"type": "string"}; the integer type (Integer / int) can be mapped to {"type": "integer"}; the long integer type (Long / long) can be mapped to {"type": "integer", "format": "int64"}; the floating-point type (Double / double) can be mapped to {"type": "number"}; the boolean type (Boolean / boolean) can be mapped to {"type": "boolean"}; the date and time type (Date / LocalDateTime) can be mapped to {"type": "string", "format": "date-time"}; and the collection type (List) can be mapped to {"type": "string", "format": "date-time"}. <t>) can be mapped to {"type": "array", "items": {...}}; custom object types can be mapped to {"type": "object", "properties": {...}}.
[0117] Step S503: Embed the permission identifier of the leaf permission record as the target permission identifier into the metadata field of the tool description information.
[0118] When generating tool description information, the terminal device can also embed the original permission check identifier of the target management system into the metadata field of the tool description information for subsequent permission-aware routing. For example, the metadata field of the tool description information may include intent identifier, permission display name, permission identifier, runtime required permission identifier, interface address, request method, operation identifier, intent path, and risk level, etc.
[0119] For example, the metadata fields of the tool description information corresponding to "Get Device Details" may include: intent identifier 1.10.101, permission display name "Get Device Details", permission identifier iot:device:detail:view, runtime required permission identifier iot:device:detail:view, interface address / iot / v1 / device / {deviceCode} / detail, request method GET, operation identifier getDeviceDetail, intent path "Device Management > Device List > Get Device Details", and risk level READ.
[0120] In this embodiment, the terminal device automatically extracts interface metadata, generates tool names and tool descriptions based on intent paths, and embeds permission identifiers into the metadata fields of the tool description information. This allows the permission-bound interfaces to be automatically orchestrated into tools that can be called by the agent, ensuring that the generated tool descriptions are stably bound to the original system permission identifiers. This enables the original RBAC verification link to be inherited at runtime, while also allowing the agent tools to clearly correspond to the menu paths, permission identifiers, and audit entry points of the original system.
[0121] Please refer to Figure 6 , Figure 6 The following is a flowchart illustrating the steps of the lightweight AI agent access method for management systems provided in this application.
[0122] like Figure 6 As shown, in some embodiments, the lightweight AI agent access method for management systems provided in this application may further include steps S601 to S603 as shown below.
[0123] Step S601: Recover the effective permission set of the target user based on the session identifier of the target user, and detect whether the target permission identifier corresponding to the target intent node belongs to the effective permission set.
[0124] When an agent initiates a tool call request, the terminal device can obtain the target user's session identifier (such as session ID, JWT, or access token) carried in the tool call request, and recover the target user's user object (such as PlainUserVO, which includes a list of roles and a list of permissions under each role) from the session or authentication service based on the session identifier. Then, it can extract the target user's set of valid permissions, that is, the set of permission identifiers that the target user has in an enabled state.
[0125] For example, taking an IoT device management platform using Apache Shiro as an example, the effective permission set can be loaded when the user logs in using the CustomRealm.doGetAuthorizationInfo() method, and stored in the HTTP session and Redis. The format is a nested object of user-role-permission. The permission-aware proxy layer can obtain the current user and its role permission information through SessionContext.getSessionAttr(CURRENT_LOGIN_USER).
[0126] Furthermore, the terminal device can detect whether the target permission identifier corresponding to the target intent node belongs to the valid permission set. For example, the terminal device can use the permission identifier of the permission record being equal to the runtime required permission identifier in the tool description information and the permission record being enabled as the priority matching condition, that is, to check whether there is a permission record that satisfies permission.permissionCode == tool.requiredPermission and permission.status == 1; if it exists and the target user's session is valid, the terminal device determines that the call permission is granted; otherwise, it determines that there is no call permission.
[0127] In some embodiments, when the target management system does not yet provide a stable permission code, the terminal device can generate a mapping table using permission ID, resource key, or permission annotation value to avoid using a variable Chinese display name as the sole basis for authorization.
[0128] In some embodiments, the terminal device can recover the target user's valid permission set based on the target user's session identifier through a permission-aware proxy layer deployed between the tool and the target interface, and detect whether the target permission identifier corresponding to the target intent node belongs to the valid permission set. Here, the permission-aware proxy layer is mainly used to ensure that tool calls inherit the existing security links of the target management system in terms of functional permissions, user sessions, data permissions, and audit logs.
[0129] Step S602: In response to the target permission identifier not belonging to the valid permission set, return permission denial information and terminate tool invocation.
[0130] If the terminal device detects that the target permission identifier does not belong to the valid permission set, it can return a permission denial message and terminate the tool call before initiating the interface request. In this case, the target interface call will not occur. Thus, for any target user and any tool, if the target user does not have the stable permission identifier corresponding to the tool, the target user's call to the tool through the agent will inevitably fail, and the agent path will not form an unauthorized call that bypasses the original RBAC function permissions.
[0131] Step S603: Unpack the encapsulated response returned by the target interface to obtain the data fields in the encapsulated response as the interface return result.
[0132] After the terminal device confirms the call permission, it can construct an HTTP request to call the target interface with the target user's original credentials, instead of using a system-level token that bypasses the user boundary to replace the user token. After receiving the request, the target interface continues to execute its existing data permissions, tenant permissions, field permissions and business verification logic (such as department data scope, merchant / store scope, data only for the user, field anonymization, etc.), thereby avoiding the risk of "functional permissions being granted but data scope being expanded".
[0133] Afterwards, the terminal device can obtain the encapsulated response returned by the target interface (such as JsonResult). <t>The system then unpacks the encapsulated response and extracts the data fields (such as the data field) from the encapsulated response as the interface return result to the agent.
[0134] In some embodiments, for target management systems using the OAuth 2.0 / OIDC authentication system, the terminal device can instead verify whether the scope of permissions carried in the access token includes the stable permission identifier required by the target tool, thereby achieving standardized permission inheritance.
[0135] In some embodiments, for target management systems without unified session management, terminal devices can adopt a pre-invocation check mode. That is, before each tool call, the terminal device sends a synchronous verification request to the target management system's permission verification endpoint (such as GET / api / auth / check-permission?permissionCode=xxx) with the target user's credentials, and determines the call permission based on the allow or deny result returned by the target management system. Although this method adds one interface round trip, it does not require any modification to the target management system's code.
[0136] In some embodiments, the terminal device may also record each operation call initiated by the agent to the operation log table (such as the sys_operation_log table) of the target management system or a separate AI audit log. The audit log may include user information (user ID, username), call source marker (such as marked as AI_AGENT), original intent text, matched intent path, call parameters, interface address, terminal device IP, call time, call result (success or failure), risk level and permission identifier, so that the agent call chain inherits the audit entry point of the original system.
[0137] In this embodiment, a permission-aware proxy layer is inserted between the tool and the target interface by the terminal device. Each time the tool is called, the valid permission set is restored based on the target user's session identifier and the call permission is verified. If the verification fails, the call is directly rejected. If the verification passes, the target interface is still called with the target user's original credentials. This can keep the functional permissions, data permissions and audit links continuous, fundamentally avoiding unauthorized access by intelligent agents. At the same time, there is no need to maintain a set of intelligent agent permission policies in addition to the original system permission policies, which ensures the consistency of permission standards.
[0138] Please refer to Figure 7 , Figure 7 The following is a flowchart illustrating the steps of the lightweight AI agent access method for management systems provided in this application.
[0139] like Figure 7 As shown, in some embodiments, the lightweight AI agent access method for management systems provided in this application may further include steps S701 to S703 as shown below.
[0140] Step S701: In response to the risk level of the operation corresponding to the target intent node being a preset high-risk level, parameter echo information is generated based on the call parameters of the call request of the target interface; the call request is constructed based on the user credentials and is used to ensure that the existing data permission verification logic of the target interface continues to be effective based on the user credentials.
[0141] It should be noted that the preset high-risk levels can include the risk levels of operations such as WRITE, EXPORT, DELETE, and CONTROL.
[0142] If the risk level of the operation corresponding to the target intent node is a preset high-risk level, the terminal device can generate parameter echo information based on the call parameters of the call request before executing the call request, so that the target user can check the operation content to be executed.
[0143] Step S702: In response to receiving the confirmation instruction input by the target user based on the parameter echo information, execute the call request.
[0144] After receiving a confirmation instruction from the target user based on the parameter feedback information, the terminal device can execute a call request, that is, call the target interface using the target user's user credentials. In some embodiments, the terminal device can also trigger an existing approval process in the target management system after receiving the confirmation instruction, and execute the call request after the approval process is completed.
[0145] Step S703: In response to the encapsulated response returned by the target interface indicating that the target interface call failed, the response code in the encapsulated response and the error information corresponding to the response code are converted into a natural language description, and a response information to the natural language instruction is generated based on the natural language description.
[0146] When the terminal device processes the encapsulated response returned by the target interface, if the response code in the encapsulated response indicates that the target interface call failed (e.g., the response code is not equal to 200), the terminal device can convert the response code and the corresponding error information into a natural language description, and then generate a response message to the natural language instruction based on the natural language description, so that the target user can understand the reason for the call failure.
[0147] In this embodiment, the terminal device generates parameter feedback information before executing operations belonging to the preset high-risk level, and requires the target user to confirm again or trigger the original system approval process. This can form a human check on high-risk operations such as writing, exporting, deleting, and controlling, and prevent the intelligent agent from accidentally executing high-risk operations. At the same time, the terminal device converts the response code and error information of interface call failure into natural language description, which can improve the understandability of response information in abnormal scenarios and improve the interactive experience.
[0148] Next, a complete embodiment of the lightweight AI agent access method for management systems provided in this application is presented.
[0149] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the overall system architecture involved in the lightweight AI agent access method for management systems provided in the embodiments of this application.
[0150] like Figure 8 As shown, in some embodiments, the lightweight AI agent access method for management systems provided in this application, when performing secure access of lightweight AI agents to traditional management systems, has an overall technical architecture divided into an input layer, a processing layer, and an output layer. The processing layer includes module one, module two, and module three. Wherein: The input layer provides three types of raw input to the processing layer: permission data tables in the permission database (permission table), API documentation in Swagger / OpenAPI format, and controller code with permission annotations.
[0151] Module 1 is directory structure parsing and intent directory construction: First, the permission table is read and a permission directory tree is built; then, an IntentNode list is generated, and an IntentDirectory mapping table is further built to complete the transformation from permission table to permission tree to IntentNode to IntentDirectory. The output result is used as the input for Module 2.
[0152] Module 2 is for permission interface orchestration and AI tool generation: extract the application interface (API) metadata bound to the leaf nodes of IntentDirectory, generate the tool schema; embed permission metadata such as requiredPermission and permissionCode into the tool schema, complete the registration of the permission-aware proxy layer, and output to Module 3.
[0153] Module 3 is Natural Language Intent Matching and Permission-Aware Routing: First, user input preprocessing is performed, intent matching is carried out, and then permission filtering is performed; proxy calls and result returns are completed, and audit logs are generated synchronously, realizing the processing chain of user input → preprocessing → matching → filtering → call → return.
[0154] The output layer obtains a permission-aware toolset. The AI agent (LLM Agent with Function Calling) calls this toolset to perform business processing and returns the results to the end user, completing natural language interaction. The permission directory tree and application programming interface (API) metadata of the traditional management system are processed through a three-module pipeline to finally obtain a permission-aware toolset that can be securely called by the AI agent, completing lightweight access.
[0155] Please refer to Figure 9 , Figure 9 This is a schematic diagram illustrating the intent catalog construction process involved in the lightweight AI agent access method for management systems provided in this application embodiment.
[0156] like Figure 9 As shown, in some embodiments, the lightweight AI agent access method for management systems provided in this application can automatically generate an intent directory from a permission table, and the specific execution steps include steps 1 to 8 as shown below.
[0157] Step 1: Read all records in the permission table, including the fields id, parentId, name, type, and status.
[0158] Step 2: Group all the records read according to parentId.
[0159] Step 3: Starting from the root node with parentId=0, recursively construct the permission tree.
[0160] Step 4: Generate a complete path for each node in the permission tree. For example, the path format is Device Management > Device List > Get Device Details.
[0161] Step 5: Generate intentId for the leaf nodes of the permission tree. For example, the intentId value is 1.10.101.
[0162] Step 6: Associate the application programming interface (API) metadata with the leaf nodes. The associated metadata includes apiEndpoint, httpMethod, requestParams, responseSchema, and permissionCode.
[0163] Step 7: Generate an IntentNode node, which carries the fields id, name, type, path, apiEndpoint, httpMethod, permissionCode, and children.
[0164] Step 8: Construct an IntentDirectory mapping table from intentId to IntentNode, using intentId as the key and IntentNode as the value.
[0165] It should be noted that after the above overall process is completed, two types of results are output: the original permission directory tree is retained, and an IntentDirectory mapping table is generated. This process fully realizes the automated conversion from the original permission data table to the intent directory. The output intent directory can be used as input for downstream permission interface orchestration and AI tool generation, providing a directory foundation for AI agents to realize permission-aware invocation.
[0166] Please refer to Figure 10 , Figure 10 This is a schematic diagram of the secure call chain involving permission inheritance in the lightweight AI agent access method for management systems provided in this application embodiment.
[0167] like Figure 10 As shown, in some embodiments, the lightweight AI agent access method for management systems provided in this application includes end users, intent matching modules, IntentDirectory, permission filtering modules, user sessions / permission sets, permission-aware proxy layers, original API interfaces, and AI agents in the secure call chain based on permission inheritance. The entire chain has three verification checkpoints to ensure call security. Therefore, the implementation process based on this secure call chain includes the following steps: Step 1: The end user inputs natural language commands; Step 2: The intent matching module queries the IntentDirectory for candidate intent nodes; Step 3: IntentDirectory returns the BestNode to the intent matching module; checkpoint A performs intent matching verification to confirm the function entry point corresponding to the user's needs; Step 4: The intent matching module submits the matching results to the permission filtering module; Step 5: The permission filtering module reads the current user's permissions; Step 6: Return to the user permission set; Checkpoint B completes permission verification, confirming that the current user has the target operation permission; if no permission is granted or the session is invalid, return a denial message directly to the end user, and the process terminates; After successful verification, proceed to step ⑦: The permission filtering module initiates a tool call to the permission-aware proxy layer; checkpoint C confirms the validity of the session token during the API call phase and performs the operation as the user. Step 8: The permission-aware proxy layer calls the original API interface carrying the current user session token; Step 9: The original API interface returns a JsonResult. <t>result; Step 10: The permission-aware proxy layer unpacks the data and returns the data field to the AI agent; step The AI agent processes the data and returns the natural language results to the end user.
[0168] It should be noted that the above-mentioned link, through three levels of checkpoint constraints, can ensure that the AI agent's calling capabilities are always constrained by the current user's existing permissions, thus achieving secure calling under permission inheritance.
[0169] Please refer to Figure 11 , Figure 11 This is a schematic diagram illustrating the three-dimensional semantic similarity calculation of intent matching involved in the lightweight AI agent access method for management systems provided in this application embodiment.
[0170] like Figure 11 As shown in some embodiments, the three-dimensional semantic similarity calculation process for intent matching in the lightweight AI agent access method for management systems provided in this application is divided into three stages: user input preprocessing, candidate node three-dimensional similarity calculation, and final result selection.
[0171] The first stage is user input preprocessing: receiving the user's original input text, for example, "Please help me see the details of device SN-20250601"; performing entity recognition and intent normalization, extracting the entity to obtain deviceCode=SN-20250601, and generating the normalized text: "Please help me see the details of device {deviceCode}".
[0172] The second stage involves calculating the three-dimensional similarity of candidate nodes. For each candidate node within the intent directory, the semantic similarity S_path, keyword overlap S_keyword, and entity parameter matching S_param are calculated. The overall similarity (Similarity (Q',node)) is then calculated using the formula Similarity(Q',node)=α1×S_path+α2×S_keyword+α3×S_param, where the recommendation weights are α1=0.5, α2=0.3, and α3=0.2. For example, the candidate node "Device Management > Device List > Get Device Details" has scores of 0.93, 0.80, and 1.00 for the three items, resulting in an overall score of 0.90. The corresponding overall scores are calculated for the remaining candidate nodes.
[0173] The third stage involves final result selection, choosing the item with the highest overall score as the best matching result, BestNode. For example, BestNode is "Device Management > Device List > Get Device Details", with an intentId of 1.10.101 and the parameter deviceCode=SN-20250601. After node location is completed, the process moves to permission filtering and tool invocation.
[0174] It should be noted that the above three-dimensional similarity fusion calculation can locate the optimal executable node from the intent directory, providing a matching basis for subsequent secure calls.
[0175] This application also provides a lightweight AI agent access system for management systems. The lightweight AI agent access system for management systems provided in this application can be applied to terminal devices to implement the above-mentioned lightweight AI agent access method for management systems.
[0176] In some embodiments, the lightweight AI agent access system for management systems provided in this application may include: The acquisition module is used to acquire permission resource data of the target management system; the permission resource data includes multiple permission records; The directory tree construction module is used to construct a permission directory tree based on the hierarchical association information of the multiple permission records, and to generate an intent directory based on the leaf permission records in the permission directory tree whose permission type is operation interface; The intent matching module is used to match the natural language instructions input by the target user with the intent directory to obtain the target intent node; The interface invocation module is used to respond to the target permission identifier corresponding to the target intent node belonging to the valid permission set of the target user, to invoke the tool based on the tool description information corresponding to the target intent node, and to invoke the target interface corresponding to the target intent node based on the user credentials of the target user, and to obtain the interface return result; the tool description information is generated based on the interface metadata bound to the leaf permission record in the intent directory; The instruction response module is used to generate response information for the natural language instruction based on the result returned by the interface.
[0177] In some embodiments, the directory tree construction module is further configured to, in response to the hierarchical association information of the first permission record indicating that the target permission record is a permission record without a parent, take the first permission record as the root node; the first permission record is any one or more of the plurality of permission records; group the second permission record according to the hierarchical association information of the second permission record and recursively construct child nodes to obtain a permission directory tree; the second permission record is other permission records among the plurality of permission records besides the first permission record.
[0178] In some embodiments, the directory tree construction module is further configured to obtain path information and intent identifiers of leaf permission records with permission type "operation interface" in the permission directory tree; the path information is obtained by concatenating the display names of permission records at all levels from the root node to the node where the leaf permission record is located in hierarchical order, and the intent identifier is obtained by concatenating the unique identifiers of the permission records at all levels in hierarchical order; semantic expansion is performed based on the path information and display names of the leaf permission records to obtain extended description information of the leaf permission records; an intent mapping table for the leaf permission records is constructed using the intent identifier of the leaf permission records as the key and the node information of the leaf permission records containing extended description information and hierarchical priors as the value, and the intent mapping table and the permission directory tree are used as the intent directory; the hierarchical priors are set based on the node type of the node where the leaf permission record is located, and the node type includes directory nodes, menu nodes, and operation interface nodes, wherein the hierarchical priors of the directory nodes are lower than the hierarchical priors of the menu nodes, and the hierarchical priors of the menu nodes are lower than the hierarchical priors of the operation interface nodes.
[0179] In some embodiments, the intent matching module is further configured to acquire natural language instructions input by the target user and generate normalized intent text based on the natural language instructions; based on the semantic matching results of the normalized intent text and the path information of each node in the intent directory, and the hierarchical prior of each node in the intent directory, perform coarse screening on the nodes in the intent directory to obtain candidate path nodes; determine the leaf nodes with permission type of operation interface and in the enabled state in the subtree corresponding to the candidate path nodes in the permission directory tree as the leaf candidate set; and determine the target intent node from the leaf candidate set based on the multidimensional semantic similarity between the normalized intent text and each leaf node in the leaf candidate set.
[0180] In some embodiments, the intent directory includes the intent path of the leaf permission record, an interface call module, and is further configured to extract the interface metadata bound to the leaf permission record from the interface document of the target management system; generate a tool name based on the intent path of the leaf permission record, and combine the tool name, the intent path, and the interface description in the interface metadata to generate tool description information; and embed the permission identifier of the leaf permission record as the target permission identifier into the metadata field of the tool description information.
[0181] In some embodiments, the interface invocation module is further configured to recover the effective permission set of the target user based on the session identifier of the target user, and detect whether the target permission identifier corresponding to the target intent node belongs to the effective permission set; in response to the target permission identifier not belonging to the effective permission set, return permission denial information and terminate the tool invocation; and unpack the encapsulated response returned by the target interface to obtain the data field in the encapsulated response as the interface return result.
[0182] In some embodiments, the interface invocation module is further configured to, in response to the risk level of the operation corresponding to the target intent node being a preset high-risk level, generate parameter echo information based on the invocation parameters of the invocation request of the target interface; the invocation request is constructed based on the user credentials and is used to enable the existing data permission verification logic of the target interface to continue to be effective based on the user credentials; and execute the invocation request in response to receiving a confirmation instruction input by the target user based on the parameter echo information. The instruction response module is further configured to, in response to the encapsulated response returned by the target interface indicating that the target interface call failed, convert the response code in the encapsulated response and the error information corresponding to the response code into a natural language description, and generate response information to the natural language instruction based on the natural language description.
[0183] It should be noted that the specific implementation of the lightweight AI agent access system for management systems provided in this application is basically the same as the specific implementation of the lightweight AI agent access method for management systems applied to the server and client respectively, and will not be repeated here.
[0184] Please see Figure 12 This application also provides an electronic device that can be applied to the above-described lightweight AI agent access method for management systems. The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described lightweight AI agent access method for management systems.
[0185] In some embodiments, the electronic device may be a smartphone, tablet, laptop, desktop computer, or other electronic device.
[0186] like Figure 12 As shown, the electronic device provided in this application embodiment may include: The processor 1201 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 1202 can be implemented in the form of read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1202 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1202 and is called and executed by the processor 1201 to implement the lightweight artificial intelligence agent access method for management systems according to the embodiments of this application. The input / output interface 1203 is used to implement information input and output; The communication interface 1204 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1205 transmits information between various components of the device (e.g., processor 1201, memory 1202, input / output interface 1203, and communication interface 1204); The processor 1201, memory 1202, input / output interface 1203 and communication interface 1204 are connected to each other within the device via bus 1205.
[0187] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned lightweight AI agent access method for management systems.
[0188] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0189] This application also provides a computer program product, including a computer program. The steps implemented by the computer program when executed by a processor are basically the same as those in the specific embodiments of the lightweight artificial intelligence agent access method for management systems described above, and will not be repeated here.
[0190] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of this application, and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
[0191] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0192] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0193] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0194] The terms "first," "second," "third," "fourth," etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0195] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally represents the former factor divided by the latter factor, or indicates that the related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0196] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.
[0197] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0198] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0199] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to conventional technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0200] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.< / t> < / t> < / t> < / devicedetailvo> < / devicedetailvo> < / t>
Claims
1. A lightweight AI agent access method for management systems, characterized in that, The method includes: Obtain the permission resource data of the target management system; the permission resource data includes multiple permission records; A permission directory tree is constructed based on the hierarchical association information of the multiple permission records, and an intent directory is generated based on the leaf permission records in the permission directory tree whose permission type is operation interface. The natural language commands input by the target user are matched with the intent directory to obtain the target intent node; In response to the target permission identifier corresponding to the target intent node belonging to the valid permission set of the target user, a tool is invoked based on the tool description information corresponding to the target intent node, and the target interface corresponding to the target intent node is invoked based on the user credentials of the target user, and the interface return result is obtained; the tool description information is generated based on the interface metadata bound to the leaf permission record in the intent directory; Based on the results returned by the interface, a response message is generated for the natural language instruction.
2. The lightweight AI agent access method for management systems according to claim 1, characterized in that, The construction of the permission directory tree based on the hierarchical association information of the multiple permission records includes: In response to the hierarchical association information of the first permission record indicating that the target permission record is a permission record without a parent, the first permission record is taken as the root node; the first permission record is any one or more of the plurality of permission records; The second permission record is grouped according to the hierarchical association information of the second permission record and child nodes are recursively constructed to obtain the permission directory tree; the second permission record is the other permission record among the multiple permission records except the first permission record.
3. The lightweight AI agent access method for management systems according to claim 2, characterized in that, The generation of the intent directory based on the leaf permission records of the permission type "operation interface" in the permission directory tree includes: Obtain the path information and intent identifier of the leaf permission record with permission type "operation interface" in the permission directory tree; the path information is obtained by concatenating the display names of the permission records at all levels from the root node to the node where the leaf permission record is located in hierarchical order, and the intent identifier is obtained by concatenating the unique identifiers of the permission records at all levels in hierarchical order; Based on the path information and display name of the leaf permission record, semantic expansion is performed to obtain the extended description information of the leaf permission record; Using the intent identifier of the leaf permission record as the key and the node information containing extended description information and hierarchical priors in the leaf permission record as the value, an intent mapping table for the leaf permission record is constructed, and the intent mapping table and the permission directory tree are used as the intent directory; the hierarchical priors are set based on the node type of the node where the leaf permission record is located, and the node type includes directory nodes, menu nodes and operation interface nodes. The hierarchical priors of the directory nodes are lower than the hierarchical priors of the menu nodes, and the hierarchical priors of the menu nodes are lower than the hierarchical priors of the operation interface nodes.
4. The lightweight AI agent access method for management systems according to claim 1, characterized in that, The step of matching the natural language commands input by the target user with the intent directory to obtain the target intent node includes: Obtain natural language instructions input by the target user, and generate normalized intent text based on the natural language instructions; Based on the semantic matching results between the normalized intent text and the path information of each node in the intent directory, as well as the hierarchical priors of each node in the intent directory, the nodes in the intent directory are coarsely screened to obtain candidate path nodes. The leaf nodes in the subtree corresponding to the candidate path node in the permission directory tree, whose permission type is operation interface and are in the enabled state, are determined as the leaf candidate set. Based on the normalized intent text and the multidimensional semantic similarity between each leaf node in the leaf candidate set, the target intent node is determined from the leaf candidate set.
5. The lightweight AI agent access method for management systems according to claim 1, characterized in that, The intent directory includes the intent paths of the leaf permission records, and the method further includes: Extract the interface metadata bound to the leaf permission record from the interface document of the target management system; The tool name is generated based on the intent path of the leaf permission record, and the tool name, intent path and interface description in the interface metadata are combined to generate tool description information; The permission identifier of the leaf permission record is embedded as the target permission identifier into the metadata field of the tool description information.
6. The lightweight AI agent access method for management systems according to claim 1, characterized in that, The method further includes: Based on the target user's session identifier, the effective permission set of the target user is recovered, and it is detected whether the target permission identifier corresponding to the target intent node belongs to the effective permission set; In response to the fact that the target permission identifier does not belong to the set of valid permissions, a permission denial message is returned and the tool call is terminated; The encapsulated response returned by the target interface is unpacked to obtain the data fields in the encapsulated response as the interface return result.
7. The lightweight AI agent access method for management systems according to claim 1, characterized in that, The method further includes: In response to the risk level of the operation corresponding to the target intent node being a preset high-risk level, parameter echo information is generated based on the call parameters of the call request of the target interface; the call request is constructed based on the user credentials and is used to ensure that the existing data permission verification logic of the target interface continues to be effective based on the user credentials; Upon receiving a confirmation instruction from the target user based on the parameter echo information, the invocation request is executed; In response to the encapsulated response returned by the target interface indicating that the target interface call failed, the response code and the corresponding error information in the encapsulated response are converted into a natural language description, and a response message to the natural language instruction is generated based on the natural language description.
8. A lightweight artificial intelligence agent access system for management systems, characterized in that, The system includes: The acquisition module is used to acquire permission resource data of the target management system; the permission resource data includes multiple permission records; The directory tree construction module is used to construct a permission directory tree based on the hierarchical association information of the multiple permission records, and to generate an intent directory based on the leaf permission records in the permission directory tree whose permission type is operation interface; The intent matching module is used to match the natural language instructions input by the target user with the intent directory to obtain the target intent node; The interface invocation module is used to respond to the target permission identifier corresponding to the target intent node belonging to the valid permission set of the target user, to invoke the tool based on the tool description information corresponding to the target intent node, and to invoke the target interface corresponding to the target intent node based on the user credentials of the target user, and to obtain the interface return result; the tool description information is generated based on the interface metadata bound to the leaf permission record in the intent directory; The instruction response module is used to generate response information for the natural language instruction based on the result returned by the interface.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the lightweight artificial intelligence agent access method for management systems as described in claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the lightweight AI agent access method for management systems as described in claims 1 to 7.
