A cognitive content module plug and play method and system based on a standardized interface

CN122988162APending Publication Date: 2026-10-27DONGGUAN INTENT RESONANCE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611014469.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

在长对话场景中,早期注入的规则被大量对话历史掩盖,导致大模型的有效注意力资源被分散,规则约束力显著下降

Benefits of technology

[0021](1)架构解耦层:通过标准化程序接口实现认知内容模块与推理服务的物理解耦,区别于现有的MCP等工具调用协议,本发明专注于认知内容的分发,实现了认知能力的跨平台迁移。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122988162A_ABST
    Figure CN122988162A_ABST
Patent Text Reader

Abstract

The application discloses a cognitive content module plug-and-play method and system based on a standardized interface. The method encapsulates behavior rules, business knowledge, long-term memory and other cognitive content as independent modules through a cognitive content module middleware independent of a reasoning service deployment. In response to a preset trigger condition, the reasoning service obtains cognitive content encapsulated by the middleware in a server-side encapsulation structure through an interface, and maps and injects a logical isolation section of a context window. When a version identifier indicates that there is a change, the existing content is replaced with new content. The application enables the same type of cognitive content to retain only the latest version in the context window, and the space occupation does not accumulate with the dialogue round, the control is constant O(1), avoiding the attention distraction and context expansion caused by full splicing, realizing the physical decoupling of cognitive content and reasoning service, and guaranteeing the security and traceability through gateway side security completion and chain hash auditing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed system middleware technology, specifically to a cognitive content module middleware. This middleware provides cognitive content distribution services to the inference service through a standardized program interface, enabling cognitive content such as behavioral rules, business knowledge, and long-term memory to be integrated into the workflow of the inference service in a plug-and-play manner, thereby achieving physical decoupling between cognitive capabilities and the inference engine. Background Technology

[0002] Reasoning services (including dialogue systems, task execution systems, and agent workflows) need to continuously acquire external cognitive content during workflow execution to maintain the correctness and consistency of their behavior. This cognitive content includes behavioral rules, business knowledge, and long-term memory.

[0003] In existing technologies, the aforementioned cognitive content is typically written into the context window of the inference service all at once in the form of system prompts, or the retrieved fragments are directly concatenated into the context through retrieval enhancement generation. This architecture, which tightly couples cognitive content with the inference engine, has the following technical drawbacks:

[0004] 1. Dispersion of attentional resources and context expansion: Full concatenation causes the space occupied by cognitive content in the context window to increase linearly with the number of workflow nodes (space complexity O(N)). In long dialogue scenarios, rules injected early are masked by a large amount of dialogue history, resulting in the dispersion of effective attentional resources of the large model and a significant decrease in the binding force of rules.

[0005] 2. Tightly coupled architecture and blocked updates: The updating of cognitive content depends on the restart or configuration modification of the inference service. When the inference service is replaced, all access logic needs to be reimplemented.

[0006] 3. Lack of unified security intervention methods: Under the existing architecture, if it is necessary to forcibly inject security baseline rules, the prompt word assembly logic inside the inference service must be modified, and transparent interception and completion cannot be performed in the distribution link.

[0007] It should be noted that existing technologies already include middleware solutions that decouple the inference engine from the data source (such as data middleware based on database field mapping). Their core lies in solving the data format compatibility problem between different data sources, and their operation involves the inference engine actively querying the data source through the middleware. The cognitive content targeted by this invention is fundamentally different from the aforementioned data sources: the cognitive content is not the data record being queried, but rather content that needs to be actively injected into the inference service context window based on policy conditions to influence the generation behavior.

[0008] Furthermore, existing standardized protocols (such as the Model Context Protocol, MCP, etc.) mainly focus on tool invocation and external service integration. Their core mechanism is that the inference service sends instructions to external tools and receives execution results. The cognitive content module of this invention is fundamentally different from the above-mentioned tool invocation mechanism: the cognitive content module contains cognitive content used to constrain and guide the behavior of the inference service, rather than external tools used to perform specific operations; its returned content is injected into the context window of the inference service to affect subsequent generation behavior, rather than being directly output as the result of tool invocation.

[0009] Therefore, a standardized cognitive content access architecture that is independent of inference service deployment is needed to solve the problems of context resource waste and architectural coupling through technical means. Summary of the Invention

[0010] The core concept of this invention lies in providing a cognitive content module middleware that is independent of the inference service deployment. This middleware encapsulates cognitive content as an independent "cognitive content module," which connects to the inference service through a standardized program interface. The inference service and the cognitive content module are decoupled through a protocol, making them independent and allowing for separate deployment and updates.

[0011] The present invention adopts the following technical solution:

[0012] A plug-and-play method for cognitive content modules based on standardized interfaces, applied to a distributed system containing inference services and cognitive content module middleware, includes the following steps:

[0013] Step 1: Provide a cognitive content module middleware that is independent of the inference service deployment. The middleware stores a collection of cognitive content and maintains a version identifier for each piece of cognitive content.

[0014] Step 2: In response to the preset triggering condition for refreshing cognitive content, the inference service sends a request carrying a content type identifier to the middleware through a standardized program interface;

[0015] Step 3: In response to the request, the middleware extracts the corresponding cognitive content subset, encapsulates the cognitive content subset with structured tags on the server side, and returns it to the reasoning service in the form of structured data.

[0016] Step 4: The reasoning service parses the structured tags and maps the subset of cognitive content to the logically isolated section in the context window corresponding to the structured tags;

[0017] Step 5: When the version identifier indicates that the cognitive content subset has changed compared to the existing content in the logical isolation segment, the existing content is overwritten and replaced by the cognitive content subset; otherwise, the existing content is maintained.

[0018] In one possible implementation, the cognitive content module middleware also supports automatic completion on the security module gateway side, chained hash audit storage, incremental retrieval, multi-tenant isolation, and offline fallback mechanism.

[0019] Beneficial effects

[0020] Compared with the prior art, the present invention has the following beneficial technical effects:

[0021] (1) Architecture decoupling layer: Physical decoupling of cognitive content module and reasoning service is achieved through standardized program interface. Unlike existing tool calling protocols such as MCP, this invention focuses on the distribution of cognitive content and realizes cross-platform migration of cognitive ability.

[0022] (2) Context Resource Management Layer (Core Technical Effect): Compared with the space complexity O(N) and attention dispersion caused by full splicing in existing technologies, this invention uses the "structured marking of logically isolated segments" and "version comparison and overwrite replacement" mechanisms to ensure that only the latest version of the same type of cognitive content is retained in the context window. Its space occupation does not accumulate with each dialogue round and is controlled to a constant level of O(1). The new version of cognitive content is only overwritten in place within the specified boundary, without polluting the business data area, fundamentally avoiding context expansion and attention decay in long dialogues.

[0023] (3) Security and audit layer: Through the gateway-side mandatory security completion mechanism, missing security rules are hard-coded into the middleware server and made transparent to the inference service; each distribution generates a chain hash audit log that is cryptographically bound to the distribution action to ensure the integrity and verifiability of the audit chain. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of the system architecture and data flow according to an embodiment of the present invention.

[0026] Figure 2 This is a schematic diagram of the context window logical isolation section structure according to an embodiment of the present invention.

[0027] Figure 3 This is a schematic diagram of the automatic completion process of the security module in an embodiment of the present invention.

[0028] Figure 4 This is a schematic diagram of the chained hash storage structure for audit logs according to an embodiment of the present invention. Detailed Implementation

[0030] The present invention will now be described in further detail with reference to the accompanying drawings.

[0031] The reasoning service described in this invention refers to a service that provides dialogue, task execution, or intelligent agent workflow operation capabilities, which may be implemented based on, but is not limited to, a large language model. The cognitive content module middleware communicates with the reasoning service through a standardized program interface. The middleware does not intrude on the internal logic of the reasoning service, nor does it modify the model parameters or reasoning process of the reasoning service.

[0032] Regarding the interface data contract: To achieve protocol-level decoupling, the standardized program interface has a strict data contract. The request message includes: tenant ID, content type identifier (e.g., rule / knowledge / memory), and current version number; the response message includes: update version number, incremental content body, and structured tag prefix. For example, the request message sent by the inference service is: {"tenant":"abc","content_type":"rule","current_version":"3.1"}, and the response message returned by the middleware is: {"new_version":"3.2","payload":" <cognitive-zone type="rule"> ...< / cognitive-zone> Through this strict message contract, the middleware acts as an independent service endpoint, distributing data to the inference service.

[0033] Example 1: Independently deployed middleware form and context section isolation and replacement mechanism.

[0034] This embodiment forms the core foundation of the present invention. The cognitive content module middleware is deployed independently of the inference service and includes a cognitive content storage unit. When the inference service needs to obtain cognitive content, it sends a request to the middleware through a standardized interface.

[0035] The middleware responds to the request and encapsulates the extracted cognitive content subset with structured markup on the server side. One specific implementation of this structured markup is using XML namespace syntax, for example: <cognitive-zone type="behavior" version="3.2"> ...< / cognitive-zone> .

[0036] The context window of the inference service is logically divided into a business data area (containing user dialogue history and tool call results) and a cognitive content isolation area. When the inference service receives a message returned by the middleware, it parses the namespace prefix and maps the cognitive content subset to the specified logical isolation segment of the context window.

[0037] When the version identifier indicates a change, the inference service only performs an overwrite operation within the bounds of that identifier, replacing the existing content with the new content without affecting the business data area. This technique ensures that only the latest version of the same type of cognitive content is retained in the context window, and its space usage does not accumulate with each dialogue round, remaining at a constant level of O(1), thus avoiding the waste of token computing resources and attention distraction caused by full concatenation. It should be noted that the above XML namespace syntax is only used to illustrate one possible implementation method and does not constitute a specific limitation on the tag format or protocol.

[0038] Example 2: Reverse control flow based on middleware-side event listening.

[0039] This embodiment introduces an event-triggered dynamic distribution mechanism. Existing technologies (such as RAG) mostly rely on the inference engine to actively query, while this invention adopts a reverse control flow: the event listener is deployed on the middleware side of the cognitive content module, and receives workflow node transition events, dialogue round count events, and user input parsing events from the inference service through a standardized program interface.

[0040] The preset triggering conditions include, but are not limited to: the number of dialogue rounds reaching a preset threshold, the workflow transitioning to a specific node, the system time reaching a preset timeout, and the user's text input matching preset semantic features. When the middleware-side event listener captures the above preset triggering conditions, it triggers the inference service to send a retrieval request. This reverse control flow mechanism, where the inference service initiates requests driven by the middleware-side event listener, enables the periodic refreshing and on-demand updating of cognitive content in long dialogues.

[0041] Example 3: Automatic completion mechanism on the gateway side of the security module.

[0042] This embodiment demonstrates the gateway-side security intervention capabilities of the middleware. The middleware is pre-configured with a set of core security awareness content (including out-of-bounds denial rules, privacy protection rules, etc.).

[0043] When the subset of cognitive content requested by the inference service does not include all content in the core security cognitive content set, the middleware, during the message assembly stage before returning the response, inserts the missing core security cognitive content into a designated position in the response message using structured tags. After completion, the complete subset is returned to the inference service. This completion operation is performed before the interface response and is transparent to the inference service—the inference service does not need to be aware of the completion process, nor does it need to modify its internal parsing logic; it passively receives the data. Regardless of the cognitive content requested by the caller, the core security cognitive content is always forcibly included.

[0044] Example 4: Incremental fetching mechanism.

[0045] The middleware's storage unit maintains an update timestamp for each piece of cognitive content. The request message for the inference service carries the "last access time." When extracting a subset of cognitive content, the middleware only filters and returns cognitive content entries that have changed since that time. In long-term use cases, the amount of data from full access grows linearly with the interaction history, while the incremental retrieval mechanism always keeps the amount of data injected in a single instance to a minimum, further reducing context burden and network transmission costs.

[0046] Example 5: Chained hash storage mechanism for audit records.

[0047] When the cognitive content module middleware returns the cognitive content subset to the inference service, the middleware records the distribution behavior and generates an audit log. To avoid being identified as a general logging technique, the audit log of this invention forcibly includes a structured marker prefix, version identifier, and triggering reason for this distribution, realizing a cryptographic binding between the audit log and the context segment overwriting behavior. The audit log uses chained hash storage: for each new record generated, the system extracts the hash value of the previous record and includes it in the current record, and calculates the hash value of the current record as a whole. Any tampering with a single historical audit log will cause its own hash value to change, thereby causing the pre-hash verification of all subsequent records to fail, satisfying the non-repudiation requirements under strong regulatory scenarios.

[0048] Example 6: Offline fallback mechanism.

[0049] When the interface is available, the cognitive content module middleware periodically pushes the cognitive content from the cognitive content storage unit to the local cache of the inference service in the form of offline packages. When the standardized program interface is unavailable (e.g., due to network interruption or service crash), the inference service loads the locally pre-stored offline cognitive content packages, which have the same version identifier as the content in the middleware. After the interface is restored, the system automatically switches back to online mode to ensure service continuity under extreme network conditions.

[0050] Based on the description in this specification and in conjunction with well-known technologies in the field of distributed system middleware, those skilled in the art can implement the technical solution of this invention without creative effort.

Claims

1. A plug-and-play method for cognitive content modules based on standardized interfaces, applied to a distributed system containing inference services and cognitive content module middleware, characterized in that, Includes the following steps: Provide a cognitive content module middleware that is independent of the inference service deployment. The middleware includes a cognitive content storage unit that stores a collection of cognitive content and maintains a version identifier for each piece of cognitive content. In response to a preset trigger condition for refreshing cognitive content, the inference service sends a request carrying a content type identifier to the cognitive content module middleware through a standardized program interface. In response to the request, the cognitive content module middleware extracts the corresponding cognitive content subset from the cognitive content storage unit according to the content type identifier, encapsulates the cognitive content subset with structured tags on the server side, and returns it to the inference service in the form of structured data. The reasoning service parses the structured tags and maps the subset of cognitive content to logically isolated sections in the context window corresponding to the structured tags; When the version identifier indicates that the cognitive content subset has changed compared to the existing content in the logical isolation segment, the existing content is overwritten and replaced by the cognitive content subset; otherwise, the existing content is maintained.

2. The method according to claim 1, characterized in that, The preset triggering conditions are captured by an event listener deployed on the middleware side of the cognitive content module: The event listener receives workflow node transition events, dialogue round count events, or user input parsing events from the inference service through the standardized program interface. When the event listener detects the preset triggering condition, it triggers the inference service to send the acquisition request.

3. The method according to claim 1, characterized in that, The cognitive content module middleware also includes an auto-completion mechanism on the security module gateway side: The middleware maintains a pre-defined set of core security knowledge content; After extracting the corresponding subset of cognitive content, the middleware verifies whether the subset of cognitive content contains all the content in the core security cognitive content set. If not all content is included, the middleware will insert the missing core security knowledge content into the specified position of the response message in the form of structured tags during the message assembly stage before returning the response. After the completion is completed, the complete subset will be returned to the inference service. The completion operation is transparent to the inference service.

4. The method according to claim 1, characterized in that, The cognitive content storage unit maintains and updates a timestamp for each piece of cognitive content, and the retrieval request carries the last access time. When the middleware extracts the corresponding cognitive content subset, it supports incremental retrieval: only cognitive content that has changed since the last access time is returned.

5. The method according to claim 1, characterized in that, The method also includes chained hash storage of audit logs: When the cognitive content module middleware returns the cognitive content subset to the inference service, the middleware generates an audit record containing a timestamp, a structured tag prefix, a version identifier, and a trigger reason; Each audit record contains the hash value of the previous record. Any tampering with a single record will cause the hash verification of all subsequent records to fail.

6. The method according to claim 1, characterized in that, The cognitive content module middleware adopts a multi-tenant isolation architecture: the cognitive content of different tenants is stored in logically isolated storage areas, and the data between tenants cannot be accessed by each other; the acquisition request carries the tenant identifier, and the middleware only extracts cognitive content from the storage area of ​​the corresponding tenant.

7. The method according to claim 1, characterized in that, The cognitive content module middleware also includes an offline fallback mechanism: when the standardized program interface is unavailable, the inference service loads a locally pre-stored offline cognitive content package, and the offline cognitive content package has the same version identifier as the corresponding cognitive content in the cognitive content storage unit.

8. The method according to any one of claims 1 to 7, characterized in that, The structured markup uses XML namespace syntax. The reasoning service maps the cognitive content subset to a specified logically isolated section of the context window by recognizing the namespace prefix. The sections carrying business data use different namespace identifiers, and the two sections do not overlap in the context window.

9. A plug-and-play system for cognitive content modules, characterized in that, include: The cognitive content module middleware is deployed independently of the inference service and includes a cognitive content storage unit. The cognitive content storage unit stores a collection of cognitive content and maintains a version identifier for each piece of cognitive content. The interface communication module is configured to respond to a preset trigger condition for refreshing cognitive content. The inference service sends a request carrying a content type identifier to the cognitive content module middleware through a standardized program interface. The content extraction and encapsulation module is configured to, in response to the request, extract the corresponding cognitive content subset, encapsulate the cognitive content subset with structured tags on the server side, and return it to the reasoning service in the form of structured data; The injection replacement module is configured to parse the structured tags for the inference service, map the cognitive content subset to the logical isolation section corresponding to the structured tags in the context window, and, based on the version identifier, indicate whether the cognitive content subset has changed compared to the existing content in the logical isolation section, decide whether to overwrite or replace the existing content with the cognitive content subset or maintain the existing content.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method according to any one of claims 1 to 8.