Resource task dynamic adaptive method of MCP and DeepSeek large model based on OpenHarmony
By integrating MCP and DeepSeek large-scale dynamic adaptive system into the OpenHarmony system, the problems of dynamic adaptability and resource utilization of traditional operating systems in complex environments are solved, the system reliability and user experience are improved, and the technology is made autonomously controllable and intelligently managed.
Patent Information
- Application Number
- CN202511079749.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-11
AI Technical Summary
Traditional operating systems lack dynamic adaptability in high-concurrency tasks, heterogeneous hardware architectures, and rapidly changing workloads. They have low resource utilization, limited fault prediction and user experience optimization functions, and are difficult to meet the needs of modern application scenarios. Furthermore, existing intelligent solutions have technological dependencies and privacy risks.
A dynamic adaptive system based on OpenHarmony's MCP and DeepSeek large model is constructed. The MCP module monitors resource and task status in real time, and the DeepSeek large model is used for intelligent decision-making and optimization, including dynamic resource scheduling, fault prediction and recovery, user interaction optimization and security protection, so as to achieve seamless system integration and intelligent management.
It significantly improves the adaptability and reliability of the OpenHarmony system in complex and ever-changing environments, increases resource utilization, enhances user experience, ensures independent and controllable technology, and adapts to the challenges of multi-device and distributed scenarios.
Smart Images

Figure CN120929264A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a dynamic adaptive method for resource tasks, belonging to the field of computer operating system technology. Background Technology
[0002] With the rapid development of technologies such as cloud computing, edge computing, and big data processing, modern computing environments place higher demands on the resource management and task scheduling capabilities of operating systems. Traditional operating systems typically rely on scheduling algorithms based on preset rules or simple statistics, such as the Completely Fair Scheduler (CFS) in Linux or priority scheduling in Windows. While these methods perform adequately in static environments, they increasingly exhibit problems such as insufficient dynamic adaptability, limited predictive capabilities, and low resource utilization in high-concurrency tasks, heterogeneous hardware architectures, and rapidly changing workloads. For example, in virtualized environments, resource contention between virtual machines can lead to performance bottlenecks; in edge computing scenarios, low-power devices struggle to handle sudden task demands in real time. Furthermore, traditional operating systems have limited capabilities in fault prediction, automatic recovery, and user experience optimization, making it difficult to meet the needs of modern application scenarios.
[0003] In recent years, advancements in artificial intelligence (AI) technology have provided new avenues for operating system optimization. Some research has attempted to introduce machine learning models into resource management and task scheduling, but most rely on foreign-developed AI models, such as those trained using TensorFlow or PyTorch. This increases technological dependence and may pose risks due to data privacy and model controllability issues. Existing intelligent solutions still have room for improvement in real-time performance, system integration, and the degree of intelligence, making it difficult to achieve comprehensive dynamic adaptive optimization.
[0004] To address the aforementioned issues, this invention proposes a dynamic adaptive system based on the Model Context Protocol (MCP) and the domestically developed DeepSeek large model. This system is built and seamlessly integrated into the OpenHarmony operating system environment. By monitoring the OpenHarmony system resources and task status in real time, making intelligent decisions, and performing closed-loop optimization, it significantly improves the adaptability, reliability, and user experience of the OpenHarmony system in complex scenarios such as multi-device and distributed environments, while ensuring that the technology is independently controllable. Summary of the Invention
[0005] To address the shortcomings of traditional operating systems and OpenHarmony in dynamic adaptability, resource utilization, fault prediction, and user experience optimization in complex and ever-changing environments, especially distributed and heterogeneous environments, this invention proposes a resource task dynamic adaptive method based on the OpenHarmony-based MCP and DeepSeek large model.
[0006] The technical solution adopted by the present invention to solve the above problems is as follows: The steps of the present invention include: Step 1: Build the system architecture; design and implement the Model Context Protocol module, the DeepSeek large model interface module, the dynamic resource and task scheduler, the fault prediction and recovery module, the user interaction optimization module, and the security and privacy protection module; Step 2: Monitor OpenHarmony operating system resources and application task status in real time through the MCP module, and standardize the monitoring data; Step 3: Use the DeepSeek large model interface module to transmit standardized data to the DeepSeek large model and receive the optimization instructions generated by the model; Step 4: The dynamic resource and task scheduler adjusts the resource allocation and task scheduling strategies in the OpenHarmony operating system according to optimization instructions. Step 5: The fault prediction and recovery module predicts potential faults and generates recovery strategies based on the anomaly detection of the MCP module and the analysis of the DeepSeek large model. Step 6: The user interaction optimization module optimizes application loading and interface response in the OpenHarmony environment by monitoring user behavior and using the DeepSeek large model to predict user intent. Step 7: The security and privacy protection module ensures system security through encrypted communication, model sandbox isolation, and access control mechanisms.
[0007] This invention first establishes a multi-module collaborative system architecture to achieve dynamic and adaptive resource and task management. The system includes an MCP module, a DeepSeek large model interface module, a dynamic resource and task scheduler, a fault prediction and recovery module, a user interaction optimization module, and a security and privacy protection module. Each module has a clear division of labor and works collaboratively to achieve intelligent optimization goals. This system architecture is designed to be seamlessly integrated into the OpenHarmony system framework, becoming part of its intelligent management layer.
[0008] Furthermore, the process of building the system architecture in step 1 is as follows: Step 101: Design the MCP module, including the OpenHarmony operating system resource MCP submodule and the application task MCP submodule; Step 102: Design the DeepSeek large model interface module to support specific communication protocols; Step 103: Design a dynamic resource and task scheduler, combine it with or extend the scheduling mechanism of the OpenHarmony operating system, and add an external instruction interface. Step 104: Design a fault prediction and recovery module, and use anomaly detection and deep analysis to achieve fault prediction; Step 105: Design a user interaction optimization module to optimize user experience through behavior monitoring and intent prediction; Step 106: Design a security and privacy protection module, and adopt encryption, isolation and access control mechanisms.
[0009] The MCP module is the core component of the system, responsible for real-time collection of system resource and task status data. Through this module, the system can obtain information on resource usage such as CPU, GPU, memory, storage, and network bandwidth, as well as task execution status, resource requirements, and dependencies, providing a data foundation for subsequent intelligent decision-making. In the OpenHarmony environment, the MCP module needs to be able to efficiently acquire resource and task information from different device types (lightweight, small, and standard systems), adapting to their respective system interfaces and data structures. In distributed scenarios, the MCP module also needs to be able to perceive and collect task status and resource usage across devices.
[0010] Furthermore, step 2 specifically includes: Step 201: The OpenHarmony operating system resource MCP submodule collects CPU utilization, GPU load, memory usage, storage I / O, and network bandwidth data in real time. Step 202: The application task MCP submodule monitors the running status, resource requirements, and inter-task dependencies of the task. Step 203: Encode the collected data into a specific format to ensure the uniformity and transmissibility of the data structure.
[0011] The DeepSeek large model interface module is responsible for transmitting monitoring data collected by the MCP module to the DeepSeek large model and receiving optimization instructions generated by the model. This module uses the gRPC protocol to ensure efficient and reliable data transmission, while also handling data format conversion and instruction parsing. In OpenHarmony distributed scenarios, this module leverages OpenHarmony's distributed soft bus capabilities to enable efficient communication between MCP modules on different devices and remotely deployed DeepSeek large models, supporting data aggregation and instruction distribution.
[0012] Furthermore, step 3 specifically includes: Step 301: Convert the standardized monitoring data into an input format that can be processed by the DeepSeek large model; Step 302: Efficiently transmit data to the DeepSeek large model via communication protocol; Step 303: Receive the optimization instructions returned by the DeepSeek large model and parse them into a sequence of operations that the system can execute.
[0013] The dynamic resource and task scheduler dynamically adjusts resource allocation and task scheduling strategies based on the optimization instructions of the DeepSeek large model. This module extends OpenHarmony's existing scheduling mechanism (LiteOS) by adding an external instruction interface, enabling real-time optimization of task priorities and resource allocation ratios based on load changes. In particular, this scheduler supports OpenHarmony's distributed scheduling features, such as load balancing or migration of tasks across different devices based on globally optimal strategies, achieving collaborative scheduling of heterogeneous resources (such as CPUs, GPUs, NPUs, and other heterogeneous hardware resources supported by OpenHarmony).
[0014] Furthermore, step 4 specifically includes: Step 401: Adjust task priority and resource allocation ratio according to optimization instructions; Step 402: Prioritize scheduling critical tasks under high load scenarios and optimize energy consumption under low load scenarios; Step 403: Support resource scheduling in heterogeneous computing environments, enabling support for various device types and heterogeneous hardware platforms supported by OpenHarmony.
[0015] The fault prediction and recovery module leverages the anomaly detection capabilities of the MCP module and the analytical power of the DeepSeek large model to predict potential faults and generate recovery strategies. By identifying problems early and taking corrective measures, the system can reduce the impact of faults on business operations and improve reliability. This module can predict various anomalies that may occur in the OpenHarmony system during operation and handle them using OpenHarmony's fault tolerance and recovery mechanisms.
[0016] Furthermore, step 5 specifically includes: Step 501: The MCP module detects abnormal system conditions; Step 502: DeepSeek large model analyzes abnormal data to predict the probability and time window of failure occurrence; Step 503: Generate a recovery strategy based on the prediction results, including the migration and recovery of OpenHarmony distributed tasks.
[0017] The user interaction optimization module monitors user behavior and uses DeepSeek's large-scale model to predict user intent. It preloads resources based on user habits, reducing waiting time and improving user experience. It integrates tightly with OpenHarmony's UI framework or application layer, acquiring user action data and optimizing operations based on prediction results through OpenHarmony's system services or application interfaces.
[0018] Furthermore, step 6 specifically includes: Step 601: Monitor behavioral data related to user input, mouse movement, and application usage patterns; Step 602: Input the behavioral data into the DeepSeek large model to predict user intent; Step 603: Based on the prediction results, preload resources or adjust the interface layout to improve response speed and optimize the interactive experience of the OpenHarmony application.
[0019] The security and privacy protection module safeguards system data and user privacy through multi-layered security mechanisms. This module employs TLS protocol for encrypted communication, uses a sandbox to isolate the DeepSeek large model inference process, and controls access permissions for sensitive data through RBAC. This module is tightly integrated with OpenHarmony's security subsystem, leveraging various security capabilities provided by OpenHarmony (such as authentication, access control, encrypted data storage, and sandbox isolation) to ensure the security of system data collected by MCP, data transmitted to the large model, and the large model inference process, ensuring compliance with OpenHarmony's security specifications and user privacy protection requirements.
[0020] Furthermore, step 7 specifically includes: Step 701: Encrypt all communication data using a specific protocol; Step 702: Run the DeepSeek large model in a sandbox environment to isolate the inference process; Step 703: Restrict access to sensitive data through specific mechanisms and integrate them with the OpenHarmony security framework.
[0021] The beneficial effects of this invention are as follows: This invention is based on the OpenHarmony Model Context Protocol and the DeepSeek large model resource task dynamic adaptive system built on the OpenHarmony operating system. It can achieve efficient resource allocation and task scheduling under complex and variable workloads, especially addressing the challenges of OpenHarmony's distributed and heterogeneous environments. It can also significantly improve system reliability and enhance the stability of the OpenHarmony system through prediction and recovery mechanisms before failures occur. At the same time, the system has significant advantages in user experience and technical autonomy, and can fully leverage the full-scenario and distributed characteristics of OpenHarmony. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the system architecture; Figure 2 This is a flowchart of the workflow; Figure 3 This is a schematic diagram of the MCP module structure; Figure 4 This is a communication flowchart for the DeepSeek large model interface module; Figure 5 This is a diagram illustrating the dynamic resource and task scheduler adjustment strategy; Figure 6 This is a flowchart of the fault prediction and recovery module. Figure 7 This is a functional diagram of the user interaction optimization module; Figure 8 This is a schematic diagram of the security and privacy protection module mechanism. Detailed Implementation
[0023] Specific implementation method one: as follows Figures 1 to 8 As shown, in this embodiment, the system is deployed on a high-performance OpenHarmony Standard device (configured with a 32-core CPU, four NVIDIA RTX 3090 GPUs, 128GB of memory, and a 2TB NVMe SSD). This device connects to other lightweight or small OpenHarmony system devices via OpenHarmony's distributed soft bus capability, forming a multi-device collaborative OpenHarmony distributed computing environment. In this embodiment, the system is used to optimize scientific computing tasks, deep learning training tasks, and user applications running on these OpenHarmony devices. The implementation steps are as follows: Step 1: Build the system architecture. Deploy the various modules of this invention on the selected OpenHarmony device and configure their interaction interfaces with the underlying and framework layers of the OpenHarmony operating system; The process of building the system architecture is as follows: Step 101: Design and deploy the MCP module, integrating the operating system resource MCP submodule and the application task MCP submodule. This MCP module is designed to run as a system ability within OpenHarmony and to obtain resource and task information by calling the underlying system interfaces and framework layer APIs provided by OpenHarmony. It obtains performance and exception data through OpenHarmony's DFX framework, acquires the task status, resource requirements, and lifecycle information of the application (FA / PA) through process management or capability management APIs, and obtains the utilization and status of hardware resources (CPU, GPU, memory, storage, network) through HDF or graphics subsystem interfaces. Step 102: Configure the DeepSeek large model interface module. Establish an efficient and secure connection with the DeepSeek large model service deployed on a local or remote server via a reliable transmission channel built on a distributed soft bus for data exchange. Data sending and command receiving are achieved through OpenHarmony's distributed RPC mechanism and distributed Data Objects in distributed data management. Step 103: Design and integrate a dynamic resource and task scheduler; combine it with or extend OpenHarmony's existing task scheduling mechanisms. For example, on the OpenHarmony Standard system, hook extensions can be made to the Linux CFS and Deadline schedulers. On smaller systems such as OpenHarmony LiteOS, the task scheduler can be modified and an external control interface can be provided. This module receives optimization instructions from larger models and uses the scheduling control interface provided by OpenHarmony to dynamically adjust task execution and resource allocation in the OpenHarmony system. Step 104: Design and deploy the fault prediction and recovery module, integrating anomaly detection functionality. Receive OpenHarmony system anomaly data from the MCP module and interface with OpenHarmony's DFX framework or other logging and monitoring subsystems for in-depth analysis. Leveraging the predictive capabilities of the DeepSeek large model, predict potential faults in OpenHarmony devices or distributed tasks (such as deadlocks, memory leaks, hardware overheating, service crashes, etc.) and trigger OpenHarmony's preset recovery strategies. Step 105: Design and deploy a user interaction optimization module to monitor user behavior. This module runs in the OpenHarmony user space and can be integrated into the OpenHarmony UI framework to monitor user actions on OpenHarmony devices (such as touch events, application launch order, interface switching frequency, etc.). Step 106: Configure the security and privacy protection module, enable TLS encryption and sandbox isolation; utilize the security capabilities provided by OpenHarmony, based on Huks' key management, unified access control system (for RBAC control), sandbox / container isolation mechanism (for isolating large model inference processes), and secure transmission of distributed communication (such as TLS encryption), etc. Step 2: Real-time monitoring by the MCP module; The MCP module enables real-time monitoring of OpenHarmony operating system resources and application task status, specifically including: Step 201: The OpenHarmony operating system resource MCP submodule collects data such as CPU utilization, GPU load, memory usage, storage I / O, and network bandwidth in real time. This is achieved by calling the system status query API provided by OpenHarmony or reading specific system files / device nodes, and adapts to the data acquisition methods of different device types in OpenHarmony. Step 202: The application task MCP submodule monitors the running status, resource requirements, and inter-task dependencies of tasks. This is achieved through OpenHarmony's process management APIs, obtaining information such as the running status, resource quotas, and priorities of FA / PA or background processes. Step 203: Encode the data into JSON-RPC format; Step 3: Transfer the monitoring data from the OpenHarmony environment to the DeepSeek large model for analysis and receive optimization instructions; The process of transferring standardized data to the DeepSeek large model using the DeepSeek large model interface module specifically includes: Step 301: Convert JSON-RPC data into model input; Step 302: Transmit the data to the DeepSeek large model via OpenHarmony distributed RPC; Step 303: Receive and parse the optimization instructions; Step 4: Dynamic scheduling and adjustment; The dynamic resource and task scheduler adjusts resource allocation and task scheduling strategies based on optimization instructions, specifically including: Step 401: Adjust the OpenHarmony task priority and resource allocation according to the instructions; Step 402: Prioritize scheduling critical tasks under high load scenarios and optimize energy consumption to reduce power consumption under low load. For devices with low power mode supported by OpenHarmony, the system can be instructed to enter or adjust to a low power state. Step 403: Implement CPU-GPU collaborative scheduling; Step 5: Fault Prediction and Recovery; The fault prediction and recovery module predicts potential faults based on anomaly detection from the MCP module and analysis from the DeepSeek large model, specifically including: Step 501: The MCP module detects OpenHarmony system anomalies, such as high CPU usage, memory leaks, device driver errors, or distributed soft bus communication anomalies in a certain OpenHarmony process. Step 502: DeepSeek's large model analyzes abnormal data and system context to predict the probability, type, and time window of a failure, such as predicting that an OpenHarmony service is about to crash or a device is about to go offline. Step 503: Generate a recovery strategy based on the prediction results, such as restarting specific OpenHarmony services, adjusting resource limits for affected tasks, or using OpenHarmony's distributed task management capabilities to seamlessly migrate affected or related tasks to other healthy OpenHarmony devices in the network. Step 6: Optimize user interaction; The user interaction optimization module monitors user behavior and uses the DeepSeek large model to predict user intent, specifically including: Step 601: Monitor user operating habits; Step 602: Predict user intent; Step 603: Preload resources to improve response speed; Step 7, Security Measures; The security and privacy protection module ensures system security through encrypted communication, model sandbox isolation, and access control mechanisms, specifically including: Step 701: Encrypt communication data; Step 702: Isolate the model inference process; Step 703: Restrict access to sensitive data.
[0024] The design of this invention has good scalability, allowing adjustments to the monitoring range of the MCP module, the training data of the DeepSeek large model, and the scheduler optimization strategy according to specific application scenarios. For example, in OpenHarmony IoT devices (resource-constrained), it can enhance optimization for low-power modes and fine-grained control over memory management; in high-performance computing clusters built on OpenHarmony, it can enhance support for massively parallel tasks (such as MPI tasks); and in in-vehicle OpenHarmony systems, it can optimize multimodal interaction and collaborative scheduling of resources from different domain controllers. This invention is adaptable to various device forms (such as smart wearables, smart screens, and smart cockpits) and hardware platforms supported by OpenHarmony.
[0025] This invention deeply integrates MCP technology with the DeepSeek large model, and uses it as an intelligent management layer or component of the OpenHarmony operating system. This achieves intelligent and adaptive optimization of the operating system, addressing the shortcomings of traditional operating systems and OpenHarmony in complex and ever-changing environments, particularly in terms of dynamism, predictability, and collaboration. It possesses significant technical advantages and application value, contributing to improved OpenHarmony performance across all device scenarios. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention, such as expanding the monitoring objects to more hardware resources or task types supported by OpenHarmony, or adapting system interfaces or frameworks to future versions of OpenHarmony, should be included within the scope of protection of this invention.
[0026] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent substitutions, and improvements made to the above embodiments without departing from the scope of the present invention, based on the technical essence of the present invention and within the spirit and principles of the present invention, shall still fall within the protection scope of the present invention.
Claims
1. A resource task dynamic adaptive method based on Model Context Protocol and DeepSeek large model, characterized in that, The specific steps include: Step 1: Build the system architecture; design and implement the Model Context Protocol module, the DeepSeek large model interface module, the dynamic resource and task scheduler, the fault prediction and recovery module, the user interaction optimization module, and the security and privacy protection module; Step 2: Monitor OpenHarmony operating system resources and application task status in real time through the MCP module, and standardize the monitoring data; Step 3: Use the DeepSeek large model interface module to transmit standardized data to the DeepSeek large model and receive the optimization instructions generated by the model; Step 4: The dynamic resource and task scheduler adjusts the resource allocation and task scheduling strategies in the OpenHarmony operating system according to optimization instructions. Step 5: The fault prediction and recovery module predicts potential faults and generates recovery strategies based on the anomaly detection of the MCP module and the analysis of the DeepSeek large model. Step 6: The user interaction optimization module optimizes application loading and interface response in the OpenHarmony environment by monitoring user behavior and using the DeepSeek large model to predict user intent. Step 7: The security and privacy protection module ensures system security through encrypted communication, model sandbox isolation, and access control mechanisms.
2. The resource task dynamic adaptive method based on Model Context Protocol and DeepSeek large model according to claim 1, characterized in that, The process of building the system architecture in step 1 is as follows: Step 101: Design the MCP module, including the OpenHarmony operating system resource MCP submodule and the application task MCP submodule; Step 102: Design the DeepSeek large model interface module to support specific communication protocols; Step 103: Design a dynamic resource and task scheduler, combine it with or extend the scheduling mechanism of the OpenHarmony operating system, and add an external instruction interface. Step 104: Design a fault prediction and recovery module, and use anomaly detection and deep analysis to achieve fault prediction; Step 105: Design a user interaction optimization module to optimize user experience through behavior monitoring and intent prediction; Step 106: Design a security and privacy protection module, and adopt encryption, isolation and access control mechanisms.
3. The resource task dynamic adaptive method based on Model Context Protocol and DeepSeek large model according to claim 1, characterized in that, Step 2 specifically includes: Step 201: The OpenHarmony operating system resource MCP submodule collects CPU utilization, GPU load, memory usage, storage I / O, and network bandwidth data in real time. Step 202: The application task MCP submodule monitors the running status, resource requirements, and inter-task dependencies of the task. Step 203: Encode the collected data into a specific format to ensure the uniformity and transmissibility of the data structure.
4. The resource task dynamic adaptive method based on Model Context Protocol and DeepSeek large model according to claim 1, characterized in that, Step 3 specifically includes: Step 301: Convert the standardized monitoring data into an input format that can be processed by the DeepSeek large model; Step 302: Efficiently transmit data to the DeepSeek large model via communication protocol; Step 303: Receive the optimization instructions returned by the DeepSeek large model and parse them into a sequence of operations that the system can execute.
5. The resource task dynamic adaptive method based on Model Context Protocol and DeepSeek large model according to claim 1, characterized in that, Step 4 specifically includes: Step 401: Adjust task priority and resource allocation ratio according to optimization instructions; Step 402: Prioritize scheduling critical tasks under high load scenarios and optimize energy consumption under low load scenarios; Step 403: Support resource scheduling in heterogeneous computing environments, enabling support for various device types and heterogeneous hardware platforms supported by OpenHarmony.
6. The resource task dynamic adaptive method based on Model Context Protocol and DeepSeek large model according to claim 1, characterized in that, Step 5 specifically includes: Step 501: The MCP module detects abnormal system conditions; Step 502: DeepSeek large model analyzes abnormal data to predict the probability and time window of failure occurrence; Step 503: Generate a recovery strategy based on the prediction results, including the migration and recovery of OpenHarmony distributed tasks.
7. The resource task dynamic adaptive method based on Model Context Protocol and DeepSeek large model according to claim 1, characterized in that, Step 6 specifically includes: Step 601: Monitor behavioral data related to user input, mouse movement, and application usage patterns; Step 602: Input the behavioral data into the DeepSeek large model to predict user intent; Step 603: Based on the prediction results, preload resources or adjust the interface layout to improve response speed and optimize the interactive experience of the OpenHarmony application.
8. The resource task dynamic adaptive method based on Model Context Protocol and DeepSeek large model according to claim 1, characterized in that, Step 7 specifically includes: Step 701: Encrypt all communication data using a specific protocol; Step 702: Run the DeepSeek large model in a sandbox environment to isolate the inference process; Step 703: Restrict access to sensitive data through specific mechanisms and integrate them with the OpenHarmony security framework.
Citation Information
Patent Citations
Navigation big data intelligent interaction system and method based on model context protocol
CN120378501A
KR20250105914A
Cited By
Browser memory leak automatic positioning system and method based on MCP protocol and medium
CN122086742A