Intelligent agent lightweight deployment method and computing power elasticity distribution method
By building plug-in container packaging tools and multi-architecture compilation engines, combining lightweight runtime environments and secure sandbox containers, the problems of edge node hardware heterogeneity and resource limitations are solved, efficient deployment and flexible computing power allocation are achieved, resource utilization and model accuracy are improved, data leakage is avoided, and dynamic operating conditions of oil and gas wells are adapted to the dynamic operating conditions of oil and gas wells.
Patent Information
- Application Number
- CN202510912684.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-03
AI Technical Summary
The hardware architecture of edge nodes is heterogeneous and resource constraints lead to difficulties in deploying traditional containers. The redundant dependence of AI models increases startup delay, lack of dynamic perception of computing power allocation, low resource utilization, cloud collaborative training has the risk of privacy leakage, and insufficient policy optimization efficiency.
Build a container packaging tool based on a plug-in architecture, use a multi-architecture compilation engine to achieve one-time development and multi-platform deployment, integrate a lightweight runtime environment and secure sandbox container, strip redundant dependencies through static analysis, and dynamically cut models; build a 12-dimensional dynamic state space, use filtering algorithms to reduce noise, introduce a three-dimensional weighted reward model, design an edge cloud collaborative training framework, and protect data privacy.
It realizes efficient and lightweight deployment of edge nodes, optimizes container startup delay, improves resource utilization, ensures model accuracy, avoids data leakage, adapts to dynamic working conditions, and improves the convergence speed of computing power allocation strategies.
Smart Images

Figure CN120407044A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of digital monitoring, and specifically relates to a method for lightweight deployment of agents and a method for elastic allocation of computing power. Background Art
[0002] In the technical field of digital data processing and resource allocation, in edge computing scenarios, such as the deployment of agents and computing power management in oil and gas well sites, multiple challenges are faced.
[0003] In the prior art, edge nodes have the characteristics of heterogeneous hardware architectures and strictly limited resources, resulting in difficulty in achieving one-time development and multi-platform deployment with traditional container deployment methods. Moreover, due to redundant dependencies and unpruned non-critical layers in AI models, the container startup delay increases and the model volume exceeds the hardware's carrying capacity.
[0004] In addition, the existing computing power allocation strategy lacks a dynamic perception mechanism and cannot be adjusted elastically according to the real-time resource status and task priorities of edge nodes, resulting in low resource utilization. When performing collaborative training in the cloud, there is a risk of privacy leakage during the upload of raw data, and the traditional experience replay mechanism has insufficient policy optimization efficiency due to random sampling. The above problems restrict the efficient deployment of edge agents and the refined management of computing power resources.
[0005] Therefore, the present invention provides a method for lightweight deployment of agents and a method for elastic allocation of computing power. Summary of the Invention
[0006] In order to make up for the deficiencies of the prior art and solve at least one of the technical problems proposed in the background art.
[0007] The technical solution adopted by the present invention to solve its technical problems is as follows: In a first aspect, the present invention provides a method for lightweight deployment of agents, including: S1: Construct a container encapsulation tool based on a plug-in architecture, develop a multi-architecture compilation engine, achieve one-time development and multi-platform deployment through underlying virtual machine dynamic compilation technology, design a lightweight runtime environment, integrate a hybrid container of a container runtime tool and a secure sandbox container technology, and optimize the container startup time; S2: Use a static analysis tool to parse the computational graph of the AI model, identify the critical path and non-critical components, automatically strip irrelevant development dependencies through semantic analysis technology, use a tree-like dependency analysis algorithm to reduce redundant library files, and dynamically prune the non-critical layers of the model based on the edge node resource profile data to slim down the model volume while ensuring accuracy; S3: Develop an intelligent resource description language, generate container resource constraint configurations according to the real-time resource status of edge nodes, integrate the Control Group version 2 and the extended Berkeley Packet Filter technology to monitor and limit container-level fine-grained resources, and ensure that the resource occupancy fluctuation of a single container is less than the fluctuation threshold.
[0008] As a further improvement scheme of the present invention: The specific process of constructing the container encapsulation tool based on the plug-in architecture is as follows: Design a standardized plug-in interface, including hardware adaptation, dependency analysis, and image generation modules, to decouple each function. Develop a hardware detection plug-in to automatically identify the CPU architecture, memory capacity, and storage type of edge nodes. Integrate a dependency resolution plug-in to scan the running dependencies of the AI model and generate a minimum dependency list.
[0009] As a further improvement scheme of the present invention: The specific process of developing a multi-architecture compilation engine to achieve one-time development and multi-platform deployment through underlying virtual machine dynamic compilation technology is as follows: Based on the underlying virtual machine dynamic compilation technology, develop a multi-architecture compilation engine. Use the front-end of the underlying virtual machine dynamic compilation technology to convert the AI model code into an intermediate representation to achieve architecture independence. Optimize the IR through the optimizer of the underlying virtual machine dynamic compilation technology for instruction scheduling and loop unrolling optimization. Use the back-end of the underlying virtual machine dynamic compilation technology to generate machine code for the target architecture and support cross-compilation.
[0010] As a further improvement scheme of the present invention: The specific process of designing a lightweight runtime environment and integrating a hybrid container of container runtime tools and secure sandbox container technology is as follows: Use the container runtime tool as the container runtime to be responsible for creating and managing container processes. Integrate secure sandbox container technology to enhance container security through kernel-level isolation. Streamline the container startup process, remove the initialization system, and directly run the application program.
[0011] As a further improvement scheme of the present invention: The specific process of using a static analysis tool to parse the computational graph of the AI model and identify critical paths and non-critical components is as follows: Import the AI model into the static analysis tool to extract the node connections, operation types, and tensor dimensions of the computational graph; The AI model includes, but is not limited to: relevant AI models deployed in oil and gas well sites such as fault detection CNN models and production prediction LSTM models; The static analysis tool includes, but is not limited to: TensorFlow computational graph explorer, Open Neural Network Exchange format model simplifier; Define critical path rules: the longest computational path from the input layer to the output layer, and the core operation nodes on which the output layer depends; Traverse the computational graph through the depth-first search algorithm to mark critical nodes, and the rest are non-critical components; Non-critical components include: redundant debugging layers, duplicate feature fusion modules.
[0012] As a further improvement scheme of the present invention: The specific process of automatically stripping irrelevant development dependencies through semantic analysis technology and reducing redundant library files using a tree-like dependency analysis algorithm is as follows: Parse the model code through the Abstract Syntax Tree (AST), identify development dependencies unrelated to inference, such as logs and visualization libraries; construct a dependency tree, recursively scan the code import statements, and build a tree structure from the model script to the library to the sub-module; traverse the dependency tree, remove the libraries that have no call association with the inference function, and identify development dependencies unrelated to inference.
[0013] In a second aspect, the present invention provides a method for elastic allocation of computing power, including: A1: Construct a 12-dimensional dynamic state space that integrates edge node status, task characteristics, and network environment. Real-time data is collected through lightweight probes deployed on the edge nodes, and a filtering algorithm is used to reduce data noise interference and optimize the state perception accuracy. A2: Use a static analysis tool to parse the computational graph structure of the AI model, introduce a three-dimensional weighted reward model, and quantitatively associate the computational characteristics of the AI model with the benefits of computing power allocation. A3: Design an edge-cloud collaborative training framework. The edge nodes are responsible for local policy execution and experience collection, and the cloud centrally trains the Q network. Federated learning technology is used to protect data privacy, and policy collaboration is achieved through the parameter server architecture. A prioritized experience replay mechanism is introduced to increase the sampling probability of decision-making samples.
[0014] As a further improvement of the present invention: The specific process of constructing the 12-dimensional dynamic state space that integrates edge node status, task characteristics, and network environment is as follows: Integrate three core data dimensions to form a complete decision basis for computing power allocation: Edge node status: CPU utilization rate, remaining memory capacity, energy consumption status, remaining storage space, hardware failure history; Task characteristics: computational volume, latency sensitivity, task priority, number of model parameters; Network environment: current bandwidth, packet loss rate, end-to-end latency.
[0015] As a further improvement of the present invention: The specific process of optimizing the state perception accuracy is as follows: Deploy a non-intrusive probe on the edge node, that is, a non-intrusive probe based on extended Berkeley packet filtering technology, to obtain 12-dimensional data and avoid additional computing power consumption caused by high-frequency collection. Among them, the probe adopts a plug-in design, supports reading the hardware status of edge nodes with different architectures, and is compatible with the heterogeneous device environment of oil and gas well sites. Smooth the original data using a 60-second sliding time window. The specific steps are as follows: Remove extreme values from the data within the window, calculate the mean value within the window as the state value at the current moment, the window slides with time, and discard the earliest 1 second of data and add the latest 1 second of data each time it is updated.
[0016] As a further improvement of the present invention, the specific process of introducing a three-dimensional weighted reward model to quantitatively associate the AI model computing characteristics with the computing power distribution benefits is as follows: Based on the model characteristics analyzed from the computational graph, a three-dimensional reward system based on latency, cost, and reliability is constructed to transform the abstract computing power allocation target into calculable numerical benefits. Specifically, a three-dimensional weighted reward model is constructed, and the delay sensitivity coefficient is set according to the task type. ,For highly sensitive tasks such as fault detection, setting , for the delay deviation, that is: Give higher penalties for regular tasks , allowing larger delay fluctuations; Design reward calculation: , when the actual delay ≤ target delay, the reward value approaches , otherwise it decays exponentially; Perform cost-incentive calculations; For cloud computing power fees, according to the call duration and unit price calculate, ; The edge energy consumption cost is dynamically adjusted in combination with the energy type. ; Cost Reward Calculation: , the lower the cost, the closer the reward value is to 1; Reliability reward design based on the number of edge node downtimes in the past 24 hours , calculate the trust , The maximum number of downtimes in history; Node stability reward mapping: ; Perform weighted fusion to obtain the total reward, , where the weight , which means that latency takes precedence over cost and reliability, and is automatically adjusted through a meta-learning framework based on the execution effect of historical allocation strategies. ratio to adapt to changes in well site working conditions.
[0017] The beneficial effects of the present invention are as follows: 1. Through plug-in container packaging tools and a multi-architecture compilation engine, one-time development and multi-platform deployment are achieved, solving the problem of heterogeneous edge node hardware and adapting to heterogeneous equipment environments in scenarios such as oil and gas well sites. The lightweight runtime environment combines resource isolation technology to optimize the container startup process, removing the initialization system and running applications directly, reducing startup latency compared to traditional solutions. Through computational graph analysis, dependency stripping, and dynamic pruning, the model size is reduced with an accuracy loss of ≤3%, adapting to the resource constraint of ≤2GB of memory on edge nodes.
[0018] 2. Integrate the extended Berkeley Packet Filter technology with Control Group version 2, collect resource data at a 100ms cycle, achieve fine-grained control of CPU time slices and memory limits, and ensure that the resource fluctuations of a single container are ≤ 5%. The intelligent resource description language is dynamically adjusted according to the real-time status of nodes and task priorities to improve resource utilization. The 12-dimensional dynamic state space is combined with a three-dimensional weighted reward model to quantify the benefits of computing power allocation and ensure the priority of latency-sensitive tasks.
[0019] 3. Edge nodes only upload the Q-network gradients instead of the original data. The cloud aggregates and updates the global model, avoiding wellsite data leakage at the technical level. The prioritized experience replay mechanism increases the sampling probability of high-value experiences. Combined with the edge-cloud collaborative training framework, it accelerates the convergence of the computing power allocation strategy to adapt to the dynamic working conditions of the wellsite. The lightweight probe uses a non-intrusive acquisition and filtering algorithm to optimize the state perception accuracy. The 60-second sliding window smoothing process reduces data noise, providing a reliable basis for decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The present invention will be further described below with reference to the accompanying drawings.
[0021] Figure 1 is the flowchart of the steps of the lightweight deployment method of the intelligent agent of the present invention; Figure 2 is the flowchart of the steps of the elastic computing power allocation method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] In order to make the technical means, creative features, achieved purposes and effects of the present invention easy to understand, the present invention will be further described below in conjunction with specific embodiments.
[0023] Embodiment 1 As Figure 1 shown, the lightweight deployment method of the intelligent agent described in the embodiment of the present invention includes: S1: Build a container encapsulation tool based on a plug-in architecture, develop a multi-architecture compilation engine, achieve one-time development and multi-platform deployment through underlying virtual machine dynamic compilation technology, design a lightweight runtime environment, integrate a hybrid container of container runtime tools and secure sandbox container technology, and optimize the container startup time; The specific process of building the container encapsulation tool based on a plug-in architecture is: Adopt a modular design, dynamically load plugins through a configuration file, and support users to customize and extend hardware adaptation rules to ensure that the encapsulation tool is compatible with different edge nodes; Specifically, a standardized plug-in interface is designed, including a hardware adaptation, dependency analysis, and image generation module, to decouple each function. A hardware detection plug-in is developed to automatically identify the CPU architecture, memory capacity, and storage type of edge nodes. A dependency resolution plug-in is integrated to scan the running dependencies of AI models and generate a minimum dependency list. However, the code of the agent within the container needs to break through the hardware architecture barrier to truly achieve one-time encapsulation and multi-platform deployment through containers. Therefore, it is necessary to rely on multi-architecture compilation engine technology to convert the agent code into an executable file adapted to heterogeneous hardware. The specific process of developing a multi-architecture compilation engine to achieve one-time development and multi-platform deployment through underlying virtual machine dynamic compilation technology is as follows: Specifically, based on the underlying virtual machine dynamic compilation technology, a multi-architecture compilation engine is developed. The front-end of the underlying virtual machine dynamic compilation technology is used to convert the AI model code into an intermediate representation (IR) to achieve architecture independence. The IR is optimized for instruction scheduling and loop unrolling by the optimizer of the underlying virtual machine dynamic compilation technology. The back-end of the underlying virtual machine dynamic compilation technology generates machine code for the target architecture to support cross-compilation. The multi-architecture machine code generated by compilation needs to run efficiently under the resource constraints and security requirements of edge nodes in oil and gas well sites. Therefore, it is necessary to design and build a lightweight container runtime environment to perform resource isolation, fast startup, and secure encapsulation on the compiled agent code. The specific process of designing a lightweight runtime environment and integrating a hybrid container of container runtime tools and secure sandbox container technology is as follows: Resource isolation is achieved through Linux namespaces and control groups. CPU and memory resources are pre-allocated to reduce the system call overhead during startup. Specifically, the container runtime tool is used as the container runtime to create and manage container processes. The secure sandbox container technology is integrated to enhance container security through kernel-level isolation, streamline the container startup process, remove the initialization system, and directly run the application. Through the plug-in container encapsulation tool, it adapts to heterogeneous edge nodes. The multi-architecture compilation engine relies on LLVM to break through the hardware barrier to achieve cross-platform deployment. The lightweight runtime integrates runtime tools and secure sandbox container technology and ensures high efficiency and security through resource isolation technology. The three work together to solve the problems of edge hardware adaptation, code cross-architecture compatibility, and resource limitation, achieve one-time development and multi-terminal deployment of the agent, optimize the container startup and running performance, and lay a foundation for the efficient deployment of edge agents in oil and gas well sites.
[0024] S2: Use a static analysis tool to parse the computational graph of the AI model, identify the critical path and non-critical components, automatically strip irrelevant development dependencies through semantic analysis technology, adopt a tree-like dependency analysis algorithm to reduce redundant library files, and dynamically prune non-critical layers of the model based on the edge node resource profile data to slim down the model size while ensuring accuracy; Specifically, the specific process of using a static analysis tool to parse the computational graph of the AI model and identify the critical path and non-critical components is as follows: Import the AI model into the static analysis tool, and extract the node connections, operation types, and tensor dimensions of the computational graph; the AI model includes, but is not limited to, relevant AI models deployed in oil and gas well sites such as fault detection CNN models and production prediction LSTM models; the static analysis tool includes, but is not limited to, TensorFlow computational graph explorer and Open Neural Network Exchange format model simplifier; Define the critical path rule: the longest computational path from the input layer to the output layer, and the core operation nodes on which the output layer depends; traverse the computational graph through the depth-first search algorithm, mark the critical nodes, and the rest are non-critical components; non-critical components include: redundant debugging layers and duplicate feature fusion modules; Exemplarily, let the node set of the computational graph be N, the edge be the dependency relationship E, and the node computational volume be. The critical path P satisfies: , screen the path with the largest computational volume to ensure that the core of the inference performance is retained; The structural lightweighting of the computational graph only solves the internal operation redundancy of the model. The development dependencies loaded during its operation, such as the logging library and the model visualization module, will still occupy the edge node resources. The memory of the edge nodes in oil and gas well sites is usually ≤2GB. Redundant dependencies can increase the container startup delay by more than 30%. Therefore, it is necessary to further strip the library files irrelevant to inference from the code dependency level to build a lightweight running environment for the agent; The specific process of automatically stripping irrelevant development dependencies through semantic analysis technology and adopting a tree-like dependency analysis algorithm to reduce redundant library files is as follows: Parse the model code through the Abstract Syntax Tree (AST) to identify development dependencies irrelevant to inference, such as logging and visualization libraries; build a dependency tree, recursively scan the code import statements, and build a tree-like structure from the model script to the library to the sub-module; traverse the dependency tree, remove the libraries that have no call association with the inference function, and identify the development dependencies irrelevant to inference; Exemplarily, let the total number of nodes in the dependency tree be , the number of valid dependency nodes be , and the redundancy ratio be : , set the redundancy ratio to be greater than or equal to 0.5, that is, strip at least 50% of the development dependencies irrelevant to inference; Dependency stripping achieves redundancy reduction at the code level, but the structural complexity and resource consumption during model inference are still limited by the hardware capabilities of edge nodes, such as memory ≤ 1GB and CPU computing power fluctuations. Therefore, it is necessary to combine the resource profile data collected in real time by edge nodes to dynamically prune the non-critical layers of the model, further compress the model volume while ensuring a certain accuracy loss, and adapt to the edge resource constraints; The specific process of dynamically pruning the non-critical layers of the model based on the resource profile data of edge nodes and slimming down the model volume while ensuring accuracy is as follows: Specifically, real-time resources of edge nodes are obtained through the extended Berkeley Packet Filtering technology. The real-time resources include CPU utilization rate and remaining memory. Dynamically prune the non-critical layers of the model, combine the computational graph, and mark the layers whose inference results change by less than or equal to the threshold after removal, so as to slim down the model volume while ensuring accuracy, compress the model volume according to resource constraints, and monitor the accuracy loss at the same time. Model volume constraints: ; Monitor accuracy loss: ; Build a lightweight architecture system, lock the inference core through computational graph analysis, strip more than 50% of redundant dependencies through semantic analysis, dynamically prune the model in combination with edge resources, compress the volume when the accuracy loss ≤ 3%, and adapt to the resource constraints of edge nodes in oil and gas well sites, laying a solid foundation for the efficient deployment of agents and elastic allocation of computing power; S3: Develop an intelligent resource description language, generate container resource constraint configurations according to the real-time resource status of edge nodes, integrate the Control Group v2 and the extended Berkeley Packet Filtering technology, and monitor and limit the fine-grained resources at the container level to ensure that the resource occupancy of a single container fluctuates less than the fluctuation threshold.
[0025] Specifically, the specific process of developing the intelligent resource description language and generating container resource constraint configurations according to the real-time resource status of edge nodes is as follows: Use declarative rules to define the mapping logic between edge node resources and container constraints. The mapping logic is as follows: First, set the basic mapping logic rules. The basic mapping logic directly associates the idle resources of edge nodes with container quotas. Among them, mapping logic 1 is: , mapping logic 2 is: ; In the present invention, the allocation coefficient is 0.8 and the limit coefficient is 0.7; Set resource thresholds to trigger adjustments. When the CPU usage rate of the node exceeds 80%, the CPU quota of the container is automatically reduced by 10% to give priority to ensuring node resource allocation; Set the task level priority rule, that is, tasks related to fault detection are given priority in resource allocation; The specific process of the integrated control group second edition and the extended Berkeley packet filtering technology for fine-grained resource monitoring and restriction at the container level to ensure that the resource occupancy fluctuation of a single container is less than the fluctuation threshold is as follows: Using the extended Berkeley packet filtering technology, core resource profile data is collected at a period of 100 ms. The resource profile data includes: CPU idle rate, number of CPU cores, CPU instantaneous usage rate, remaining memory capacity, proportion of memory page cache, remaining storage space, storage IO read and write throughput; The extended Berkeley packet filtering technology adopts kernel-level non-invasive collection. Compared with traditional tools, it optimizes the collection accuracy of resource profile data and adapts to performance-sensitive scenarios of edge nodes; Using the edge node resource description language engine to load predefined syntax rules, substituting the collected real-time resource profile data for calculation. When there are conflicts among the basic mapping logic, resource threshold trigger adjustment rules, and task level priority rules, the resource requirements of critical tasks are preferentially satisfied, and then the remaining resources are scheduled; The resource requirements of the critical tasks include: equipment fault detection, that is, a model for real-time identification of abnormal oil well equipment through an AI model to avoid shutdown accidents, and dynamic production prediction, that is, a model for analyzing the oil well production trend through an AI model to guide production scheduling, etc.; Convert the calculation result into the standard configuration format of the control group second edition and inject it into the container through the container runtime to achieve: fine-grained CPU control, rigid memory constraint, and resource isolation optimization; Among them, the fine-grained control is: restricting the proportion of CPU time slices occupied by the container, the rigid memory constraint is: setting an upper limit for memory usage, and the resource isolation optimization is: binding specific CPU cores through the CPU core set and optimizing memory access through the memory non-uniform access policy to reduce resource competition among containers; The extended Berkeley packet filtering technology collects container resource profile data with a precision of 1 ms and calculates the resource fluctuation degree within a 60-second sliding window. The resource fluctuation degree is: , if the fluctuation degree is greater than or equal to the fluctuation threshold, the edge node resource description language re-parses the rules; triggering the following parsing rules: If there is memory fluctuation, enable the memory high water mark mechanism to trigger page recycling and cooperate with the extended Berkeley packet filtering technology to locate memory leak processes; If there is CPU fluctuation, lower the upper limit threshold of the CPU time slice; It should be noted that the memory high water mark mechanism is the built-in dynamic memory regulation ability of the Linux control group second edition. When the container memory occupancy approaches this threshold, the system will asynchronously recycle idle memory pages to avoid sudden spikes in memory occupancy to the limit, smooth the fluctuation curve of memory occupancy, and prevent container service interruption caused by memory mutations; The CPU time slice upper limit is a quantitative constraint measure for container CPU resources in the second version of the Linux control group. It forcibly compresses the instantaneous peak occupancy of the CPU by restricting the proportion of CPU time that a container can use per unit time, and effectively reduces the fluctuations at the CPU scheduling level when multiple containers compete for CPU cores, making resource usage smoother; Ultimately, it ensures that the resource occupancy fluctuation of a single container is less than or equal to the fluctuation threshold, providing a stable operating environment for the agent; The fluctuation threshold is set to 5% in the present invention; Embodiment 2 As Figure 2 shown, based on Embodiment 1, the computing power elastic allocation method described in the embodiment of the present invention includes: A1: Construct a 12-dimensional dynamic state space that integrates edge node status, task characteristics, and network environment, collect data in real time through lightweight probes deployed on the edge nodes, and use filtering algorithms to reduce data noise interference and optimize the state perception accuracy; To provide accurate and reliable decision-making basis for computing power elastic allocation, it is necessary to construct a dynamic perception system covering resource supply to computing power demand and then to transmission constraints, and realize the real-time characterization of the complex well site conditions through multi-dimensional state definition and lightweight acquisition and purification; The specific process of constructing the 12-dimensional dynamic state space that integrates edge node status, task characteristics, and network environment is as follows: Integrate three core data dimensions to form a complete decision-making basis for computing power allocation: Edge node status: CPU utilization rate, remaining memory capacity, energy consumption status, remaining storage space, hardware failure history; Task characteristics: computational complexity, latency sensitivity, task priority, number of model parameters; Network environment: current bandwidth, packet loss rate, end-to-end latency; To achieve accurate decision-making for computing power elastic allocation, it is necessary to construct a dynamic perception system covering resource supply to task demand and network constraints, which is specifically divided into two collaborative links: data collection and data purification; The specific process of using the filtering algorithm to reduce noise interference and optimize the state perception accuracy by collecting data in real time through lightweight probes deployed on the edge nodes is as follows: Deploy non-intrusive probes on the edge nodes, that is: non-intrusive probes based on extended Berkeley packet filtering technology, and collect the above 12-dimensional data in real time with a 100ms cycle to avoid additional computing power consumption caused by high-frequency collection; Among them, the probe adopts a plug-in design, supports reading the hardware status of edge nodes with different architectures, and is compatible with the heterogeneous device environment of oil and gas well sites; The original data is smoothed using a 60 - second sliding time window. The specific steps are as follows: extreme values are removed from the data within the window, the mean value within the window is calculated as the state value at the current moment, the window slides with time, and each time it is updated, the earliest 1 - second data is discarded and the latest 1 - second data is added; A 12 - dimensional dynamic state space is constructed, integrating three types of data: nodes, tasks, and networks. After being collected by lightweight probes and purified by filtering algorithms, the well site working conditions are accurately characterized, laying a solid data foundation for elastic allocation of computing power.
[0026] A2: Use a static analysis tool to parse the computational graph structure of the AI model, introduce a three - dimensional weighted reward model, and quantitatively correlate the computational characteristics of the AI model with the benefits of computing power allocation; To make the computing power allocation strategy accurately match the requirements of the AI model, it is necessary to first analyze the computational characteristics of the model, then construct a benefit quantification system, and realize the association from model requirements to allocation strategy and then to benefit feedback. Specifically, it is divided into two collaborative links: computational graph parsing and three - dimensional reward modeling; Specifically, the specific process of using a static analysis tool to parse the computational graph structure of the AI model is as follows: To clarify the computing power consumption law of the AI model in the oil and gas well site, a static analysis tool is used to disassemble the model structure: Use the TensorFlow computational graph explorer model simplifier to import the AI model of the oil and gas well site, and extract the node connection relationship, operation type, and tensor dimension information of the computational graph; Through parsing, identify the key path of the model's computing power consumption, providing a demand anchor point for the subsequent reward model; The specific process of introducing a three - dimensional weighted reward model and quantitatively correlating the computational characteristics of the AI model with the benefits of computing power allocation is as follows: Based on the model characteristics parsed from the computational graph, construct a three - dimensional reward system of latency, cost, and reliability, and transform the abstract computing power allocation goal into a computable numerical benefit; Specifically, construct a three - dimensional weighted reward model, and set the latency sensitivity coefficient according to the task type For highly sensitive tasks, such as fault detection, set , for the latency deviation, that is: Assign a higher penalty, and for regular tasks, set , allowing a larger latency fluctuation; Design the reward calculation: , when the actual latency ≤ the target latency, the reward value approaches , otherwise it decays exponentially; Conduct the cost reward calculation; For the cloud computing power cost, calculate according to the call duration and the unit price , ; Dynamically adjust the edge energy consumption cost in combination with the energy type, ; Cost reward calculation: , the lower the cost, the closer the reward value is to 1; Reliability reward design, based on the number of outages of edge nodes in the past 24 hours , calculate the trust level , is the historical maximum number of outages; Node stability reward mapping: ; Perform weighted fusion to obtain the total reward, , where the weight , that is, latency takes precedence over cost and reliability, and is automatically adjusted through the meta-learning framework according to the execution effect of the historical allocation strategy ratio to adapt to the changes in wellsite working conditions; First, use static tools to parse the AI model calculation graph to clarify the key path of computing power consumption, then construct a three-dimensional reward system for latency, cost, and reliability, quantify the allocation benefits, realize the association between model characteristics and policy benefits, adjust the weights through meta-learning, adapt to wellsite working conditions, and provide accurate guidance for computing power allocation.
[0027] A3: Design an edge-cloud collaborative training framework. Edge nodes are responsible for local policy execution and experience collection. The cloud centrally trains the Q network, uses federated learning technology to protect data privacy, realizes policy collaboration through the parameter server architecture, and introduces a prioritized experience replay mechanism to increase the sampling probability of decision-making samples; To make the computing power allocation strategy continuously adapt to the dynamic working conditions of the wellsite, it is necessary to construct a collaborative framework for edge execution feedback and cloud training optimization, that is: edge nodes are responsible for policy implementation and experience collection, the cloud focuses on privacy protection training and policy iteration, and realizes the intelligent evolution of the computing power allocation strategy through federated learning combined with prioritized replay and parameter synchronization, which is specifically divided into three collaborative links; The specific process in which the edge nodes are responsible for local policy execution and experience collection and the cloud centrally trains the Q network is as follows: The edge node receives the Q network policy issued by the cloud, that is, the value network in reinforcement learning, and calls the control group second edition and the extended Berkeley packet filtering tool to convert the policy into container resource constraints to drive the AI model inference; The edge computing node conducts experience collection and records the collected content as state (s): 12-dimensional dynamic state space data, action (a): the actually executed computing power allocation strategy, reward (r): the total reward obtained through weighted fusion, and the next state : After executing the policy, the resource state and task result of the edge node; The edge node locally establishes a circular buffer to cache the most recent 1000 experience data, avoiding memory overflow; at the same time, it marks high-value experiences, that is, samples with a reward value r greater than the threshold, and gives priority to uploading them to the cloud; The specific process of using federated learning technology to protect data privacy, realizing policy collaboration through the parameter server architecture, and introducing the prioritized experience replay mechanism to increase the sampling probability of decision-making samples is as follows: The edge node only uploads the model parameter gradients, that is, the weight update amount of the Q network, rather than the original wellsite data. The cloud aggregates the gradients of multiple nodes to update the global Q network, avoiding data leakage at the technical level; Let the local gradient of edge node i be , and the cloud aggregates through weighted average , where is the node data volume; The cloud deploys a parameter server cluster, which is responsible for storing the global Q network parameters, receiving the edge node gradients, and issuing the updated policies; The collaboration mechanism adopts asynchronous update and version control. The edge node can independently pull the policy, avoiding waiting for the global training to complete. At the same time, through version number verification, it ensures that the executed policy is not expired; The method for determining an unexpired policy is: when the difference between the version numbers is greater than 3, it is considered an expired policy, and synchronization is forced; Prioritized experience replay accelerates convergence. Traditional experience replay randomly samples, resulting in high-value experiences, that is, strategies that successfully reduce latency being buried. After introducing prioritized experience replay, the priority p of the experience is calculated, which is positively correlated with the reward value r, that is: p = exp(r); Sampling is performed according to the priority probability, and the sampling probability of high-value experiences is increased to 3 times, allowing the Q network to preferentially learn effective strategies and optimizing the convergence speed; Build an edge-cloud collaborative training framework. The edge node accurately implements the policy and collects feedback experiences; the cloud uses federated learning to protect privacy, the parameter server efficiently synchronizes the policy, and the prioritized experience replay accelerates convergence, forming a closed loop of perception, decision-making, optimization, and feedback, enabling the policy to dynamically adapt to the wellsite conditions and enhancing the agent's response ability.
[0028] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art of this industry should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have various changes and improvements, and these changes and improvements all fall within the scope of the present invention claimed. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.
Claims
1. An intelligent agent lightweight deployment method, characterized in that: Including: S1: Build a container encapsulation tool based on a plug-in architecture, develop a multi-architecture compilation engine, achieve one-time development and multi-platform deployment through underlying virtual machine dynamic compilation technology, design a lightweight runtime environment, integrate a hybrid container of container runtime tools and secure sandbox container technology, and optimize the container startup time; S2: Use a static analysis tool to parse the computational graph of the AI model, identify critical paths and non-critical components, automatically strip irrelevant development dependencies through semantic analysis technology, use a tree-like dependency analysis algorithm to reduce redundant library files, and dynamically prune non-critical layers of the model based on edge node resource profile data to slim down the model size while ensuring accuracy; S3: Develop an intelligent resource description language, generate container resource constraint configurations according to the real-time resource status of edge nodes, integrate Control Group version 2 and extended Berkeley Packet Filter technology to monitor and limit container-level fine-grained resources, and ensure that the resource occupancy fluctuation of a single container is less than the fluctuation threshold.
2. The method for lightweight deployment of an agent according to claim 1, wherein: The specific process of building the container encapsulation tool based on the plug-in architecture is as follows: Design a standardized plug-in interface, including hardware adaptation, dependency analysis, and image generation modules, to decouple each function. Develop a hardware detection plug-in to automatically identify the CPU architecture, memory capacity, and storage type of edge nodes, and integrate a dependency resolution plug-in to scan the runtime dependencies of the AI model and generate a minimum dependency list.
3. The intelligent agent lightweight deployment method according to claim 1, wherein: The specific process of developing a multi-architecture compilation engine to achieve one-time development and multi-platform deployment through underlying virtual machine dynamic compilation technology is as follows: Based on the underlying virtual machine dynamic compilation technology, develop a multi-architecture compilation engine. Use the front-end of the underlying virtual machine dynamic compilation technology to convert the AI model code into an intermediate representation to achieve architecture independence. Use the optimizer of the underlying virtual machine dynamic compilation technology to perform instruction scheduling and loop unrolling optimization on the IR. Use the backend of the underlying virtual machine dynamic compilation technology to generate machine code for the target architecture and support cross-compilation.
4. The intelligent agent lightweight deployment method according to claim 1, wherein: The specific process of designing a lightweight runtime environment and integrating a hybrid container of container runtime tools and secure sandbox container technology is as follows: Use the container runtime tool as the container runtime to be responsible for creating and managing container processes. Integrate secure sandbox container technology to enhance container security through kernel-level isolation, streamline the container startup process, remove the initialization system, and directly run the application program.
5. The intelligent agent lightweight deployment method according to claim 1, characterized in that: The specific process of using a static analysis tool to parse the computational graph of the AI model and identify critical paths and non-critical components is as follows: Import the AI model into the static analysis tool to extract the node connections, operation types, and tensor dimensions of the computational graph; the AI model includes, but is not limited to, relevant AI models deployed in oil and gas well sites such as fault detection CNN models and production prediction LSTM models; the static analysis tool includes, but is not limited to, TensorFlow computational graph explorer and Open Neural Network Exchange format model simplifier; Define the critical path rule: the longest computational path from the input layer to the output layer, and the core operation nodes on which the output layer depends; Traverse the computational graph through the depth-first search algorithm to mark the critical nodes, and the rest are non-critical components; non-critical components include: redundant debugging layers, repeated feature fusion modules.
6. The method for lightweight deployment of an agent according to claim 1, wherein: The specific process of automatically stripping irrelevant development dependencies through semantic analysis technology and reducing redundant library files using a tree-like dependency analysis algorithm is as follows: Parse the model code through an Abstract Syntax Tree (AST) to identify development dependencies irrelevant to inference, such as logging and visualization libraries; construct a dependency tree, recursively scan the code import statements, and build a tree-like structure from the model script to the library to the sub-module; Traverse the dependency tree, remove libraries that have no call association with the inference function, and identify development dependencies irrelevant to inference.
7. Method for elastic allocation of computing power, characterized in that: Including: A1: Construct a 12-dimensional dynamic state space that integrates edge node status, task characteristics, and network environment, collect data in real-time through lightweight probes deployed on the edge nodes, use filtering algorithms to reduce data noise interference, and optimize the state perception accuracy; A2: Use static analysis tools to parse the computational graph structure of the AI model, introduce a three-dimensional weighted reward model, and quantitatively associate the computational characteristics of the AI model with the benefits of computing power allocation; A3: Design an edge-cloud collaborative training framework. The edge nodes are responsible for local policy execution and experience collection, the cloud centrally trains the Q network, uses federated learning technology to protect data privacy, realizes policy collaboration through a parameter server architecture, and introduces a prioritized experience replay mechanism to increase the sampling probability of decision-making samples.
8. The computing power elastic allocation method according to claim 7, wherein: The specific process of constructing a 12-dimensional dynamic state space that integrates edge node status, task characteristics, and network environment is as follows: Integrate three core data dimensions to form a complete decision basis for computing power allocation: Edge node status: CPU utilization rate, remaining memory capacity, energy consumption status, remaining storage space, hardware failure history; Task characteristics: computational volume, latency sensitivity, task priority, number of model parameters; Network environment: current bandwidth, packet loss rate, end-to-end latency.
9. The computing power elastic allocation method according to claim 7, wherein: The specific process of optimizing the state perception accuracy is as follows: Deploy a non-intrusive probe on the edge node, that is, a non-intrusive probe based on extended Berkeley packet filtering technology, to obtain 12-dimensional data and avoid additional computing power consumption caused by high-frequency collection; Among them, the probe adopts a plug-in design, supports reading the hardware status of edge nodes with different architectures, and is compatible with the heterogeneous device environment of oil and gas well sites; Use a 60-second sliding time window to smooth the original data. The specific steps are: remove extreme values from the data within the window, calculate the mean value within the window as the state value at the current moment, the window slides with time, and discard the earliest 1 second of data and add the latest 1 second of data each time it is updated.
10. The computing power elastic allocation method according to claim 7, wherein: The specific process of introducing a three-dimensional weighted reward model and quantitatively associating the computational characteristics of the AI model with the benefits of computing power allocation is as follows: Based on the model characteristics parsed from the computational graph, construct a three-dimensional reward system for latency, cost, and reliability, and transform the abstract computing power allocation goal into a computable numerical benefit; Specifically, a three-dimensional weighted reward model is constructed, and the time-delay sensitivity coefficient is set according to the task type. , for highly sensitive tasks, such as fault detection, set , for the time-delay deviation, that is: higher penalties are imposed, and for regular tasks, set , allowing for larger time-delay fluctuations; Design reward calculation: , when the actual delay ≤ the target delay, the reward value approaches , otherwise it decays exponentially; Perform cost reward calculation; For the cloud computing power cost, calculate according to the call duration and the unit price , ; Dynamically adjust the edge energy consumption cost in combination with the energy type, ; Cost reward calculation: , the lower the cost, the closer the reward value approaches 1; Reliability reward design, based on the number of outages of edge nodes in the past 24 hours , calculate the trust level , is the historical maximum number of outages; Node stability reward mapping: ; Perform weighted fusion to obtain the total reward, , where the weight , that is, latency takes precedence over cost and reliability, and the ratio of is automatically adjusted through a meta-learning framework according to the execution effect of the historical allocation strategy to adapt to the changes in wellsite working conditions.
Citation Information
Patent Citations
An ontology-based intelligent controller machine learning algorithm module formalized description and packaging method
CN109933307A
Secure container isolation method and device based on MIPS64 instruction set
CN114253655A
Task processing method of edge computing system and related equipment
CN117009053A
Compiling method and device and computer readable storage medium
CN118796196A
AI model acceleration method and acceleration system applied to ultra-high-definition 8k video
CN118823654A
Cited By
Database installation and deployment method based on MCP protocol
CN120743299A
Resource management method for containerization deployment of urban rail equipment
CN120743436A
Lightweight AUTOSAR architecture multi-core optimization method for domestic chip
CN120849132A
Multi-architecture compilation intermediate representation generation method and system driven by heterogeneous computing power fusion
CN120849133A
Isomeric computing power fusion driven multi-architecture compilation intermediate representation generation method and system
CN120849133B