A distributed AI man-machine collaborative work system and method based on IM encapsulation and P2P virtual networking

By using the IM protocol as the agent scheduling bus and P2P virtual networking, combined with the native Rust architecture and VM+Docker isolation, the bottlenecks and security issues of centralized collaboration platforms are solved, enabling cross-platform collaboration and business expansion, and improving collaboration efficiency and security.

CN122437753APending Publication Date: 2026-07-21范泽武

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
范泽武
Filing Date
2026-05-07
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing collaborative platforms suffer from single points of failure due to centralized architecture, bandwidth bottlenecks, privacy risks, fragmented human-computer interaction entry points, difficulties in deploying coupled Agent and LLM, limited terminal adaptation, weak security mechanisms, limited business scenarios, and difficulties in cross-platform synchronization.

Method used

It adopts the IM protocol as the Agent scheduling bus, combined with P2P virtual networking, to achieve seamless access for cross-platform terminals. The Agent and LLM are decoupled, and a Rust native architecture and VM+Docker dual-layer isolation are adopted. It integrates intelligent agent DAG capability market.

Benefits of technology

It achieves inherent task traceability, zero-transfer machine-to-machine collaboration, and a consistent experience across all platforms, improving collaboration efficiency and security, reducing maintenance costs and usage barriers, and supporting seamless cross-network interoperability and rapid business expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122437753A_ABST
    Figure CN122437753A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on IM encapsulation and P2P virtual networking's distributed AI man-machine collaborative work system and method.The application first instant messaging (IM) message protocol is as the unified scheduling bus of distributed AI Agent, to IM group topology directly mapping distributed task DAG dependency relationship, realize " communication is cooperation, group chat is workflow " new paradigm.Network layer uses " center signaling control surface+P2P data surface " separation architecture, center signaling server is only responsible for node authentication and link scheduling, and service data is encrypted transmission through double DTLS layered session, not through any center server, fundamentally eliminate data leakage path.AI layer uses Agent and LLM completely decoupling architecture, standardization interface communication.Security layer uses Rust native architecture combination VM+Docker double layer isolation, git file audit realizes whole process traceable.System across five big terminal platforms, supports ability market one-key extension service capability, applicable to distributed office, AI collaboration, remote control and so on scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of distributed artificial intelligence, multi-agent human-machine collaboration, instant messaging (IM), P2P decentralized virtual networking, cross-platform terminal adaptation, LLM and agent separation architecture, container / virtualization security isolation, and distributed task scheduling. Background Technology

[0002] Existing collaboration platforms are mostly centralized architectures, relying on central servers for forwarding, which poses risks of single points of failure, bandwidth bottlenecks, and privacy leaks, and lacks flexibility in cross-regional / cross-network networking. Existing team collaboration platforms (such as Microsoft Teams and Slack) all adopt a cloud-based centralized data relay architecture. When the amount of user data is large, server bandwidth becomes a significant bottleneck, and user data is stored on third-party servers, posing risks to data sovereignty and privacy security.

[0003] Human-computer interaction entry points are fragmented, lacking a unified IM encapsulation. Dialogues, group chats, roles, and task flows are disconnected, resulting in a fragmented user experience and difficulties in cross-platform synchronization. Existing multi-agent collaboration frameworks (such as LangChain and AutoGPT) are independent of instant messaging systems, requiring users to switch between different interfaces and making it impossible to complete task command issuance, progress tracking, and result reception through a unified entry point.

[0004] AI capabilities are generally deployed in a coupled manner with Agents and LLMs, which makes model updates, capability expansion, and fault isolation difficult, and makes it impossible to flexibly schedule and securely isolate them as needed. In existing AI collaboration systems, Agent logic is deeply bound to LLM inference services, and changing the LLM version often requires redeploying the entire Agent, resulting in high maintenance costs.

[0005] The limitations of terminal adaptation make it difficult to achieve a consistent experience and seamless switching across all platforms, including Android, iOS, Windows, Linux, and Web.

[0006] The security mechanism is weak, lacking lightweight isolation and access control. Multiple tasks running in parallel are prone to mutual interference, and the security of data and execution environment is insufficient.

[0007] The business scenarios are limited, and the company has not developed full-chain collaborative capabilities covering remote control, AI office, and enterprise networking, and lacks a standardized business capability expansion mechanism.

[0008] The aforementioned deficiencies in the prior art prompted this invention to propose a novel distributed AI human-machine collaborative architecture that uses the IM protocol as a unified agent scheduling bus and eliminates data relay through P2P virtual networking.

[0009] Terminology Definition IM System: An instant messaging system that serves as the unified interaction entry point for this invention. It encapsulates functions such as one-on-one chat, group chat, role definition, and task collaboration, and supports the transmission of multiple message types, including text, rich media, and commands. In this invention, the IM protocol also serves as the Agent scheduling bus; the creation, allocation, execution, feedback, and archiving of tasks are all manifested through IM messages.

[0010] P2P Virtual Networking: Based on P2P peer-to-peer technology, a virtual subnet is constructed. The central signaling server is responsible for node authentication, link scheduling, and network relationship maintenance. Data between nodes is transmitted peer-to-peer without passing through the central server, enabling interconnection and interoperability across devices and regions. It is compatible with multi-path redundancy forwarding technology, improves node connectivity and data transmission stability in cross-network and weak network environments, and ensures uninterrupted collaborative work.

[0011] Agent: An intelligent agent unit, implemented on a customized terminal based on the IM Agent, responsible for multimedia interaction, task decomposition, process control, tool invocation, and result integration, operating decoupled from the LLM. The Agent runs independently in a VM+Docker dual-layer sandbox and communicates with the LLM via a JSON-RPC interface.

[0012] LLM (Large Language Model) provides language understanding, content generation, logical reasoning, and knowledge retrieval capabilities. As the core foundation of the AI ​​engine, it can be independently upgraded and replaced. LLM exposes its reasoning capabilities through a standardized JSON-RPC interface and supports OpenAI-compatible protocols.

[0013] Virtualization and Containerization: Employing VM+Docker dual-layer security isolation technology, coupled with git file auditing, different agents and tasks are deployed in independent sandbox environments to achieve permission isolation, resource management and behavior auditing. Combined with the native Rust architecture (memory safe, no GC pause) to improve system security.

[0014] Seamless integration across all platforms: Covering five major terminal platforms including Android, iOS, Windows, Linux, and Web, enabling real-time cross-platform synchronization of sessions, tasks, configurations, and agent status, and supporting uninterrupted collaboration anywhere, anytime, and any platform.

[0015] Standardized JSON-RPC Interface: In this invention, the Agent and LLM communicate using the JSON-RPC 2.0 protocol. The request message format is `{"jsonrpc":"2.0","method":"inference","params":{"prompt":"...","context":[...]},"id":1}`, and the response format is `{"jsonrpc":"2.0","result":{"content":"...","tokens":128},"id":1}`, ensuring that the Agent can be interchangeably connected with any compatible LLM. Summary of the Invention I. System Overall Architecture

[0016] This system consists of a five-layer core architecture (see Figure 1), from top to bottom: The first layer is the unified IM interaction layer: encapsulating one-on-one chat, group chat, role definition, task panel, and permission management, serving as the unified entry point for human-computer / machine-machine interaction. All collaborative operations are initiated and responded to through this layer. This layer also serves as the Agent scheduling bus**, where the entire lifecycle of a task (creation → assignment → execution → feedback → archiving) is transmitted and recorded via IM messages, achieving natural traceability of task flow.

[0017] The second layer, the cross-platform terminal layer, covers five major terminal platforms: Android, iOS, Windows, Linux, and Web. It employs a unified core logic (Rust) and multi-platform adaptive rendering technology to provide a consistent interactive experience and capability access (see [link]). Figure 2 ).

[0018] The third layer, the P2P virtual networking layer, provides node authentication, organizational structure management, network relationship maintenance, and link scheduling through a central signaling server. It constructs virtual subnets based on P2P technology, enabling encrypted point-to-point data transmission between nodes, multi-link redundancy, and NAT traversal. The central signaling server does not participate in business data forwarding (see Figure 3). This layer is deeply integrated with the IM interaction layer: the IM group topology and the P2P virtual subnet topology are unified into the same logical network, and the group member relationships are equivalent to the node network relationships, achieving integrated management of organizational structure and network structure.

[0019] The fourth layer is a distributed AI engine layer: It adopts a completely separate architecture of Agent and LLM. The IM Agent is responsible for interaction response, task decomposition, process control and tool calling, while the LLM provides the foundation for understanding, generation and inference. The two run independently and can flexibly collaborate through the JSON-RPC standardized interface (see Figure 4).

[0020] The fifth layer of security isolation and business layer: adopts a Rust native architecture + VM + Docker dual-layer security isolation, coupled with git file auditing, to ensure the security of multi-task and multi-agent parallel operation; at the same time, it connects to full-scenario business capabilities, integrates intelligent agent DAG capability market, supports one-click business expansion, and forms a complete human-machine collaborative business closed loop (see Figure 5 and Figure 6). II. Core Technology Solution 2.1 Unified IM Interaction Encapsulation – Also Serving as an Agent Scheduling Bus

[0021] With IM as its framework, it comprehensively encapsulates core functions such as dialogue, group chat, role definition, permission management, and task flow control, integrating human-computer interaction, human-human collaboration, and machine-to-machine collaboration into the IM portal to achieve unified interaction.

[0022] One of the core innovations of this invention is the use of the IM messaging protocol as the Agent scheduling bus. Specifically, after a user issues a task command in an IM group chat, the message simultaneously triggers task registration (recording the task ID, initiator, and target Agent); upon receiving the task message, the Agent replies with the task breakdown results (a DAG subtask list) via IM messages; status changes for each subtask (start, completion, failure, retry) are broadcast to the group via IM status messages; the final task result is sent back to the user via IM messages and automatically archived to the task panel. The entire task record is essentially an IM message record, inherently traceable and auditable, eliminating the need for an additional task management system.

[0023] It supports custom role definitions, including users, administrators, AI assistants, development agents, office agents, game agents, remote control agents, etc. Different roles are assigned corresponding permissions to achieve fine-grained management.

[0024] The messages are encapsulated in a structured manner, and the message formats for text, rich media (images, voice, video), files, task instructions, status callbacks, and capability call protocols are unified to ensure cross-terminal and cross-module message interoperability.

[0025] Group chats function as workgroups and are represented by a Directed Acyclic Graph (DAG) task graph: the member relationships within an IM group directly map to the node dependencies in the distributed task DAG. Each Agent member in the group corresponds to a processing node in the DAG, and message passing between members corresponds to data dependency edges in the DAG. Adding or removing group members dynamically adjusts the DAG nodes, enabling visualized and real-time synchronization of task orchestration and supporting full-process visualized management and control of tasks from initiation to execution and delivery. 2.2 P2P Decentralized Virtual Networking – Deep Integration with IM Topology

[0026] The architecture adopts a separation of "central signaling control plane + P2P data plane". The central signaling server is responsible for node authentication, organizational structure management, network relationship maintenance and link scheduling. P2P technology is used between nodes to realize distributed routing and forwarding, and business data is transmitted point-to-point without passing through the central server, thus avoiding the bandwidth bottleneck of the central server.

[0027] The second core innovation of this invention is that the P2P network topology and the IM group topology are unified into the same logical network. When a user creates a group through the IM system, the central signaling server synchronously creates a corresponding P2P virtual subnet for that group, and the group members are the subnet nodes. Agents communicate with each other on the P2P direct connection link through the IM protocol, realizing zero-transfer and no-landing of machine-to-machine collaborative data, fundamentally eliminating the data privacy risks of centralized agent collaborative architecture.

[0028] P2P link establishment uses the ICE (Interactive Connectivity Establishment) protocol to achieve NAT traversal, prioritizing direct connections (Host Candidate), and if that fails, sequentially attempting STUN (Server Reflexive Candidate) and TURN (Relay Candidate). The link selection strategy employs an RTT-first algorithm: the link with the lowest round-trip latency is selected as the primary link from among the candidate links, while maintaining multiple backup links; in the event of a primary link failure (three consecutive heartbeat timeouts), automatic switching to the second-lowest latency backup link occurs, with a switching time of less than 500ms, ensuring uninterrupted collaboration.

[0029] It can build virtual subnets to support private virtual networking for enterprises / teams, enabling remote access to intranet devices such as OA systems, NAS storage, and office printers, meeting the needs of distributed office work and providing seamless cross-network communication.

[0030] It is compatible with NAT traversal and multi-link redundancy technologies, improving node connectivity and data transmission stability in cross-network and weak network environments, and ensuring uninterrupted collaborative work. 2.3 Seamless integration across all platforms

[0031] The terminal covers five major platforms: Android, iOS, Windows, Linux, and Web. It uses Rust to write a unified core logic library (libclaw-core) and adapts to the native rendering layers of each platform (Android JNI, iOS Swift bridging, Windows Win32, Linux GTK, and Web WASM) through the FFI interface to ensure a consistent interactive experience across all terminals.

[0032] It enables real-time cross-device synchronization of sessions, tasks, configurations, and agent status, allowing users to seamlessly continue previous collaborative operations after logging in on any terminal, achieving uninterrupted operation anywhere, anytime, and any platform.

[0033] It has the ability to adapt to terminal performance and can dynamically allocate computing resources from local, cloud or distributed nodes according to the terminal hardware configuration (CPU, memory, bandwidth) to ensure smooth operation on different terminals. 2.4 AI Side: Agent and LLM Separation Architecture (1) Decoupling design

[0034] The LLM layer focuses on language understanding, content generation, logical reasoning, and knowledge retrieval. As the core foundation of AI capabilities, it exposes reasoning capabilities through a standardized JSON-RPC 2.0 interface, supports OpenAI compatible protocols, and can be independently upgraded, replaced, and expanded. It supports integration with different types and versions of LLM models (GPT series, Claude series, local open-source models, etc.) without affecting the normal operation of the Agent layer.

[0035] Agent Layer: Implemented based on a customized terminal of IM Agent. It does not undertake model inference tasks, but focuses on interactive response, task decomposition, process control, tool scheduling, and result integration. It communicates with LLM through a standardized JSON-RPC interface to achieve decoupled operation. (2) IM Agent Terminal Capabilities

[0036] Multimedia Interaction: Supports processing of all message formats including text, voice, images, videos, and files, enabling multimodal interaction with users and other agents to adapt to different collaborative scenarios.

[0037] Process control: It has the ability to decompose tasks, which can break down complex tasks into multiple sub-tasks and assign them to corresponding capability modules; it supports functions such as execution link tracing, abnormal retry (maximum number of retries is configurable, default is 3 times, and the backoff strategy adopts exponential backoff), manual intervention triggering, and result writing back, to ensure that tasks proceed in an orderly manner.

[0038] Cross-platform operation: Supports deployment on five major platforms: Android, iOS, Windows, Linux, and Web, and is compatible with user terminals to achieve multi-terminal agent collaboration. (3) Machine-to-machine collaboration

[0039] Different agents can communicate with each other via a direct P2P link using the IM protocol, enabling zero-intermediary communication. Multi-agent collaborative clusters can be formed according to task requirements to complete complex task chains that a single agent cannot handle, thus improving collaborative efficiency. Machine-to-machine collaboration messages use the same IM message format as human-machine interaction, maintaining protocol consistency. 2.5 Security Isolation Mechanism

[0040] By employing a two-tiered isolation technology of Rust's native architecture, VM, and Docker, coupled with git file auditing, different agents and tasks are deployed in independent sandbox environments, achieving runtime environment isolation and avoiding mutual interference. Rust's native architecture provides compile-time memory safety guarantees (no null pointers, no buffer overflows, no data races), avoiding security vulnerabilities in traditional C / C++ implementations; at the same time, Rust's GC-free pause feature ensures predictable response latency for real-time collaborative tasks. Following the principle of least privilege, strict controls are implemented on permissions for Agents and terminals, including network access (only authorized IPs / domains are allowed), file operations (only reading and writing to specified directories are allowed), device access (explicit authorization is required for cameras / microphones), and data access, to prevent abuse of privileges.

[0041] It supports resource quota management, allocating resources such as CPU (cgroup quota), memory (container memory limit), bandwidth (tc qdisc flow control), and storage as needed based on task priority and terminal performance, to prevent resource abuse from causing system lag or crashes.

[0042] Implement operational auditing functionality, and record the Agent's behavior logs, capability call records, and data flow with git commit throughout the process, making it traceable, verifiable, and meeting compliance requirements. 2.6 Remote device control capabilities

[0043] Users can send remote control commands via IM from any terminal. The remote control agent connects to the target device (mobile phone, computer, NAS, printer, etc.) through a P2P encrypted link and performs screen operations, file transfers, application management, etc., in a VM+Docker independent sandbox. The execution results (operation screenshots, transmission status, error messages) are sent back to the user via IM messages. All data is transmitted in P2P encrypted form and does not pass through a cloud server. 2.7 Market for Intelligent Agent DAG Capabilities

[0044] Developers encapsulate Agent capabilities into standardized installable templates (including Agent definition files, dependency configurations, and permission declarations) and publish them to the Agent DAG Capability Marketplace. Users trigger a one-click installation command via IM messages, and the central signaling server automatically completes: (1) downloading the Agent template from the capability market; (2) allocating an independent VM+Docker sandbox environment on the local node; and (3) completing Agent registration and scheduling access. The entire process requires no modification to the core system architecture, enabling rapid expansion of business capabilities. III. System Workflow (See Figure 5)

[0045] Step 1 Terminal Access: Users can log in to the system via any terminal such as Android, iOS, Windows, Linux, or Web. The central signaling server completes identity authentication (JWT token verification) and permission verification. The IM interaction layer automatically synchronizes the user's session records, role permissions, organizational structure, task progress, and other information to ensure cross-terminal consistency.

[0046] Step 2: Network Establishment: User terminals register as nodes with the central signaling server, are assigned virtual subnet IDs and node IDs, and receive a network-wide routing table. The terminal initiates end-to-end DTLS / SRTP session negotiation and simultaneously establishes hop-by-hop lightweight DTLS routing sessions with the nearest relay node. Through a dual DTLS layered architecture, it establishes encrypted communication links with other nodes (terminals, agents) within the same virtual subnet, forming a distributed collaborative network. The IM group topology is established synchronously with the virtual subnet topology.

[0047] Step 3: Interaction Initiation: Users initiate collaborative commands via IM one-on-one chat, group chat, or task panel. The IM system encapsulates the command into a structured task message (including task ID, command content, specified role, execution requirements, and priority) and pushes it to the corresponding Agent or user. The task message simultaneously triggers task registration and is recorded in the task panel.

[0048] [Step 4 AI Scheduling: After receiving the task message, the IM Agent calls the LLM inference service via a JSON-RPC interface to understand the user's intent, breaks down the complex task into multiple executable subtasks, describes the subtask dependencies using a DAG structure, and assigns the subtasks to each Agent via IM messages, scheduling the corresponding business capability modules. The subtask list is sent back to the task dashboard via IM messages, allowing users to view the task progress in real time.]

[0049] Step 5 Task Execution: The Agent runs locally in a VM+Docker dual-layer isolation sandbox, calling local computing power and business capabilities to execute tasks according to the decomposed DAG process. The status change of each subtask (start / complete / failure) is broadcast to the task group via IM status messages; automatic retry is performed when an exception is encountered (exponential backoff strategy), and manual intervention is triggered to notify the user after the maximum number of retries is exceeded.

[0050] Step 6: Result Delivery: After the task is completed, the Agent will send the results (text, file, report, status information, etc.) back to the user via IM message, supporting user manual review, modification of instructions, re-execution, and other operations.

[0051] Step 7: Collaborative Closed Loop: When multiple users and agents collaborate in parallel, task flow information and progress status are synchronized in real time via IM, achieving a closed loop for the entire task process from initiation, execution, review to archiving. When archiving a task, all relevant IM message records, execution logs, and result files are packaged and archived uniformly, ensuring data traceability and replayability. Practicality and Innovation

[0052] The core technological innovation of this invention lies in: for the first time, using the IM messaging protocol as a unified scheduling bus for distributed AI agents, and unifying the P2P network topology and IM group topology into the same logical network, resulting in the following significant synergistic effects that surpass the individual use of each component technology: (1) Tasks are naturally traceable: the flow of tasks is the message record, no additional task management database is needed, reducing system complexity. At the same time, all participants can see the task status in real time, greatly improving collaboration and consistency. (2) Zero-transfer machine collaboration: Agents communicate with each other via the IM protocol on a direct P2P link. Business data does not pass through any central server, fundamentally eliminating the data leakage path of traditional centralized Agent collaboration platforms; (3) Group chat as workflow: IM group management of task arrangement allows non-technical users to complete complex workflow configurations through intuitive operations of creating groups without needing to understand the concept of DAG, greatly reducing the threshold for use.

[0053] To address the problem of fragmented human-computer interaction entry points in existing technologies, this invention encapsulates the interaction entry point through IM and uses the IM protocol to carry the Agent scheduling bus function, merging human-computer interaction, task scheduling, and progress visualization into a single entry point. This solves the fragmentation problem of traditional solutions requiring switching between multiple system interfaces.

[0054] To address the technical problem of existing collaborative platforms relying on central server forwarding, this invention adopts a "central signaling control plane + distributed routing data plane" separation architecture. Business data is transmitted through dual DTLS layered session encryption, end-to-end DTLS / SRTP ensures end-to-end media encryption, relay without keys, and does not pass through a central server, fundamentally avoiding the bandwidth bottleneck, single point of failure, and privacy leakage risks of centralized architecture.

[0055] To address the technical challenges of coupled deployment and maintenance of Agent and LLM, this invention adopts a fully decoupled architecture for Agent and LLM based on a standardized JSON-RPC interface. The LLM can be upgraded and replaced independently without affecting the normal operation of the Agent layer, significantly reducing system maintenance costs.

[0056] To address the technical issues of weak security mechanisms, this invention adopts a Rust native architecture (compile-time memory safety) + VM + Docker dual-layer isolation, combined with permission minimization and git file auditing, to provide an independent sandbox for each Agent and each task, comprehensively ensuring the security and isolation of multi-task parallel execution.

[0057] To address the technical challenges of business expansion, this invention integrates a smart agent DAG capability marketplace. Developers release standardized agent templates, which users can install with a single click via IM to expand their business capabilities without modifying the core architecture, enabling rapid business expansion. Specific Implementation

[0058] To further illustrate the technical solution of the present invention, the following detailed description is provided in conjunction with specific embodiments (see [link to specific embodiments]). Figure 6 This embodiment is only used to explain the present invention and does not constitute a limitation on the scope of protection of the present invention. System Deployment

[0059] (1) Deploy the central signaling server to handle node identity authentication (JWT token), organizational structure management, virtual subnet topology maintenance, P2P link scheduling (ICE / STUN / TURN protocol stack), and node relationship maintenance; the signaling server is only responsible for control plane signaling interaction and does not participate in user service data forwarding. All media and file data are transmitted through P2P point-to-point without passing through the cloud server.

[0060] (2) Deploy the LLM service cluster, adopt Docker containerized deployment, support the parallel operation of multiple versions of LLM models, communicate with the IM Agent through the JSON-RPC 2.0 standardized interface, support OpenAI compatible protocol, and can be dynamically expanded according to task requirements; model inference prioritizes local running mode to protect data privacy, and the central signaling server is responsible for load balancing scheduling of the LLM cluster.

[0061] (3) Develop terminal applications for all platforms, including Android APP, iOS APP, Windows client, Linux client and Web client. Flutter is used to achieve cross-platform compatibility. Terminal access requires authentication through the central signaling server JWT.

[0062] (4) Deploy a security isolation module, adopt VM+Docker dual-layer isolation technology, and combine it with git file auditing. Allocate an independent sandbox environment for each Agent and each task, and configure cgroup resource quotas and permission minimization policies.

[0063] (5) Integrate full-scenario business capability modules, access remote control, AI office, audio and video conferencing capabilities, and access the intelligent agent DAG capability market, support one-click template installation and extension, and complete agent registration and scheduling by the central signaling server. Example Implementation Process

[0064] (1) Terminal access: Users log in to the system through the Windows client. The central signaling server completes JWT identity authentication and permission verification. The IM interaction layer automatically synchronizes the user's historical sessions, roles (ordinary users), organizational structure, permissions and unfinished tasks. Users can switch to the Web client and seamlessly continue the operation.

[0065] (2) Network Establishment: User terminals register as nodes with the central signaling server. The signaling server allocates P2P links and maintains network relationships through the ICE protocol. Terminals attempt direct connection, STUN traversal, and TURN relay in sequence, successfully establishing encrypted point-to-point links with other nodes in the same virtual subnet (including another user's Android terminal, office agent, and remote control agent), forming a distributed virtual subnet. The IM group "Financial Statement Working Group" synchronously establishes the corresponding P2P subnet.

[0066] (3) Interactive Initiation: Users initiate tasks through IM workgroup chat with the instruction "Generate quarterly financial statements and send them to the company's NAS storage via remote control agent". The IM system encapsulates the instruction into a structured task message (including task ID: TASK-20260505-001), designates an office agent to be responsible for report generation, and a remote control agent to be responsible for file transfer. The task panel automatically creates task entries and enters the "Executing" state.

[0067] (4) AI Scheduling: After receiving the task message, the office agent calls the local LLM inference service via the JSON-RPC interface. The LLM parses the task intent and breaks the task down into three DAG subtasks: `Subtask A: Collect financial data (no dependency)` → `Subtask B: Generate reports (depends on A)` → `Subtask C: Verify the accuracy of the reports (depends on B)`. The office agent sends the list of DAG subtasks to the workgroup via IM message, and at the same time notifies the remote control agent to prepare for file transfer. The central signaling server maintains the collaborative relationship and link status between agents.

[0068] (5) Task execution: The office agent runs locally in an independent VM+Docker sandbox and executes three sub-tasks in sequence. After each sub-task is completed, the progress is broadcast to the work group via IM status messages (`Sub-task A: Completed → Sub-task B: Executing`). The remote control agent connects to the company's NAS device through a P2P encrypted link (the link adopts the RTT priority strategy to select the direct link with the lowest latency). The central signaling server maintains NAS access permissions and link status.

[0069] (6) Result delivery: The office agent sends the generated financial report (Excel format) to the user for review via IM file message, and the task panel status is updated to "Pending review"; after the user approves the report, the work group replies with "confirmation", the office agent transmits the report to the remote control agent via P2P, the remote control agent uploads the report to the company NAS, and provides feedback on the transmission result via IM message ("File has been uploaded to NAS: / reports / Q1-2026.xlsx").

[0070] (7) Collaborative closed loop: When a user marks a task as completed in the IM task panel, the system automatically archives all IM message records, DAG execution logs, report files and git file audit records related to the task, forming a collaborative closed loop; if there are errors in the report, the user can send modification instructions directly through IM, and the office agent will re-execute the report generation sub-task. Security

[0071] The system adopts a native Rust architecture (compile-time memory safe, no GC pauses). The office agent and remote control agent run in a VM+Docker dual-layer isolation sandbox with strictly minimized permissions (only allowing access to specified NASIPs). All data is transmitted through a P2P encrypted dedicated network without passing through cloud servers. Git file auditing records the entire operation process to meet compliance requirements. The central signaling server only performs authentication and scheduling and does not access business data. Business Expansion

[0072] If users need to add new business capabilities in the future, they can send the command " / install Research Assistant" via IM. The system will automatically download the Research Assistant Agent template from the Intelligent Agent DAG Capability Marketplace, allocate an independent sandbox environment locally, and complete the registration and scheduling by the central signaling server. No modification to the core system architecture is required, enabling rapid business expansion. Attached Figure Description

[0073] Figure 1 is a diagram of the overall five-layer architecture of the system of the present invention; Figure 2 is a functional architecture diagram of the IM interaction layer of the present invention (including a schematic diagram of the IM scheduling bus); Figure 3 is a schematic diagram of the P2P virtual networking process of the present invention (including the ICE protocol link establishment process); Figure 4 is a schematic diagram of the Agent and LLM separation architecture of the present invention (including JSON-RPC interface); Figure 5 is a flowchart of the system workflow of the present invention (7-step collaborative closed loop); Figure 6 is a schematic diagram of system deployment and operation (financial statement scenario) of a specific embodiment of the present invention.

Claims

1. A distributed AI human-machine collaborative work method based on IM encapsulation and P2P virtual networking, characterized in that, Includes the following steps: The IM system uniformly encapsulates dialogue, group chat, role definition, task collaboration and human-computer / machine-machine interaction interfaces. The IM message protocol is used as the unified scheduling bus for distributed AI agents. The creation, allocation, execution, feedback and archiving of tasks are all transmitted and recorded through IM messages. The IM group topology maps the distributed task DAG node dependencies. Each agent member in the group corresponds to a DAG processing node, and the message transmission between members corresponds to DAG data dependency edges. A central signaling server is set up on the network side, which is responsible for node authentication, organizational structure management, virtual subnet topology maintenance and routing scheduling. Business data is transmitted through P2P point-to-point encrypted links without passing through the central signaling server. The IM group topology and the virtual subnet topology are established synchronously and unified into the same logical network. On the user side, the system can be accessed through terminals on all platforms including Android, iOS, Windows, Linux, and Web, enabling real-time synchronization of sessions, tasks, configurations, and agent status across platforms. The AI ​​side adopts an Agent and LLM separation architecture. The IM Agent is a customized terminal that undertakes multimedia interaction, task decomposition, process control and tool scheduling, while the LLM provides language understanding and reasoning support. The Agent calls the LLM service through the JSON-RPC 2.0 standardized interface after being uniformly routed by the IM scheduling bus. The Agent achieves secure and isolated operation through VM+Docker dual-layer virtualization and containerization technology, connects with full-scenario business capabilities, and forms a distributed human-machine collaborative workflow.

2. The method according to claim 1, characterized in that, The IM system also includes functions such as permission management, task panel, and structured message transmission. The structured messages include text, rich media, files, task instructions, status callbacks, and capability invocation protocols. The task instruction messages include task ID, instruction content, specified role, execution requirements, and priority fields. The role definitions include users, administrators, AI assistants, development agents, office agents, game agents, and remote control agents. Different roles are assigned corresponding permissions to achieve fine-grained management.

3. The method according to claim 1, characterized in that, The P2P virtual networking supports the construction of enterprise virtual private networks, enabling cross-network access to internal network devices, including OA systems, NAS storage, and network printers; it adopts multi-link redundancy forwarding technology to improve node connectivity and data transmission stability in cross-network and weak network environments; it automatically switches to backup links in case of link failure to ensure uninterrupted collaboration.

4. The method according to claim 1, characterized in that, The all-platform terminal uses a unified core logic library written in Rust and adapts to the native rendering layers of various platforms (Android JNI, iOS Swift bridging, Windows Win32, Linux GTK, Web WASM) through the FFI interface. It can dynamically schedule computing resources of local, cloud or distributed nodes according to the terminal hardware performance; and realize cross-terminal real-time synchronization of sessions, tasks, configurations and agent status, so that users can seamlessly continue collaborative operations on any terminal.

5. The method according to claim 1, characterized in that, After the Agent is uniformly routed to the corresponding Agent node via the IM scheduling bus, the Agent node calls the LLM inference capability through the JSON-RPC 2.0 standardized interface. The routing and load balancing of the JSON-RPC call are uniformly managed by the IM scheduling bus. The LLM service unit is deployed and upgraded independently as the inference backend, and supports the connection to different types and versions of LLM models (GPT series, Claude series, local open source models, etc.). Upgrading or replacing the LLM does not affect the normal operation of the Agent layer.

6. The method according to claim 1, characterized in that, The customized IM Agent terminal has the following capabilities: (1) Multimedia interactive capabilities: Supports processing of all formats of messages, including text, voice, images, videos, and files; (2) Process control capability: It can decompose complex tasks into DAG subtasks, track the execution link, and automatically retry with an exponential backoff strategy when an anomaly occurs. After the maximum number of retries is exceeded, a manual intervention notification is triggered, and the result is written back to the task panel. (3) Multi-Agent Collaboration Capability: Through the IM protocol, it can communicate with other agents on the P2P direct connection link without any intermediate transfer, and form a multi-agent collaborative cluster; (4) Cross-platform operation capability: Supports deployment on five major platforms: Android, iOS, Windows, Linux and Web.

7. The method according to claim 1, characterized in that, Under the unified coordination of the IM scheduling bus, an independent security sandbox is dynamically allocated to each Agent according to the task DAG definition: the VM layer uses KVM / QEMU to provide hardware-level isolation, the Docker layer provides lightweight process isolation, the sandbox environment embeds a Rust natively compiled scheduling agent (no GC pause to ensure real-time performance), and cgroups are used to implement resource quota allocation for CPU, memory, and bandwidth; the entire task execution process is audited and recorded by git files, and the Agent's network access, file operations, and device calls are controlled by a minimal permission policy.

8. The method according to claim 1, characterized in that, The full-scenario business capabilities include agent-based remote device control: the user terminal sends control commands via IM, and the remote control agent accesses the target device via a P2P encrypted link, performs screen operations, file transfers or application management in a VM+Docker independent sandbox, and the execution results are sent back to the user via IM messages. All data is transmitted via P2P encryption and does not pass through the cloud server.

9. The method according to claim 1, characterized in that, It also includes the steps for expanding the agent DAG capability market: developers encapsulate agent capabilities into standardized installable templates containing agent definition files, dependency configurations, and permission declarations and publish them to the capability market; after users trigger a one-click installation command via IM messages, the central signaling server automatically completes the agent template download, independent VM+Docker sandbox environment allocation, agent registration and scheduling access, without modifying the core system architecture.

10. A distributed AI human-machine collaborative work system based on IM encapsulation and P2P virtual networking, characterized in that, include: IM Interaction Module: Used to uniformly encapsulate dialogue, group chat, role definition, task collaboration, permission management and human-computer / machine-machine interaction interfaces. It uses the IM message protocol as the Agent scheduling bus to process structured message transmission. It maps the distributed task DAG node dependencies with IM group topology. Each Agent member in the group corresponds to a DAG processing node, and message transmission between members corresponds to DAG data dependency edges, realizing IM-based management of the entire task lifecycle. Cross-platform terminal module: includes Android, iOS, Windows, Linux, and Web terminal applications. It adopts the Rust unified core logic library and adapts to various platforms through the FFI interface to achieve real-time synchronization of sessions, tasks, configurations, and agent status across platforms. P2P Virtual Networking Module: Works with the central signaling server to achieve node authentication, virtual subnet topology maintenance and route scheduling, builds a distributed routing virtual subnet, and transmits business data through P2P encrypted links without passing through the central server. The IM group topology and the virtual subnet topology are established synchronously, and support multi-link redundancy and automatic link switching. Distributed AI Engine Module: Includes LLM service unit and IM Agent control unit. After being routed uniformly by the IM scheduling bus, the Agent calls the LLM service unit through the JSON-RPC 2.0 standardized interface. The LLM service unit provides language understanding and reasoning support and can be upgraded and replaced independently. The IM Agent control unit is responsible for interaction, task decomposition, DAG scheduling and process control, and supports parallel operation of multiple LLM models and dynamic expansion. Security Isolation Module: Under the coordination of the IM scheduling bus, each Agent is dynamically allocated an independent sandbox. It adopts VM (KVM / QEMU) + Docker dual-layer isolation technology, embeds a scheduling agent compiled natively in Rust, and provides sandbox environment, minimal permission control and runtime auditing functions in conjunction with cgroup resource quotas and git file auditing. Business Capability Module: Encapsulates full-scenario business interfaces for IM Agent to call, integrates intelligent agent DAG capability market, supports one-click installation and expansion of standardized Agent templates, Agent registration and scheduling are completed by the central signaling server, and supports multi-dimensional collaboration between humans and machines, humans and humans, and machines and machines.