A cloud resource dynamic configuration method based on agent state perception
By constructing a predictive pre-configuration mechanism for agent state awareness and global collaborative scheduling, the problem of temporal mismatch between agent computing load characteristics and cloud resource configuration is solved, achieving efficient utilization and low-cost operation of cloud resources and ensuring session continuity.
Patent Information
- Application Number
- CN202610730467.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-08-25
AI Technical Summary
Existing cloud resource configuration schemes are difficult to match the pulse-like time-varying characteristics of intelligent agent computing loads, resulting in low resource utilization, high costs, difficulty in ensuring session continuity, and a lack of forward-looking load prediction mechanisms.
A predictive pre-configuration mechanism for agent state perception is constructed. The state prediction neural network model is used to predict the evolution trend of agent state and resource demand. Combined with multi-agent reinforcement learning and graph neural network, global collaborative scheduling is carried out to achieve millisecond-level hot migration and dynamic resource supply.
It achieves millisecond-level response of cloud resources, improves resource utilization, reduces cloud service costs, ensures session continuity, solves the problems of resource fragmentation and scheduling lag in traditional solutions, and supports high-concurrency operation of large-scale intelligent agents.
Smart Images

Figure CN122633382A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for dynamic allocation of cloud resources, and more particularly to a method for dynamic allocation of cloud resources based on agent state perception. Background Technology
[0002] With the deep integration of cloud computing and artificial intelligence technologies, intelligent agent systems have been deployed on a large scale in scenarios such as intelligent customer service, code-assisted generation, large-scale data analysis, and autonomous driving decision-making. However, the computational load of intelligent agents exhibits typical pulse-type time-varying characteristics—that is, bursts of high-intensity inference computation followed by long periods of low-activity standby. This characteristic poses a severe challenge to the dynamic adaptability of cloud resources.
[0003] Current mainstream cloud resource configuration solutions mainly include: traditional container orchestration architecture based on Kubernetes (a container orchestration platform), event-driven Serverless function computing mode, and static dedicated resource pool allocation strategy. However, the above solutions all have significant limitations when dealing with the load characteristics of intelligent agents: container orchestration solutions rely on pre-allocated resources and elastic scaling mechanisms, but their response cycle is on the order of minutes, making it difficult to match the millisecond-level state switching needs of intelligent agents, and the measured resource utilization rate is only maintained in the range of 15%-20%; although the Serverless computing paradigm has the advantage of on-demand instantiation, it faces bottlenecks such as high cold start latency (seconds to minutes) and insufficient GPU resource scheduling capabilities, and the frequent creation and destruction of instances cannot effectively maintain the contextual coherence of intelligent agent sessions; the static resource pool strategy is limited by problems such as long resource exclusivity period and large cross-node migration overhead, resulting in serious resource fragmentation and high overall costs.
[0004] The aforementioned technical bottlenecks are essentially manifested in the following ways: a mismatch between the timing of resource supply and load demand, a lag in scheduling response compared to state transitions, difficulty in ensuring session continuity, difficulty in effectively integrating resource fragments, and a lack of forward-looking load prediction mechanisms. These problems severely restrict the coordinated optimization of agent load characteristics and cloud resource billing models, and urgently require systemic breakthroughs in dimensions such as accurate agent state prediction, dynamic and agile resource assembly, millisecond-level hot migration mechanisms, and global collaborative scheduling architecture. Summary of the Invention
[0005] Purpose of the invention: The technical problem to be solved by the present invention is to provide a method for dynamic configuration of cloud resources based on agent state perception, which addresses the shortcomings of the existing technology.
[0006] To address the aforementioned technical problems, this invention discloses a method for dynamic allocation of cloud resources based on agent state awareness, comprising the following steps:
[0007] Step 1: Create a cluster of intelligent agent instances, which contains multiple intelligent agent instances, running in four states: thinking state, reasoning state, tool invocation state, and dormant state.
[0008] Step 2: Construct a state prediction neural network model to predict state evolution trends and resource demand fluctuations based on historical interaction trajectory data of agent instances.
[0009] Step 3: Calculate the priority score of the current server as a migration target based on the prediction results and assemble the sub-source pool;
[0010] Step 4: When the migration triggering conditions are met, perform a four-stage hot migration of the agent instance to achieve dynamic configuration of cloud resources based on agent state awareness.
[0011] Furthermore, the four-stage hot migration of the execution agent instance described in step 4 also includes:
[0012] When migrating agent instances, global collaborative scheduling is performed;
[0013] When conflicts arise during agent instance migration, multi-level priority arbitration is performed.
[0014] Furthermore, the four states of the agent instance are decomposed into four typical stages, represented by a quadruple [T_cpu, T_mem, T_gpu, T_net], where T_cpu represents the CPU core requirement, T_mem represents the memory requirement, T_gpu represents the GPU memory and computing unit requirement, and T_net represents the network bandwidth resource requirement.
[0015] Furthermore, the state prediction neural network model described in step 2 is constructed using LSTM temporal modeling and a Transformer encoder attention mechanism. Its input includes multimodal feature data such as the historical state temporal features of the agent instance, the semantic features of the user's input intent, and the system load status features. The output is the state prediction sequence and confidence interval of the agent instance.
[0016] The state prediction neural network model also includes an online incremental learning mechanism to continuously update the model parameters based on the real-time prediction error.
[0017] Further, in step 3, the priority score of the current server as a migration target is calculated based on the prediction results, including:
[0018] Priority = α × (1 - Fragmentation) + β × GPU Affinity + γ × (1 / Network Latency) + δ × (1 / Current Load)
[0019] Among them, α, β, γ, and δ are weight coefficients that are dynamically configured according to the business scenario.
[0020] Furthermore, the migration triggering conditions described in step 4 include:
[0021] The prediction result is the prediction that the agent will enter a resource-intensive state within a preset time, the current node will have insufficient resources, or a target node whose priority score has been increased beyond a threshold will be detected.
[0022] Furthermore, the four-stage thermal migration described in step 4 includes:
[0023] Phase 1: Use the COW mechanism to capture state snapshots;
[0024] Phase 2: Status data is transmitted via RDMA with zero copy.
[0025] Phase 3 employs a double-buffering mechanism to achieve atomic switching;
[0026] Phase 4: Release source server resources after migration is complete.
[0027] Furthermore, the aforementioned global coordinated scheduling includes:
[0028] A hybrid optimization architecture combining Multi-Agent Reinforcement Learning (MARL) and Graph Neural Networks (GNN) is adopted, employing a centralized training and distributed execution CTDE paradigm. Furthermore, the PPO algorithm is optimized through a proximal policy, achieving collaborative optimization targeting resource utilization, scheduling latency, network overhead, and operational costs.
[0029] In the Multi-Agent Reinforcement Learning (MARL) model, each server node acts as an independent decision-making unit, learning local scheduling strategies based on local resource observation information.
[0030] The graph neural network (GNN) models the topological relationships, network bandwidth constraints, and load dependencies between server nodes. It uses the aggregated neighborhood feature vectors as the global topological awareness input for each multi-agent reinforcement learning (MARL) decision unit, thereby achieving coordination between local decision-making and global constraints.
[0031] Furthermore, the aforementioned execution of multi-level priority arbitration includes:
[0032] When multiple agents compete for node resources concurrently, a four-level arbitration is conducted based on business priority, Bayesian prediction confidence, resource reservation time, and the weighted fair queuing (WFQ) algorithm to resolve conflicts step by step.
[0033] Furthermore, the resource-intensive state includes both the thinking state and the reasoning state.
[0034] Beneficial effects:
[0035] 1. This invention constructs a predictive pre-configuration mechanism based on agent state perception, and coordinates with millisecond-level affinity hot migration technology to compress the minute-level scheduling response latency of passive monitoring triggered in traditional container orchestration schemes to the millisecond level, improving scheduling efficiency by 2-3 orders of magnitude, and effectively solving the scheduling lag problem in scenarios of rapid agent load transition.
[0036] 2. Based on the precise mapping model between the state of the agent and the resource demand, this invention realizes dynamic supply and elastic recycling of resources on demand, significantly improves the average utilization rate of CPU, and increases the utilization rate of GPU from the low range of traditional solutions to the high range. The actual efficiency of resource use is significantly improved, and resource idleness and waste are greatly reduced.
[0037] 3. This invention significantly reduces the resource occupancy cycle of an agent in an idle state through a dynamic resource recycling mechanism based on agent state perception and a collaborative predictive bidding instance scheduling strategy, thereby significantly reducing the overall cost of cloud services and providing a cost-controllable technical path for the large-scale deployment of enterprise agent applications.
[0038] 4. This invention employs incremental snapshot technology in conjunction with a dual-buffered atomic switching mechanism to achieve millisecond-level hot migration of agents across nodes, seamless switching without user awareness, and a session continuity guarantee rate of nearly 100%, completely solving the problems of session interruption and context loss caused by resource scheduling in traditional solutions.
[0039] 5. This invention uses a server-side elastic resource pool dynamic assembly algorithm combined with a NUMA-aware resource allocation strategy to significantly reduce the fragmentation of CPU and memory resources, significantly improve the allocability of large blocks of continuous resources, and significantly improve the resource allocation success rate and overall system throughput.
[0040] 6. This invention constructs a global collaborative scheduling mechanism that supports unified scheduling and management of intelligent agents across nodes, availability zones, and even regions. Combined with the distributed deployment architecture of edge computing nodes, it breaks through the bottleneck of single cluster resource scale and has the elastic expansion capability to support the high-concurrency operation of large-scale intelligent agents. Attached Figure Description
[0041] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.
[0042] Figure 1 This is a schematic diagram of the three-layer coupling architecture of the present invention.
[0043] Figure 2 This is a schematic diagram of the overall process of intelligent agent state transition and resource adaptation in this invention. Detailed Implementation
[0044] This invention proposes a dynamic pre-configuration and affinity migration method for cloud resource pools based on agent state awareness, solving the timing mismatch problem between the pulse-like characteristics of agent load and traditional cloud resource configuration modes. The method constructs a three-level coupled architecture of "agent—resource pool—server node," dividing the agent's lifecycle into four working modes: thinking state, reasoning state, tool invocation state, and dormant state, establishing a dynamic mapping relationship model between state evolution and resource demand. A timing prediction algorithm is used to proactively predict agent state transitions, pre-constructing elastic sub-resource pools on the server node side and completing the dynamic assembly and configuration of resources. When a state switching trigger condition is detected, a millisecond-level affinity hot migration operation is performed to ensure the continuity and integrity of the session context. This invention reduces scheduling response latency from minutes to milliseconds, improves resource utilization by more than three times, and significantly reduces cloud resource rental costs, making it suitable for cloud-native deployment scenarios of large-scale agent clusters.
[0045] like Figure 1 As shown, the method proposed in this invention constructs a three-level coupled architecture of "agent—resource pool—server node". Through deep collaborative linkage of the agent state modeling layer, the server dynamic adaptation layer, and the global collaborative scheduling layer, it achieves adaptive matching between the agent's pulse-type computing load characteristics and the elastic supply capacity of cloud resources, completing predictive resource scheduling and millisecond-level affinity hot migration. The overall architecture of this invention is as follows: Figure 1 As shown, the details are as follows:
[0046] 1. The upper layer is a cluster of intelligent agent instances, which contains multiple intelligent agent instances. Each instance runs in different working modes such as thinking state, reasoning state, tool calling state, and dormant state.
[0047] 2. The middle layer is a cloud resource pool, which is internally divided into multiple elastic sub-resource pools based on a dynamic scheduling strategy;
[0048] 3. The lower layer is a cluster of server nodes, and each server node displays multi-dimensional resource status information such as CPU, GPU, memory and network in real time;
[0049] 4. Inter-layer connections use bidirectional arrows to indicate the information flow between each layer, including interactive information such as agent state feature data, resource adaptation instructions, and affinity migration signals.
[0050] Among them, the agent state modeling layer is based on the agent's full life cycle state space theory. It deconstructs the agent's running trajectory into multiple discrete state stages, extracts multi-dimensional resource feature vector representations for each stage, and uses a deep temporal prediction network to construct a state evolution prediction model to achieve forward-looking inference of state transitions.
[0051] The server dynamic adaptation layer deploys a lightweight resource adaptation proxy module on physical nodes, uses a kernel-level monitoring mechanism to collect local resource status information in real time, establishes a resource status time-series database, and dynamically creates and releases elastic sub-resource pools based on upper-layer scheduling decisions.
[0052] As the system-level decision-making hub, the global collaborative scheduling layer gathers agent state prediction information and server resource pool real-time state data. It solves the global optimal scheduling scheme through multi-objective constraint optimization algorithm, executes affinity migration operations between agents and server nodes, and achieves precise time-series matching between resource demand and supply.
[0053] This invention proposes to decompose the computational state of an intelligent agent into four typical stages, such as... Figure 2 As shown, based on the computational behavior of intelligent agents and the analysis of resource consumption patterns, a precise mapping relationship between state and resource requirements is established. The resource requirements of each stage are quantified using a quadruple (T_cpu, T_mem, T_gpu, T_net). T_cpu represents the CPU core requirement, with a reference value range of [0, 64], comprehensively considering concurrent inference computation, the parallelism of tool execution processes, and system scheduling overhead. T_mem represents the memory requirement, precisely calculating the total amount of model parameter cache, KV cache, context state buffer, tool execution memory, and system reserved space. T_gpu represents the GPU memory and computing unit requirement, supporting the allocation of memory and computing power in scenarios such as multi-GPU parallel inference, tensor parallelism, and pipelined parallelism. T_net represents the network bandwidth requirement, quantifying the network overhead of tool API request and response, external database queries, distributed training data transmission, and multi-agent collaborative communication. The specific mapping relationship is shown in Table 1.
[0054] Table 1 Mapping Relationship Table
[0055]
[0056] The complete process framework for agent state transition is as follows: Figure 2 As shown, the details are as follows:
[0057] 1. The state module contains four core state nodes: thinking state, reasoning state, tool call state, and dormant state. Each state node is labeled with resource requirement feature vectors and server adaptation strategies.
[0058] 2. State transitions are indicated by arrows showing the transition conditions and prediction time windows between states;
[0059] 3. The right-hand module displays the dynamic assembly process of the server resource pool, including resource allocation, release, and migration operations.
[0060] This invention also designs a state prediction neural network architecture that integrates the temporal modeling capabilities of LSTM with the attention mechanism (reference: Liubun Z, Tereshchuk O. LONG SHORT-TERM MEMORY RECURRENT NEURALNETWORK FOR STATE PREDICTION AND RESOURCE ALLOCATION OPTIMIZATION INDISTRIBUTED SYSTEMS[J]. Electronics and information technologies / Електроніка та інформаційні технології, 2026 (33): 87-96.), introduces a Transformer encoder structure to capture long-range temporal dependencies, and realizes the prediction of state evolution trends and resource demand fluctuations within a future time window of 10-30 seconds based on the agent's historical interaction trajectory data.
[0061] The model input adopts a multimodal feature fusion strategy, which includes: historical state temporal features (the state category sequence of the last N rounds of dialogue, the duration of each state, the peak resource consumption and the state transition probability distribution), user intent semantic features (dialogue topic categories extracted by natural language processing technology, task complexity quantification indicators, urgency level classification and intent recognition confidence), and system load status features (current task queue depth, resource utilization rate, network congestion index and scheduling delay indicators).
[0062] The model output includes a state prediction sequence within the future time window, a confidence interval boundary dynamically calculated based on historical prediction accuracy, and a multi-dimensional resource demand prediction vector. It also generates a state transition warning signal 3-10 seconds in advance, reserving a response time window for resource pre-configuration decisions.
[0063] The model training adopts an online incremental learning mechanism, continuously receiving real-time streaming data and iteratively updating network parameters. The prediction error boundary is dynamically calibrated based on historical accuracy using a sliding window statistical method, ensuring that the prediction accuracy continues to converge and optimize as the running cycle extends.
[0064] The server nodes deploy a lightweight resource adaptation proxy module, employing eBPF (extended Berkeley Packet Filter) technology to achieve kernel-level resource monitoring capabilities, and possessing dynamic assembly and release functions for elastic sub-resource pools. The resource adaptation proxy continuously collects multi-dimensional resource metrics from the local machine: CPU metrics include available cores, inter-core affinity topology, scheduling latency, cache hit rate, and dynamic frequency adjustment status; GPU metrics include available video memory capacity, compute unit utilization, multi-GPU interconnect bandwidth (NVLink / PCIe), video memory fragmentation, and tensor core utilization; memory metrics include total available memory, fragmentation level, NUMA node distribution, page swapping rate, and memory bandwidth utilization; and network metrics include bandwidth capacity, transmission latency, concurrent connections, packet loss rate, and TCP connection status. These metrics are integrated to construct a resource status time-series database and are maintained in real-time.
[0065] When the lightweight resource adaptation agent module receives the agent's state prediction signal, the resource adaptation agent calculates the priority score of this server node as a migration target based on a multi-objective weighted model. The calculation formula is as follows:
[0066] Priority = α × (1 - fragmentation) + β × GPU affinity + γ × (1 / network latency) + δ × (1 / current load).
[0067] Among them, the fragmentation index represents the continuity of CPU and memory resources and the availability of large blocks of resources; GPU affinity comprehensively considers the matching degree of video memory capacity, computing architecture compatibility and multi-card interconnection bandwidth; network latency is evaluated by weighted evaluation of RTT (Round-Trip Time) and jitter index; current load is calculated based on resource utilization and queuing latency; α, β, γ and δ are weight coefficients dynamically configured according to business scenarios.
[0068] Based on priority calculation results, servers employ a NUMA-aware strategy to allocate CPU resources to avoid cross-node access overhead. Specifically, high-priority servers automatically adopt the NUMA-aware strategy to begin resource allocation and proceed with subsequent tasks. It supports GPU memory sharing and dynamic MIG (Multi-Instance GPU) partitioning, pre-allocates large blocks of contiguous memory using HugePage technology, and reserves 10%-20% of context expansion space. High-priority network queues are configured for the tool's invocation-state agent based on TC (Traffic Control). After the sub-resource pools are assembled, the resource adaptation agent sends a ready signal to the global scheduler, including metadata such as available time periods, resource capacity details, and ready latency.
[0069] When the predictive model indicates that the agent will enter a resource-intensive state (such as thinking state or reasoning state) within an 8-second time window, the current server node's resource reserves cannot meet the upcoming state requirements, or a better target node is detected (priority score increases by more than a threshold, network latency decreases by more than 30%, or operating costs decrease by more than 20%), the system triggers the agent affinity migration process.
[0070] The migration process adopts an incremental state synchronization technology framework, which is divided into four stages: state snapshot capture, state transmission and recovery, atomic switching and resource release, to ensure the real-time performance and state consistency of the migration operation.
[0071] The state snapshot capture phase adopts incremental snapshot technology based on the COW (Copy-on-Write) mechanism. The captured objects include the dialogue context (including a compressed storage representation of long dialogue history), memory snapshots (inference model parameter cache, KV cache, intermediate calculation result tensors), and process states (thread execution state, file handle table, network connection state, timer state), compressing the snapshot capture latency to less than 20ms.
[0072] The state transfer and recovery phase utilizes RDMA (Remote Direct Memory Access) high-speed network to achieve zero-copy transfer of state snapshots to the target node, and performs memory recovery (direct mapping to the target NUMA node address space), context reconstruction (dialogue history decompression and session state recovery), and connection migration (seamless switching of external connections such as user WebSocket based on TCPMigrate protocol).
[0073] The atomic switching phase employs a double-buffering mechanism. The target node enters a hot standby state, synchronously receives a state snapshot, and warms up the inference model. After the source node completes the processing of the last batch of messages, it seamlessly switches traffic to the target node through a flow control proxy. The entire switching process is transparent to the user and has no service interruption.
[0074] After the switchover is complete, the source node resource pool is automatically released and returned to the allocatable queue. The migration performance metrics achieved are: total migration latency ≤ 50ms, data loss rate 0%, session interruption time 0ms, and 100% memory consistency guarantee.
[0075] As the system-level decision-making hub, the global scheduler employs a hybrid optimization architecture that integrates multi-agent reinforcement learning (MARL) and graph neural networks (GNN) to execute multi-objective constrained scheduling decisions (reference: Hamzeh H. AGMARL-DKS: An Adaptive Graph-Enhanced Multi-Agent Reinforcement Learning for Dynamic Kubernetes Scheduling[J]. arXiv preprint arXiv:2603.12031, 2026.). It simultaneously optimizes the following objective dimensions: maximizing resource utilization efficiency (improving the actual utilization of CPU, GPU, and memory, and the efficiency of resource fragmentation), minimizing scheduling latency (reducing agent resource waiting time and total migration time), minimizing network overhead (reducing cross-node migration traffic and communication latency), and optimizing operational costs (comprehensively considering regional pricing differences, billing models, and bidding instance strategies to select the most cost-effective available nodes).
[0076] The algorithm architecture adopts a centralized training and distributed execution (CTDE) paradigm. Each agent learns local scheduling strategies as an independent decision-making unit, and iteratively optimizes the policy gradient through the PPO (Proximal Policy Optimization) algorithm. The graph neural network models the topological relationships, network bandwidth constraints, and load dependencies between server nodes, capturing resource allocation constraints at the cluster level.
[0077] When multiple agents concurrently compete for the same node resource, a multi-level priority arbitration mechanism is adopted to resolve conflicts: Level 1 arbitration is based on business priority (core business agents such as payment risk control and financial transactions take precedence over ordinary business agents such as content generation and customer service dialogue); Level 2 arbitration is based on prediction confidence (those with higher confidence in state predictions inferred by Bayesian methods are scheduled first); Level 3 arbitration is based on reservation time (those with longer resource pool reservation time get priority in obtaining resources, avoiding resource loss caused by frequent migration); Level 4 arbitration is based on fairness assurance (the weighted fair queuing (WFQ) algorithm is used to ensure the service quality baseline of low-priority agents).
[0078] Compared to existing technologies, this invention improves scheduling efficiency by 2-3 orders of magnitude, reducing the traditional minute-level response time (Kubernetes HPA / VPA elastic scaling response cycle) to millisecond-level (predictive pre-configured collaborative affinity hot migration) in terms of scheduling response latency. Regarding resource utilization efficiency, CPU average utilization is significantly increased, and GPU utilization is improved to a higher level than traditional static resource pool solutions. Idle agent resource usage is significantly reduced through dynamic recycling mechanisms and auction instance scheduling strategies, resulting in a significant decrease in cloud service rental costs. For session continuity assurance, millisecond-level hot migration technology enables seamless session switching without user awareness, achieving a session continuity guarantee rate of nearly 100%, significantly improving user experience quality. In terms of resource fragmentation management, dynamic assembly of elastic sub-resource pools and NUMA-aware allocation strategies significantly reduce resource fragmentation and improve the allocability of large, continuous resources. Regarding system scalability, it supports agent scheduling capabilities across nodes, availability zones, and even regions. Combined with collaborative deployment of edge computing nodes, it overcomes the resource bottleneck of a single cluster and possesses elastic scaling capabilities to support high-concurrency operation of large-scale agents.
[0079] Example 1:
[0080] The technical solution of this invention will be illustrated using a practical e-commerce intelligent customer service application scenario, as detailed below.
[0081] 1. System Configuration:
[0082] (1) Agent scale: 2000 customer service agent instances running concurrently;
[0083] (2) Server cluster: 100 server nodes (single node configuration: CPU 96 cores, 2×GPU A100 80GB, memory 1TB, network bandwidth 25Gbps);
[0084] (3) Deployment environment: Based on Alibaba Cloud Kubernetes container orchestration platform.
[0085] 2. Workflow:
[0086] (1) When a customer initiates a consultation request, the agent enters the "thinking state". The state prediction model identifies the user's intention as an order query category and predicts that it will enter the "tool call state" to execute a database query operation after 5 seconds.
[0087] (2) The global scheduler retrieved the server resource pool and detected that server node #52 has available database connection pool resources. The network latency is 3ms and the overall priority score is the highest.
[0088] (3) Server #52 dynamically assembles sub-resource pool: allocates 4 CPU cores, pre-allocates 2GB of memory capacity, and reserves 1Gbps of bandwidth for the database connection pool;
[0089] (4) The agent performs affinity migration to server #52 with a migration delay of 42ms and no interruption to session continuity;
[0090] (5) The agent enters the "tool call state" to perform a database query operation, completes the order information acquisition, and the processing time is 800ms;
[0091] (6) The state prediction model predicts that the agent will enter the "inference state" to generate a response, and detects that server #33 has 2 free GPU resources;
[0092] (7) The agent migrates to server #33 for the second time, calls the large language model to generate the response content, and the processing time is 1.2 seconds;
[0093] (8) After the user receives the reply, the agent enters a "sleep state". Server #33 releases GPU resources and only retains 512MB of memory resources to maintain the session state.
[0094] 3. Performance Indicators:
[0095] (1) Average response time per consultation: sub-second to several seconds (traditional solutions are in the tens of seconds).
[0096] (2) Concurrency processing capacity: hundreds of QPS (traditional solutions have a capacity of over a hundred QPS);
[0097] (3) Average GPU utilization: Significantly improved to a higher range (traditional solutions are at a lower level);
[0098] (4) Monthly cost of cloud services: significantly lower than traditional solutions, with a clear cost reduction.
[0099] Example 2:
[0100] The above technical solution will be illustrated using a real-world code generation platform application scenario, as detailed below.
[0101] 1. System Configuration:
[0102] (1) Agent scale: 500 code-generated agent instances running concurrently;
[0103] (2) Server cluster: 20 server nodes (single node configuration: CPU 128 cores, 8×GPU A100, memory 2TB, InfiniBand network bandwidth 100Gbps).
[0104] (3) Deployment environment: A private cloud platform built on OpenStack.
[0105] 2. Workflow:
[0106] (1) Developers submit code generation requirements: "Implement the quicksort algorithm in Python and add comments";
[0107] (2) The agent enters the "thinking state", analyzes the complexity of the requirements, and predicts that it will enter the "reasoning state" and will require GPU resources;
[0108] (3) The global scheduler retrieved the server resource pool and found that all 8 GPUs of server #08 were idle, with a resource fragmentation of 5% and a comprehensive priority score of 0.92.
[0109] (4) Server #08 dynamically allocates 4 GPU resources (each GPU is allocated 40GB of video memory), pre-allocates 16GB of memory capacity, and configures GPU interconnect bandwidth of 80Gbps;
[0110] (5) The agent performs affinity migration to server #08, calls the 7 billion parameter code language model to generate Python code, and the processing time is 15 seconds;
[0111] (6) After the code is generated, the agent enters the "tool invocation state" and needs to perform code testing and verification;
[0112] (7) The state prediction model predicts that only CPU resources are needed. The global scheduler retrieves server #15 (CPU utilization 30%, memory resources are sufficient).
[0113] (8) The agent migrates to server #15 for the second time and executes code test operations, which takes 2 seconds;
[0114] (9) After the test is passed, the agent returns the complete code and explanation to the developer.
[0115] 3. Performance Indicators:
[0116] (1) Average code generation processing latency: sub-minute level (the traditional solution is minute level);
[0117] (2) Average GPU utilization: Significantly improved to a higher range (traditional solutions are at a lower level);
[0118] (3) Developer concurrency support capability: hundreds of concurrent users (traditional solutions support tens of concurrent users);
[0119] (4) Monthly cost of cloud services: significantly lower than traditional solutions, with a clear cost reduction.
[0120] In its specific implementation, this application provides a computer storage medium and a corresponding data processing unit. The computer storage medium is capable of storing a computer program, which, when executed by the data processing unit, can run the invention's content regarding a dynamic cloud resource allocation method based on intelligent agent state perception, as well as some or all of the steps in various embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0121] Those skilled in the art will clearly understand that the technical solutions in the embodiments of the present invention can be implemented using computer programs and their corresponding general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of computer programs, i.e., software products. These computer program software products can be stored in a storage medium and include several instructions to cause a device containing a data processing unit (which may be a personal computer, server, microcontroller, MCU, or network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present invention.
[0122] This invention provides a concept and method for dynamic cloud resource allocation based on agent state awareness. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.
Claims
1. A method for dynamic allocation of cloud resources based on agent state awareness, characterized in that, Includes the following steps: Step 1: Create a cluster of intelligent agent instances, which contains multiple intelligent agent instances, running in four states: thinking state, reasoning state, tool invocation state, and dormant state. Step 2: Construct a state prediction neural network model to predict state evolution trends and resource demand fluctuations based on historical interaction trajectory data of agent instances. Step 3: Calculate the priority score of the current server as a migration target based on the prediction results and assemble the sub-source pool; Step 4: When the migration triggering conditions are met, perform a four-stage hot migration of the agent instance to achieve dynamic configuration of cloud resources based on agent state awareness.
2. The cloud resource dynamic allocation method based on agent state awareness according to claim 1, characterized in that, The four-stage hot migration of the execution agent instance described in step 4 also includes: When migrating agent instances, global collaborative scheduling is performed; When conflicts arise during agent instance migration, multi-level priority arbitration is performed.
3. The cloud resource dynamic allocation method based on agent state awareness according to claim 1, characterized in that, The four states of the agent instance are decomposed into four typical stages, represented by a quadruple [T_cpu, T_mem, T_gpu, T_net], where T_cpu represents the CPU core requirement, T_mem represents the memory requirement, T_gpu represents the GPU memory and computing unit requirement, and T_net represents the network bandwidth resource requirement.
4. The cloud resource dynamic allocation method based on agent state awareness according to claim 3, characterized in that, The state prediction neural network model described in step 2 is constructed using LSTM temporal modeling and a Transformer encoder attention mechanism. Its input includes multimodal feature data such as the historical state temporal features of the agent instance, the semantic features of the user's input intent, and the system load status features. The output is the state prediction sequence and confidence interval of the agent instance. The state prediction neural network model also includes an online incremental learning mechanism to continuously update the model parameters based on the real-time prediction error.
5. The cloud resource dynamic allocation method based on agent state awareness according to claim 4, characterized in that, Step 3: Calculate the priority score of the current server as a migration target based on the prediction results, including: Priority = α × (1 - Fragmentation) + β × GPU Affinity + γ × (1 / Network Latency) + δ × (1 / Current Load) Among them, α, β, γ, and δ are weight coefficients that are dynamically configured according to the business scenario.
6. The cloud resource dynamic allocation method based on agent state awareness according to claim 5, characterized in that, The migration triggering conditions mentioned in step 4 include: The prediction result is the prediction that the agent will enter a resource-intensive state within a preset time, the current node will have insufficient resources, or a target node whose priority score has been increased beyond a threshold will be detected.
7. The cloud resource dynamic allocation method based on agent state awareness according to claim 6, characterized in that, The four-stage thermal migration described in step 4 includes: Phase 1: Use the COW mechanism to capture state snapshots; Phase 2: Status data is transmitted via RDMA with zero copy. Phase 3 employs a double-buffering mechanism to achieve atomic switching; Phase 4: Release source server resources after migration is complete.
8. The method for dynamic allocation of cloud resources based on agent state awareness according to claim 7, characterized in that, The aforementioned global coordinated scheduling includes: A hybrid optimization architecture combining Multi-Agent Reinforcement Learning (MARL) and Graph Neural Networks (GNN) is adopted, employing a centralized training and distributed execution CTDE paradigm. Furthermore, the PPO algorithm is optimized through a proximal policy, achieving collaborative optimization targeting resource utilization, scheduling latency, network overhead, and operational costs. In the Multi-Agent Reinforcement Learning (MARL) model, each server node acts as an independent decision-making unit, learning local scheduling strategies based on local resource observation information. The graph neural network (GNN) models the topological relationships, network bandwidth constraints, and load dependencies between server nodes. It uses the aggregated neighborhood feature vectors as the global topological awareness input for each multi-agent reinforcement learning (MARL) decision unit, thereby achieving coordination between local decision-making and global constraints.
9. A method for dynamic allocation of cloud resources based on agent state awareness according to claim 8, characterized in that, The aforementioned multi-level priority arbitration includes: When multiple agents compete for node resources concurrently, a four-level arbitration is conducted based on business priority, Bayesian prediction confidence, resource reservation time, and the weighted fair queuing (WFQ) algorithm to resolve conflicts step by step.
10. A method for dynamic allocation of cloud resources based on agent state awareness according to claim 6, characterized in that, The resource-intensive states mentioned include the thinking state and the reasoning state.