Method and system for dynamic monitoring and tuning of artificial intelligence sandbox environment
By constructing directed dependency graphs and performing loop dependency analysis, the origins and propagation paths of anomalies in the AI sandbox environment are accurately located. This solves the problem of resource adjustment lag under static threshold monitoring, achieves efficient and fair resource allocation, and improves the overall service quality and resource utilization of the sandbox environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SHANGYUN DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2026-02-11
- Publication Date
- 2026-07-03
AI Technical Summary
In existing technologies, static threshold monitoring in AI sandbox environments is difficult to adapt to dynamic load characteristics, resulting in frequent or delayed resource adjustments, inability to accurately locate the origin of anomalies and their propagation paths, low optimization efficiency, and unstable results.
By constructing a directed dependency graph, the system traces back the starting node of an anomaly and traverses the propagation path of its impact in the forward direction, generating anomaly feature vectors, extracting root cause dimension information, and performing segmented clustering. Based on loop dependency analysis, the system divides resource adjustment requirements and optimizes resource allocation ratios.
It enables data-driven predictability for precise anomaly localization and resource adjustment, improves the efficiency and accuracy of optimization, ensures fair and efficient resource allocation in multi-model concurrent scenarios, and suppresses the impact of single-model anomalies on the overall environment.
Smart Images

Figure CN122020639B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence security technology, and in particular to a method and system for dynamic monitoring and optimization of an artificial intelligence sandbox environment. Background Technology
[0002] In the field of artificial intelligence model development and testing, sandbox environments are widely used to isolate and run models to evaluate their performance, security, and resource consumption. Existing technologies typically rely on static or threshold-triggered monitoring of the sandbox environment. The common practice is to deploy a separate monitoring agent to periodically collect basic resource metrics such as CPU utilization, memory usage, and input / output latency, and compare them with preset static thresholds. Once a metric exceeds the threshold, the system triggers an alarm or executes predefined resource adjustment actions, such as allocating more memory or computing cores to the model instance. In addition, some solutions record the model's output logs and use simple keyword matching or rule engines to detect obvious errors or abnormal output behavior.
[0003] However, the aforementioned conventional monitoring and optimization methods have significant drawbacks. Static threshold monitoring struggles to adapt to the dynamic and ever-changing load characteristics of AI models, easily generating false alarms or missed alarms. This leads to either excessively frequent and wasteful resource adjustments or severe delays that negatively impact model performance. More critically, existing methods typically treat each monitoring metric as an isolated data point, lacking analysis of the inherent relationships and causal dependencies between metrics. When anomalies occur, the system cannot effectively distinguish between the root cause and accompanying symptoms, making it difficult to accurately pinpoint the origin of the anomaly and its propagation path within the system. This results in subsequent resource adjustment decisions lacking specificity, failing to fundamentally alleviate the chain reactions caused by complex dependencies, and leading to low optimization efficiency and unstable results. Summary of the Invention
[0004] This invention provides a method and system for dynamic monitoring and optimization of an artificial intelligence sandbox environment, which can solve the problems in the prior art.
[0005] A first aspect of this invention provides a method for dynamic monitoring and optimization of an artificial intelligence sandbox environment, comprising:
[0006] The execution status data of an artificial intelligence model running in a sandbox environment is obtained, and the execution status data includes resource usage information and output behavior characteristics;
[0007] Anomaly identification is performed on the execution status data. Each monitoring dimension is used as a node to construct a directed dependency graph. The anomaly starting node is determined by reverse tracing, and the impact propagation link is determined by forward traversal, generating anomaly feature vectors.
[0008] Root cause dimension information is extracted from abnormal feature vectors, historical resource adjustment records are segmented and clustered according to root cause dimension information, and the transfer patterns between clusters are identified. Based on the cluster to which the current root cause dimension information belongs, the resource demand status is predicted and resource adjustment demand is generated.
[0009] Anomaly information is parsed from the anomaly feature vector, and resource adjustment requirements are corrected based on loop dependency analysis, which is divided into immediate adjustment components and reserved adjustment components.
[0010] Based on the root cause dimension information and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment, the resource allocation ratio is solved and environment optimization instructions are generated.
[0011] In one optional embodiment, anomaly identification is performed on the execution status data. A directed dependency graph is constructed using each monitoring dimension as a node. The anomaly initiation node is determined by reverse tracing, and the impact propagation chain is determined by forward traversal. An anomaly feature vector is generated, including:
[0012] Each monitoring dimension in the execution status data is used as a node. The time when the values of different monitoring dimensions change within adjacent time windows is calculated. Each node is sorted according to the time of value change. A directed edge is established from the previous node to the next node for adjacent sorted node pairs to construct a directed dependency graph.
[0013] Nodes whose values deviate from a preset range in the directed dependency graph are identified as candidate anomaly nodes. The anomaly type information is determined according to the constraint type of each candidate anomaly node. Root cause candidate nodes are obtained by tracing back along the directed edges from each candidate anomaly node. The anomaly elimination rate and influence range coefficient are calculated by numerical substitution and deduction to determine the anomaly starting node.
[0014] Starting from the anomaly originating node, perform a forward traversal along the directed edges, record the sequence of nodes traversed during the traversal, determine the impact propagation path, extract the monitoring dimension identifiers corresponding to each node, calculate the path length from the anomaly originating node to the termination node, determine the propagation depth information, use the monitoring dimension identifiers corresponding to the anomaly originating node as the root cause dimension information, and combine the propagation depth information, root cause dimension information, and anomaly type information to form an anomaly feature vector.
[0015] In one optional embodiment, root cause candidate nodes are obtained by tracing back along directed edges from each candidate anomaly node, and the anomaly elimination rate and influence range coefficient are calculated through numerical substitution deduction to determine the anomaly initiation node, including:
[0016] Tracing back along the directed edges from each candidate anomaly node, all nodes on the reverse path are marked as root cause candidate nodes;
[0017] The numerical state of each root cause candidate node is replaced with the historical average value of the monitoring dimension corresponding to each root cause candidate node, while keeping the numerical state of other nodes unchanged. The values are propagated forward along the directed edges to the downstream nodes according to the dependency relationship to obtain the inferred values of each candidate abnormal node.
[0018] Calculate the deviation between the inferred values and the actual observed values of the candidate anomaly nodes, compare the deviation with the anomaly deviation magnitude of the candidate anomaly nodes, and obtain the anomaly elimination rate of each root cause candidate node.
[0019] Based on the topology of the directed dependency graph, a forward traversal is performed along the directed edges from each root cause candidate node, the number of downstream nodes covered by the traversal is counted, and the influence range coefficient of each root cause candidate node is quantified.
[0020] The causal contribution value is calculated by combining the anomaly elimination rate and the influence range coefficient, and the root cause candidate node with the largest causal contribution value is selected as the anomaly initiation node.
[0021] In one optional embodiment, the process of extracting root cause dimension information from the abnormal feature vector, segmenting and clustering historical resource adjustment records according to the root cause dimension information, identifying the transfer patterns between clusters, and predicting the resource demand status and generating resource adjustment requirements based on the current cluster to which the root cause dimension information belongs includes:
[0022] Extract root cause dimension information from the abnormal feature vector, and filter out a subset of historical records with the same root cause dimension identifier from the historical resource adjustment records based on the root cause dimension information;
[0023] The resource adjustment amount and adjustment time corresponding to each record in the historical record subset are used to form a time series sample. The feature similarity between each sample is calculated. Samples with feature similarity exceeding the preset clustering threshold are divided into the same cluster to obtain multiple clusters.
[0024] Propagation depth information is extracted from the abnormal feature vectors to determine the granularity of the time window division, and the distribution intervals of multiple clusters on the time axis are aligned and labeled according to the granularity of the division.
[0025] The distribution of each cluster on the time axis is statistically analyzed, the transition probability from the first cluster to the second cluster is identified, the current cluster to which the record belongs is adjusted according to the resources corresponding to the current root cause dimension information, and the target cluster for the next period is predicted by combining the transition probability from the current cluster to other clusters.
[0026] Extract the resource adjustment amount corresponding to each historical record in the target cluster, calculate the distribution characteristic value of the resource adjustment amount to determine the resource demand status, and generate resource adjustment demand.
[0027] In one optional embodiment, abnormal information is parsed from the abnormal feature vector, and resource adjustment requirements are corrected based on loop dependency analysis, which is divided into immediate adjustment components and reserved adjustment components, including:
[0028] Anomaly type and propagation depth information are parsed from the anomaly feature vector. Resource type identifiers are determined based on anomaly type information. The set of loop-dependent nodes that form closed loops in the propagation link is identified. The number of in-degrees and out-degrees of each node in the set of loop-dependent nodes is counted. The ratio of the number of in-degrees to the number of out-degrees is calculated to obtain the coupling strength coefficient. The resource adjustment requirement is multiplied by the coupling strength coefficient to obtain the corrected resource adjustment requirement.
[0029] Obtain the current quota and reserved quota of each resource type in the preset resource quota pool, calculate the time decay factor based on the propagation depth information, reduce the corrected resource adjustment demand in segments according to the time decay factor to obtain multiple segmented resource demand, extract the deceleration rate of each segmented resource demand, classify the segmented resource demand with the deceleration rate higher than the preset boundary threshold as the immediate adjustment component, and classify the segmented resource demand with the deceleration rate lower than the boundary threshold as the reserved adjustment component;
[0030] Calculate priority weights based on the time period corresponding to the real-time adjustment component, allocate the current quota proportionally, transfer any insufficient allocation to the reserved adjustment component, and lock the reserved quota in segments according to the time period corresponding to the reserved adjustment component to generate a resource allocation plan.
[0031] In one optional embodiment, for the root cause dimension information and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment, solving the resource allocation ratio and generating environment tuning instructions includes:
[0032] Extract the root cause dimension information and propagation depth information from the anomaly feature vectors of each artificial intelligence model, construct a causal relationship graph based on the root cause dimension information, identify the model subset that shares the same root cause node, calculate the cumulative path weight value of each artificial intelligence model in the model subset from the root cause node to its own node, and determine the response sensitivity.
[0033] The real-time adjustment component is multiplied by the response sensitivity to obtain the corrected real-time demand. Variance analysis is performed on each corrected real-time demand in the model subset to identify the fluctuating model group whose variance exceeds the preset discrete threshold. The corrected real-time demand of each artificial intelligence model in the fluctuating model group is time-series aligned according to the propagation depth information. The competition intensity index is calculated by fusing the time conflict coefficient and the resource overlap coefficient to identify the synchronous competition model.
[0034] A competition intensity coefficient is constructed based on the competition intensity index. The real-time demand is then weighted and allocated according to the reciprocal of the competition intensity coefficient to obtain the real-time resource allocation ratio.
[0035] For asynchronous competition models, the reserved adjustment components are expanded along the time axis, the cumulative growth slope is calculated to determine the priority, and the real-time resource allocation ratio and the reserved resource allocation ratio are merged to generate environmental optimization instructions.
[0036] In one optional embodiment, the immediate demand for corrections of each AI model in the fluctuation model group is time-aligned according to propagation depth information, and the competition intensity index is calculated by fusing the time conflict coefficient and the resource overlap coefficient to identify synchronous competition models, including:
[0037] The real-time demand of each AI model in the fluctuation model group is aligned in time according to the propagation depth information to construct a time series curve. The time series curve is then decomposed in the time domain to extract the peak demand time and peak duration.
[0038] For the artificial intelligence models in the fluctuation model group, pairwise combinations are made, the time interval between the peak demand times of each artificial intelligence model group is calculated, and artificial intelligence model combinations with time intervals less than a preset time threshold are marked as time-overlapping model pairs.
[0039] For each time-overlapping model pair, calculate the length of the intersection interval of the peak duration of each AI model in the time-overlapping model pair, divide the length of the intersection interval by the minimum value of the peak duration, and obtain the time conflict coefficient.
[0040] The instantaneous adjustment components of the time overlap model are projected onto the resource quota space to form a resource demand vector, and the cosine of the angle between the resource demand vectors is calculated to obtain the resource overlap coefficient.
[0041] The competition intensity index is obtained by fusing the time conflict coefficient and the resource overlap coefficient, and the synchronous competition model is identified based on the competition intensity index.
[0042] A second aspect of this invention provides a dynamic monitoring and optimization system for an artificial intelligence sandbox environment, comprising:
[0043] The status monitoring unit is used to acquire the execution status data of the artificial intelligence model running in the sandbox environment. The execution status data includes resource usage information and output behavior characteristics.
[0044] The anomaly tracing unit is used to identify anomalies in execution status data. It constructs a directed dependency graph with each monitoring dimension as a node, determines the anomaly starting node by tracing backward, determines the impact propagation link by traversing forward, and generates anomaly feature vectors.
[0045] The root cause prediction unit is used to extract root cause dimension information from the abnormal feature vector, segment and cluster historical resource adjustment records according to the root cause dimension information, identify the transfer patterns between clusters, predict the resource demand status and generate resource adjustment requirements based on the current root cause dimension information to belong to the cluster.
[0046] The demand correction unit is used to parse abnormal information from the abnormal feature vector and correct resource adjustment requirements based on loop dependency analysis. It is divided into immediate adjustment components and reserved adjustment components.
[0047] The resource allocation unit is used to calculate the resource allocation ratio and generate environment optimization instructions based on the root cause dimension information and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment.
[0048] A third aspect of the present invention provides an electronic device, comprising:
[0049] processor;
[0050] Memory used to store processor-executable instructions;
[0051] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0052] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0053] In this embodiment of the invention, when identifying anomalies in execution status data, a directed dependency graph is constructed, and a strategy combining reverse tracing and forward traversal is adopted. This enables precise location of the starting node of the anomaly and clearly outlines the propagation path of the anomaly within the system, thereby generating an anomaly feature vector containing the root cause and the scope of impact, significantly improving the accuracy and efficiency of anomaly location. Based on the anomaly feature vector, root cause dimension information is extracted, and historical resource adjustment records are segmented and clustered according to this information. This allows for the discovery of inherent patterns and state transition rules of resource usage under different root cause scenarios. By using the cluster to which the current root cause information belongs to predict future resource demand status, the generation of resource adjustment needs becomes data-driven and predictive, reducing the lag in optimization. For complex scenarios with multiple models running concurrently within the sandbox, the root cause dimension and propagation depth information in the anomaly feature vectors of each model can be integrated. Through optimization algorithms, the globally optimal or near-optimal resource allocation ratio can be solved, ensuring that under the condition of limited total resources, optimization commands can achieve fair, efficient, and flexible allocation of environmental resources, effectively suppressing the impact of a single model anomaly on the overall environment, and improving the overall service quality and resource utilization of the sandbox environment. Attached Figure Description
[0054] Figure 1 This is a flowchart illustrating the dynamic monitoring and optimization method for an artificial intelligence sandbox environment according to an embodiment of the present invention.
[0055] Figure 2 The flowchart for locating the root cause of an anomaly. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0058] Figure 1 This is a flowchart illustrating the dynamic monitoring and optimization method for an artificial intelligence sandbox environment according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0059] The execution status data of an artificial intelligence model running in a sandbox environment is obtained, and the execution status data includes resource usage information and output behavior characteristics;
[0060] Anomaly identification is performed on the execution status data. Each monitoring dimension is used as a node to construct a directed dependency graph. The anomaly starting node is determined by reverse tracing, and the impact propagation link is determined by forward traversal, generating anomaly feature vectors.
[0061] Root cause dimension information is extracted from abnormal feature vectors, historical resource adjustment records are segmented and clustered according to root cause dimension information, and the transfer patterns between clusters are identified. Based on the cluster to which the current root cause dimension information belongs, the resource demand status is predicted and resource adjustment demand is generated.
[0062] Anomaly information is parsed from the anomaly feature vector, and resource adjustment requirements are corrected based on loop dependency analysis, which is divided into immediate adjustment components and reserved adjustment components.
[0063] Based on the root cause dimension information and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment, the resource allocation ratio is solved and environment optimization instructions are generated.
[0064] In one optional implementation, anomaly identification is performed on the execution status data. A directed dependency graph is constructed using each monitoring dimension as a node. The anomaly initiation node is determined by reverse tracing, and the impact propagation chain is determined by forward traversal. An anomaly feature vector is generated, including:
[0065] Each monitoring dimension in the execution status data is used as a node. The time when the values of different monitoring dimensions change within adjacent time windows is calculated. Each node is sorted according to the time of value change. A directed edge is established from the previous node to the next node for adjacent sorted node pairs to construct a directed dependency graph.
[0066] Nodes whose values deviate from a preset range in the directed dependency graph are identified as candidate anomaly nodes. The anomaly type information is determined according to the constraint type of each candidate anomaly node. Root cause candidate nodes are obtained by tracing back along the directed edges from each candidate anomaly node. The anomaly elimination rate and influence range coefficient are calculated by numerical substitution and deduction to determine the anomaly starting node.
[0067] Starting from the anomaly originating node, perform a forward traversal along the directed edges, record the sequence of nodes traversed during the traversal, determine the impact propagation path, extract the monitoring dimension identifiers corresponding to each node, calculate the path length from the anomaly originating node to the termination node, determine the propagation depth information, use the monitoring dimension identifiers corresponding to the anomaly originating node as the root cause dimension information, and combine the propagation depth information, root cause dimension information, and anomaly type information to form an anomaly feature vector.
[0068] In one specific implementation, during the sandbox environment operation, monitoring data such as CPU utilization, memory usage, GPU utilization, network I / O throughput, and inference latency of the AI model are collected. A single data collection is treated as a time slice, and multiple consecutive slices constitute a time window. The time window width is set to 10 seconds, and numerical sequences of five monitoring dimensions are collected within this window. The change in value for each monitoring dimension between adjacent time slices is calculated. When the change exceeds 0.3 times the variance of that dimension, the time stamp of the significant change is recorded. All monitoring dimensions are sorted in ascending order according to the time stamp of their first significant change. The node corresponding to the monitoring dimension with the earlier time stamp is considered the predecessor node, and the node with the later time stamp is considered the successor node. The sorted node list is traversed. For adjacent node pairs, a directed edge is established in the directed dependency graph from the predecessor node to the successor node, and the weight of this edge is set to the difference in the time stamps of the two nodes.
[0069] Define normal operating value ranges for each monitoring dimension. For example, the normal range for CPU utilization is 20% to 80%, and the normal upper limit for inference latency is 200 milliseconds. Traverse all nodes in the directed dependency graph and check if their current values deviate from the preset range. When a node's value exceeds the upper limit, mark the constraint type as "overload"; when it is below the lower limit, mark it as "idle"; when the fluctuation exceeds the threshold, mark it as "oscillation". Map the constraint type to the anomaly type information: overload corresponds to insufficient resources, idle corresponds to wasted resources, and oscillation corresponds to unstable configuration. Starting from the candidate node marked as an anomaly, perform a breadth-first search along the opposite direction of the directed edges to collect all predecessor nodes that can reach the candidate node, forming a root cause candidate set. For each node in the root cause candidate set, assume that its value is adjusted to the median of the normal range, and infer the value change of downstream nodes through the edge weight relationship of the directed dependency graph. Calculate the probability that the anomaly node returns to normal after adjustment as the anomaly elimination rate, and at the same time, count the proportion of the number of nodes affected by the adjustment to the total number of nodes as the influence range coefficient. The node with the largest product of the anomaly elimination rate and the influence range coefficient is selected as the anomaly initiation node.
[0070] After identifying the anomaly's starting node, a depth-first traversal is performed along the directed edges from that node, recording the nodes visited sequentially along the traversal path. When a node with an out-degree of zero is reached or the traversal depth exceeds a preset limit, that node is marked as the termination node. The sequence of nodes visited during the traversal is considered the impact propagation link, and the number of nodes in the link is counted as the propagation depth information. The corresponding monitoring dimension identifier, such as "GPU_utilization," is extracted from the anomaly's starting node, and this identifier is used as the root cause dimension information. The propagation depth information is encoded as an integer value, the root cause dimension information as an enumeration index, and the anomaly type information as a category label. These three are combined in a fixed order to form a fixed-length numerical vector, which is the anomaly feature vector. This vector contains both the dimensional attributes of the anomaly source and the propagation range of the anomaly's impact, providing structured input for subsequent root cause analysis and resource adjustment.
[0071] In one optional implementation, root cause candidate nodes are obtained by tracing back along directed edges from each candidate anomaly node. The anomaly elimination rate and influence range coefficient are calculated through numerical substitution deduction to determine the anomaly initiation node, including:
[0072] Tracing back along the directed edges from each candidate anomaly node, all nodes on the reverse path are marked as root cause candidate nodes;
[0073] The numerical state of each root cause candidate node is replaced with the historical average value of the monitoring dimension corresponding to each root cause candidate node, while keeping the numerical state of other nodes unchanged. The values are propagated forward along the directed edges to the downstream nodes according to the dependency relationship to obtain the inferred values of each candidate abnormal node.
[0074] Calculate the deviation between the inferred values and the actual observed values of the candidate anomaly nodes, compare the deviation with the anomaly deviation magnitude of the candidate anomaly nodes, and obtain the anomaly elimination rate of each root cause candidate node.
[0075] Based on the topology of the directed dependency graph, a forward traversal is performed along the directed edges from each root cause candidate node, the number of downstream nodes covered by the traversal is counted, and the influence range coefficient of each root cause candidate node is quantified.
[0076] The causal contribution value is calculated by combining the anomaly elimination rate and the influence range coefficient, and the root cause candidate node with the largest causal contribution value is selected as the anomaly initiation node.
[0077] In one specific implementation, the process of determining the starting node of an anomaly first establishes a reverse tracing mechanism for the directed dependency graph. When a candidate anomaly node is detected, path tracing is performed in the reverse direction of the directed edges. Specifically, for a candidate anomaly node, all upstream nodes that can be reached through directed edges are recorded, and these upstream nodes constitute the initial root cause candidate set. During the tracing process, all nodes traversed are marked as root cause candidate nodes, including direct upstream nodes and indirect upstream nodes. This marking process employs a breadth-first traversal strategy to ensure coverage of all possible causal paths.
[0078] After labeling, numerical replacement inference is performed for each root cause candidate node. The numerical sequence of the monitoring dimension corresponding to the root cause candidate node within the historical time window is extracted, and the historical average value is calculated as the replacement value. The current numerical state of the root cause candidate node is replaced with the historical average value, while keeping the numerical states of all other nodes in the directed dependency graph unchanged. Starting from the replaced node, the replaced value is propagated to downstream nodes according to the dependency relationships indicated by the directed edges. The propagation process follows the computational logic defined by the dependency relationships; for example, if the value of a downstream node is obtained by a weighted sum of multiple upstream nodes, the replaced value is used in the calculation. Through this forward propagation, the inferred values of each candidate anomaly node under this replacement assumption are obtained.
[0079] When calculating the anomaly elimination rate, the actual observed values and projected values of candidate anomaly nodes are obtained. The deviation between the two is calculated, which reflects the degree of mitigation of the anomaly after replacing a specific root cause candidate node. Simultaneously, the anomaly deviation magnitude of the candidate anomaly node is extracted, i.e., the deviation between the node's current observed value and its normal baseline value. The ratio of the deviation to the anomaly deviation magnitude is used as the anomaly elimination rate; the closer the value is to 1, the greater the contribution of the root cause candidate node to the anomaly.
[0080] To quantify the influence range coefficient, a forward traversal is performed along the directed edges, starting from each root cause candidate node. The traversal process records all reachable downstream nodes, including direct downstream nodes and indirect downstream nodes reachable through multi-level propagation. The total number of downstream nodes covered by the traversal is counted, and this number is normalized to obtain the influence range coefficient. The normalization benchmark is the total number of nodes in the directed dependency graph, ensuring that the influence range coefficient ranges from 0 to 1.
[0081] The causal contribution value is calculated by combining the anomaly elimination rate and the influence range coefficient. A weighted combination method is used, assigning a weight of 0.7 to the anomaly elimination rate and a weight of 0.3 to the influence range coefficient, and calculating the weighted sum as the causal contribution value. All root cause candidate nodes are traversed, and the causal contribution values of each node are compared. The node with the largest value is selected as the anomaly initiation node. When multiple nodes have similar causal contribution values, the node with the higher anomaly elimination rate is prioritized as the anomaly initiation node to ensure the accuracy of root cause localization.
[0082] like Figure 2 The diagram shown illustrates the logic flowchart for locating the root cause of an anomaly.
[0083] In one optional implementation, root cause dimension information is extracted from the abnormal feature vector, historical resource adjustment records are segmented and clustered according to the root cause dimension information, and the transfer patterns between clusters are identified. Based on the cluster to which the current root cause dimension information belongs, the resource demand status is predicted and resource adjustment requirements are generated, including:
[0084] Extract root cause dimension information from the abnormal feature vector, and filter out a subset of historical records with the same root cause dimension identifier from the historical resource adjustment records based on the root cause dimension information;
[0085] The resource adjustment amount and adjustment time corresponding to each record in the historical record subset are used to form a time series sample. The feature similarity between each sample is calculated. Samples with feature similarity exceeding the preset clustering threshold are divided into the same cluster to obtain multiple clusters.
[0086] Propagation depth information is extracted from the abnormal feature vectors to determine the granularity of the time window division, and the distribution intervals of multiple clusters on the time axis are aligned and labeled according to the granularity of the division.
[0087] The distribution of each cluster on the time axis is statistically analyzed, the transition probability from the first cluster to the second cluster is identified, the current cluster to which the record belongs is adjusted according to the resources corresponding to the current root cause dimension information, and the target cluster for the next period is predicted by combining the transition probability from the current cluster to other clusters.
[0088] Extract the resource adjustment amount corresponding to each historical record in the target cluster, calculate the distribution characteristic value of the resource adjustment amount to determine the resource demand status, and generate resource adjustment demand.
[0089] In one specific implementation, when performing resource demand forecasting, root cause dimension information is parsed from the anomaly feature vector. Root cause dimension information typically exists in the form of identifiers, such as CPU-intensive anomalies, memory leak anomalies, or network I / O bottleneck anomalies. Based on the parsed root cause dimension identifiers, all records with the same root cause dimension identifier are retrieved from the historical resource adjustment record database, forming a historical record subset. Each record in the historical record subset includes a timestamp of the adjustment time, the numerical value of the resource adjustment amount, and the evaluation value of the adjusted effect.
[0090] Each record in the historical data subset is transformed into a time-series sample. Each sample uses resource adjustment amount as the primary feature dimension, while the periodicity of adjustment time is introduced as an auxiliary dimension. When calculating the feature similarity between samples, a weighted Euclidean distance metric is used, assigning weights to the numerical difference in resource adjustment amount and the proximity of time intervals. When the inverse of the weighted distance between two samples exceeds a preset clustering threshold, the two samples are grouped into the same cluster. By comparing all sample pairs one by one, several clusters are ultimately obtained, each cluster representing a typical resource adjustment pattern.
[0091] To identify the transition patterns between clusters, propagation depth information needs to be extracted from the anomaly feature vectors. Propagation depth reflects the number of influence levels of the anomaly in the dependency graph; a larger value indicates a wider range of influence, requiring a longer time window for observation. The granularity of the time window is determined based on the propagation depth information; for example, a 5-minute granularity is used when the propagation depth is 3, and a 10-minute granularity is used when the propagation depth is 5. According to the determined granularity, the distribution intervals of each cluster are marked on the time axis, allowing comparisons of clusters from different periods on a unified time scale.
[0092] The temporal distribution matrix of clusters is constructed by statistically analyzing the occurrence position and duration of each cluster on the time axis. Transition events from the first cluster to the second cluster are identified by analyzing the identifiers of temporally adjacent clusters. When calculating the transition probability, the frequency of the second cluster appearing in the next time period after all first clusters have appeared is counted and divided by the total number of first cluster appearances. For the resource adjustment record corresponding to the current root cause dimension information, its current cluster number is determined, and the transition probability distribution from this cluster to all other clusters is queried. The cluster with the highest transition probability is selected as the target cluster for the next time period.
[0093] Extract all historical resource adjustment values from the target cluster and calculate their mean, variance, and quantiles. The mean reflects the typical resource demand within that cluster, the variance reflects the degree of demand fluctuation, and the quantiles determine the upper and lower bounds of the demand. Based on these distribution characteristics, determine the resource demand status as stable growth, highly volatile, or stable maintenance. Based on the determined resource demand status and the current resource reserves in the sandbox environment, generate resource adjustment requirements including specific resource quantities and adjustment priorities, providing a basis for subsequent resource allocation decisions.
[0094] In one optional implementation, anomaly information is parsed from the anomaly feature vector, and resource adjustment requirements are corrected based on loop dependency analysis, divided into immediate adjustment components and reserved adjustment components, including:
[0095] Anomaly type and propagation depth information are parsed from the anomaly feature vector. Resource type identifiers are determined based on anomaly type information. The set of loop-dependent nodes that form closed loops in the propagation link is identified. The number of in-degrees and out-degrees of each node in the set of loop-dependent nodes is counted. The ratio of the number of in-degrees to the number of out-degrees is calculated to obtain the coupling strength coefficient. The resource adjustment requirement is multiplied by the coupling strength coefficient to obtain the corrected resource adjustment requirement.
[0096] Obtain the current quota and reserved quota of each resource type in the preset resource quota pool, calculate the time decay factor based on the propagation depth information, reduce the corrected resource adjustment demand in segments according to the time decay factor to obtain multiple segmented resource demand, extract the deceleration rate of each segmented resource demand, classify the segmented resource demand with the deceleration rate higher than the preset boundary threshold as the immediate adjustment component, and classify the segmented resource demand with the deceleration rate lower than the boundary threshold as the reserved adjustment component;
[0097] Calculate priority weights based on the time period corresponding to the real-time adjustment component, allocate the current quota proportionally, transfer any insufficient allocation to the reserved adjustment component, and lock the reserved quota in segments according to the time period corresponding to the reserved adjustment component to generate a resource allocation plan.
[0098] In one specific implementation, anomaly type information and propagation depth information are extracted from the anomaly feature vector. The anomaly type information indicates categories such as resource depletion, output exceeding limits, or response delay; each anomaly type corresponds to a specific resource type identifier, such as computing resources, storage resources, or network bandwidth. The propagation depth information is obtained by calculating the number of layers affecting nodes in the propagation link, reflecting the scope of the anomaly's impact.
[0099] Identify the set of loop-dependent nodes in the propagation chain. Traverse all nodes in the directed dependency graph and use a depth-first search algorithm to check if the node access path forms a closed loop. When visiting a node, if the node already exists in the current path stack, then the node and its subsequent nodes in the path stack are considered to form a set of loop-dependent nodes. Calculate the in-degree and out-degree of each node in the set. The in-degree represents the number of edges pointing to the node, and the out-degree represents the number of edges originating from the node. Calculate the ratio of in-degree to out-degree as the coupling strength coefficient, which reflects the tightness of the node's dependency in the loop. Multiply the resource adjustment requirement value by the coupling strength coefficient to obtain the corrected resource adjustment requirement. When the coupling strength coefficient is greater than 1, it indicates that the node is strongly influenced by other nodes, and the resource adjustment amount needs to be increased; when the coefficient is less than 1, the node has a strong external influence, and the resource adjustment amount should be appropriately reduced.
[0100] Retrieve the current and reserved quota amounts from the preset resource quota pool. The current quota amount represents the total amount of resources that can be allocated immediately, while the reserved quota amount represents the resource reserves held to cope with future fluctuations. Calculate the time decay factor based on the propagation depth information. The greater the propagation depth, the longer the duration of the abnormal impact, and the smaller the decay factor value. Specifically, the natural constant e is used as the base, and the negative value of the propagation depth is used as the exponent for exponential calculation. Divide the adjusted resource demand into multiple time windows, each corresponding to a segmented resource demand. The demand in subsequent time windows is obtained by multiplying the demand in the previous window by the decay factor.
[0101] Extract the deceleration rate of resource demand for each segment. The deceleration rate is obtained by calculating the ratio of the difference in demand between adjacent time windows to the length of the time window. Compare the deceleration rate with a preset threshold, which is determined based on the resource resilience of the sandbox environment. Segment resource demand with a deceleration rate higher than the threshold indicates that the abnormal impact is rapidly subsiding; these segments are classified as immediate adjustment components and should be prioritized for allocation from the current quota. Segment resource demand with a deceleration rate lower than the threshold indicates that the abnormal impact persists; these segments are classified as reserved adjustment components and should be locked from the reserved quota.
[0102] Priority weights are calculated based on the time periods corresponding to the immediate adjustment components. The earlier the time period, the higher the priority weight. The weight value is obtained by normalizing the inverse of the time period number. The current quota is allocated proportionally according to the priority weights. Each immediate adjustment component is multiplied by its corresponding weight and compared with the current quota. When the demand for a component exceeds its allocated share, the insufficient portion is added to the reserved adjustment components. Based on the time periods corresponding to the reserved adjustment components, the reserved quota is segmented and locked in chronological order. The locking operation marks the quota for the corresponding time period as occupied, generating a resource allocation scheme that includes the allocation time, resource type, allocation quantity, and locking duration.
[0103] In one optional implementation, for the root cause dimension information and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment, solving the resource allocation ratio and generating environment tuning instructions includes:
[0104] Extract the root cause dimension information and propagation depth information from the anomaly feature vectors of each artificial intelligence model, construct a causal relationship graph based on the root cause dimension information, identify the model subset that shares the same root cause node, calculate the cumulative path weight value of each artificial intelligence model in the model subset from the root cause node to its own node, and determine the response sensitivity.
[0105] The real-time adjustment component is multiplied by the response sensitivity to obtain the corrected real-time demand. Variance analysis is performed on each corrected real-time demand in the model subset to identify the fluctuating model group whose variance exceeds the preset discrete threshold. The corrected real-time demand of each artificial intelligence model in the fluctuating model group is time-series aligned according to the propagation depth information. The competition intensity index is calculated by fusing the time conflict coefficient and the resource overlap coefficient to identify the synchronous competition model.
[0106] A competition intensity coefficient is constructed based on the competition intensity index. The real-time demand is then weighted and allocated according to the reciprocal of the competition intensity coefficient to obtain the real-time resource allocation ratio.
[0107] For asynchronous competition models, the reserved adjustment components are expanded along the time axis, the cumulative growth slope is calculated to determine the priority, and the real-time resource allocation ratio and the reserved resource allocation ratio are merged to generate environmental optimization instructions.
[0108] In one specific implementation, root cause dimension information is extracted from the anomaly feature vectors corresponding to each AI model. This root cause dimension information includes resource type identifier, load source identifier, and trigger timestamp. A mapping relationship is established for all root cause dimension information based on the combination of resource type identifier and load source identifier. When the root cause dimension information of multiple AI models has the same resource type identifier and load source identifier, these models are considered to share the same root cause node. AI models sharing the same root cause node are divided into model subsets, and the root cause node identifier corresponding to each model subset is recorded. Simultaneously, propagation depth information is extracted from the anomaly feature vectors. This propagation depth information is represented by the influence propagation link length obtained through forward traversal.
[0109] In the causal relationship graph, the root cause node is used as the starting node, and the anomaly nodes corresponding to each AI model are used as the ending nodes. The cumulative path weights from the root cause node to each model's anomaly node are calculated. The cumulative path weights are calculated by summing the weights of each edge along the path. The edge weights are determined based on the dependency strength between adjacent nodes, which is quantified by the correlation coefficient in historical execution state data. After normalizing the cumulative path weights, the response sensitivity is obtained. A higher response sensitivity value indicates that the AI model is more sensitive to root cause anomalies.
[0110] The adjusted immediate demand is obtained by multiplying the immediate adjustment component by the response sensitivity. For each adjusted immediate demand within a model subset, its mean and variance are calculated. When the variance exceeds a preset discrete threshold, it indicates the presence of AI models with significant demand fluctuations within that subset. These significantly fluctuating AI models are grouped into a fluctuation model group, and the adjusted immediate demand and corresponding propagation depth information of each AI model in the fluctuation model group are extracted. The adjusted immediate demand is then time-aligned based on the propagation depth information, aligning demand with the same propagation depth to the same time scale.
[0111] The time conflict coefficient is calculated by determining the proportion of times demand overlaps within the same time window after time-series alignment. The resource overlap coefficient is calculated by analyzing the intersection ratio of resource types involved in the demand of each AI model. The time conflict coefficient and resource overlap coefficient are then weighted and summed to obtain a competition intensity index. When the competition intensity index exceeds a preset competition threshold, the corresponding AI model is identified as a synchronous competition model.
[0112] For the synchronous competition model, the competition intensity index is used as the competition intensity coefficient. The reciprocal of the competition intensity coefficient is calculated and normalized, and the normalized reciprocal is used as the weighting coefficient. The real-time demand of each synchronous competition model is multiplied by the corresponding weighting coefficient to obtain the real-time resource allocation ratio. The real-time resource allocation ratio represents the proportion of resources that the artificial intelligence model should obtain at the current moment relative to the total real-time resources.
[0113] For asynchronous competition models, the reserved adjustment components are expanded along the time axis to form a time series. The growth slope of the cumulative amount in the time series over time is calculated, obtained by linearly fitting the cumulative amount. A larger growth slope indicates that the demand for reserved resources by the AI model is growing more rapidly, and the corresponding priority is higher. Asynchronous competition models are ranked according to the growth slope, and reserved resource allocation ratios are assigned according to the ranking results. The immediate resource allocation ratio and the reserved resource allocation ratio are merged to generate an environment tuning instruction containing resource type, allocation quantity, allocation time, and target model identifier, and the instruction is issued to the sandbox environment for execution.
[0114] In one optional implementation, the immediate demand for corrections from each AI model in the fluctuation model group is time-aligned according to propagation depth information. The competition intensity index is calculated by fusing the time conflict coefficient and resource overlap coefficient to identify synchronous competition models, including:
[0115] The real-time demand of each AI model in the fluctuation model group is aligned in time according to the propagation depth information to construct a time series curve. The time series curve is then decomposed in the time domain to extract the peak demand time and peak duration.
[0116] For the artificial intelligence models in the fluctuation model group, pairwise combinations are made, the time interval between the peak demand times of each artificial intelligence model group is calculated, and artificial intelligence model combinations with time intervals less than a preset time threshold are marked as time-overlapping model pairs.
[0117] For each time-overlapping model pair, calculate the length of the intersection interval of the peak duration of each AI model in the time-overlapping model pair, divide the length of the intersection interval by the minimum value of the peak duration, and obtain the time conflict coefficient.
[0118] The instantaneous adjustment components of the time overlap model are projected onto the resource quota space to form a resource demand vector, and the cosine of the angle between the resource demand vectors is calculated to obtain the resource overlap coefficient.
[0119] The competition intensity index is obtained by fusing the time conflict coefficient and the resource overlap coefficient, and the synchronous competition model is identified based on the competition intensity index.
[0120] In one specific implementation, when multiple AI models in a fluctuating model group simultaneously exhibit resource demand fluctuations, it is necessary to identify which models are competing for resources. First, the corrected immediate demand of each AI model in the fluctuating model group is extracted. This corrected immediate demand reflects the model's actual need for computing resources, memory resources, or network bandwidth at a specific moment. Time-series alignment is performed based on the propagation depth information of each model. Propagation depth information represents the path length traversed by the abnormal impact from the starting node to the current monitoring dimension; models with greater propagation depth exhibit time delays in their resource demand response. By shifting and correcting the demand timelines of each model according to the difference in propagation depth, the demand curves of models with the same abnormal trigger moment are aligned in the time dimension, constructing a normalized time series curve.
[0121] The constructed time series curves are decomposed in the time domain. A sliding window method is used to scan the demand curve. When the demand value within the window exceeds 1.5 times the average demand value of the model, it is marked as the start of the peak interval. When the demand value falls back to less than 1.2 times the average value, it is marked as the end of the peak interval. The center time of each peak interval is extracted as the peak demand time, and the difference between the start and end times of the peak interval is calculated to obtain the peak duration. A model may have multiple peak intervals. The peak time and duration of each peak interval are recorded separately.
[0122] For each AI model in the fluctuation model group, a pairwise combination traversal is performed. For model A and model B, their respective sets of peak demand times are obtained. The absolute value of the time interval between a certain peak time of model A and each peak time of model B is calculated. If at least one set of time intervals is less than a preset time threshold, the model combination is marked as a time-overlapping model pair. The preset time threshold is determined based on the scheduling granularity of the sandbox environment, and is typically set to 0.3 to 0.5 times the resource scheduling cycle.
[0123] For each identified time-overlapping model pair, calculate its time conflict coefficient. Obtain the peak duration of the two models in the pair, denoted as T1 and T2, respectively, and calculate the intersection interval of the two peak intervals on the time axis. The length of the intersection interval is equal to the duration of the overlapping part of the two peak intervals, determined by comparing the start and end times of the peak intervals. Divide the length of the intersection interval by the minimum value of T1 and T2 to obtain the time conflict coefficient, which reflects the degree of overlap in the resource requirements of the two models in the time dimension.
[0124] The instantaneous adjustment components of the time-overlapping model pair are projected onto the resource quota space. The resource quota space is a multi-dimensional vector space, with each dimension corresponding to resource types such as CPU quota, memory quota, and GPU quota. The instantaneous adjustment components contain the demand increments for each resource type, represented as resource demand vectors. The cosine of the angle between the two resource demand vectors is calculated; this cosine value is the resource overlap coefficient, ranging from 0 to 1. The closer the resource overlap coefficient is to 1, the more similar the resource types required by the two models, and the stronger the competition.
[0125] The time conflict coefficient and resource overlap coefficient are weighted and fused together, and the competition intensity index is obtained by multiplication. When the competition intensity index exceeds 0.6, the model is determined to be a synchronous competition model, and priority coordination or time-staggered scheduling is required during resource allocation.
[0126] The dynamic monitoring and optimization system for an artificial intelligence sandbox environment according to embodiments of the present invention includes:
[0127] The status monitoring unit is used to acquire the execution status data of the artificial intelligence model running in the sandbox environment. The execution status data includes resource usage information and output behavior characteristics.
[0128] The anomaly tracing unit is used to identify anomalies in execution status data. It constructs a directed dependency graph with each monitoring dimension as a node, determines the anomaly starting node by tracing backward, determines the impact propagation link by traversing forward, and generates anomaly feature vectors.
[0129] The root cause prediction unit is used to extract root cause dimension information from the abnormal feature vector, segment and cluster historical resource adjustment records according to the root cause dimension information, identify the transfer patterns between clusters, predict the resource demand status and generate resource adjustment requirements based on the current root cause dimension information to belong to the cluster.
[0130] The demand correction unit is used to parse abnormal information from the abnormal feature vector and correct resource adjustment requirements based on loop dependency analysis. It is divided into immediate adjustment components and reserved adjustment components.
[0131] The resource allocation unit is used to calculate the resource allocation ratio and generate environment optimization instructions based on the root cause dimension information and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment.
[0132] A third aspect of the present invention provides an electronic device, comprising:
[0133] processor;
[0134] Memory used to store processor-executable instructions;
[0135] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0136] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0137] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for dynamic monitoring and optimization of an artificial intelligence sandbox environment, characterized in that, include: The execution status data of an artificial intelligence model running in a sandbox environment is obtained, and the execution status data includes resource usage information and output behavior characteristics; Anomaly identification is performed on execution status data. A directed dependency graph is constructed using each monitoring dimension as a node. The anomaly's originating node is determined through reverse tracing, and the impact propagation chain is identified through forward traversal. Anomaly feature vectors are generated, including: Each monitoring dimension in the execution status data is used as a node. The time when the values of different monitoring dimensions change within adjacent time windows is calculated. Each node is sorted according to the time of value change. A directed edge is established from the previous node to the next node for adjacent sorted node pairs to construct a directed dependency graph. Nodes whose values deviate from a preset range in the directed dependency graph are identified as candidate anomaly nodes. The anomaly type information is determined according to the constraint type of each candidate anomaly node. Root cause candidate nodes are obtained by tracing back along the directed edges from each candidate anomaly node. The anomaly elimination rate and influence range coefficient are calculated by numerical substitution and deduction to determine the anomaly starting node. Starting from the anomaly originating node, perform a forward traversal along the directed edges, record the sequence of nodes traversed during the traversal, determine the impact propagation link, extract the monitoring dimension identifiers corresponding to each node, calculate the path length from the anomaly originating node to the termination node, determine the propagation depth information, use the monitoring dimension identifiers corresponding to the anomaly originating node as the root cause dimension information, and combine the propagation depth information, root cause dimension information, and anomaly type information to form an anomaly feature vector. Root cause dimension information is extracted from abnormal feature vectors, historical resource adjustment records are segmented and clustered according to root cause dimension information, and the transfer patterns between clusters are identified. Based on the cluster to which the current root cause dimension information belongs, the resource demand status is predicted and resource adjustment demand is generated. Anomaly information is parsed from the anomaly feature vector, and resource adjustment requirements are corrected based on loop dependency analysis, which is divided into immediate adjustment components and reserved adjustment components. Based on the root cause dimension information and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment, the resource allocation ratio is solved and environment optimization instructions are generated.
2. The method according to claim 1, characterized in that, By tracing back along the directed edges from each candidate anomaly node, root cause candidate nodes are obtained. The anomaly elimination rate and influence range coefficient are calculated through numerical substitution and deduction to determine the anomaly initiation node, which includes: Tracing back along the directed edges from each candidate anomaly node, all nodes on the reverse path are marked as root cause candidate nodes; The numerical state of each root cause candidate node is replaced with the historical average value of the monitoring dimension corresponding to each root cause candidate node, while keeping the numerical state of other nodes unchanged. The values are propagated forward along the directed edges to the downstream nodes according to the dependency relationship to obtain the inferred values of each candidate abnormal node. Calculate the deviation between the inferred values and the actual observed values of the candidate anomaly nodes, compare the deviation with the anomaly deviation magnitude of the candidate anomaly nodes, and obtain the anomaly elimination rate of each root cause candidate node. Based on the topology of the directed dependency graph, a forward traversal is performed along the directed edges from each root cause candidate node, the number of downstream nodes covered by the traversal is counted, and the influence range coefficient of each root cause candidate node is quantified. The causal contribution value is calculated by combining the anomaly elimination rate and the influence range coefficient, and the root cause candidate node with the largest causal contribution value is selected as the anomaly initiation node.
3. The method according to claim 1, characterized in that, Root cause dimension information is extracted from abnormal feature vectors. Historical resource adjustment records are segmented and clustered according to root cause dimension information, and the transfer patterns between clusters are identified. Based on the current cluster to which the root cause dimension information belongs, the resource demand status is predicted and resource adjustment requirements are generated, including: Root cause dimension information is extracted from the abnormal feature vector, and a subset of historical records with the same root cause dimension identifier is selected from the historical resource adjustment records based on the root cause dimension information. The resource adjustment amount and adjustment time corresponding to each record in the historical record subset are used to form a time series sample. The feature similarity between each sample is calculated. Samples with feature similarity exceeding the preset clustering threshold are divided into the same cluster to obtain multiple clusters. Propagation depth information is extracted from the abnormal feature vectors to determine the granularity of the time window. The distribution intervals of multiple clusters on the time axis are aligned and labeled according to the granularity. The distribution of each cluster on the time axis is statistically analyzed, the transition probability from the first cluster to the second cluster is identified, the current cluster to which the record belongs is adjusted according to the resources corresponding to the current root cause dimension information, and the target cluster for the next period is predicted by combining the transition probability from the current cluster to other clusters. Extract the resource adjustment amount corresponding to each historical record in the target cluster, calculate the distribution characteristic value of the resource adjustment amount to determine the resource demand status, and generate resource adjustment demand.
4. The method according to claim 1, characterized in that, Anomaly information is parsed from the anomaly feature vector, and resource adjustment requirements are corrected based on loop dependency analysis, divided into immediate adjustment components and reserved adjustment components: Anomaly type and propagation depth information are parsed from the anomaly feature vector. Resource type identifiers are determined based on anomaly type information. The set of loop-dependent nodes that form closed loops in the propagation link is identified. The number of in-degrees and out-degrees of each node in the set of loop-dependent nodes is counted. The ratio of the number of in-degrees to the number of out-degrees is calculated to obtain the coupling strength coefficient. The resource adjustment requirement is multiplied by the coupling strength coefficient to obtain the corrected resource adjustment requirement. Obtain the current quota and reserved quota of each resource type in the preset resource quota pool, calculate the time decay factor based on the propagation depth information, reduce the corrected resource adjustment demand in segments according to the time decay factor to obtain multiple segmented resource demand, extract the deceleration rate of each segmented resource demand, classify the segmented resource demand with the deceleration rate higher than the preset boundary threshold as the immediate adjustment component, and classify the segmented resource demand with the deceleration rate lower than the boundary threshold as the reserved adjustment component; Calculate priority weights based on the time period corresponding to the real-time adjustment component, allocate the current quota proportionally, transfer any insufficient allocation to the reserved adjustment component, and lock the reserved quota in segments according to the time period corresponding to the reserved adjustment component to generate a resource allocation plan.
5. The method according to claim 1, characterized in that, Based on the root cause dimension and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment, the resource allocation ratio is calculated and environment tuning instructions are generated, including: Extract the root cause dimension information and propagation depth information from the anomaly feature vectors of each artificial intelligence model, construct a causal relationship graph based on the root cause dimension information, identify the model subset that shares the same root cause node, calculate the cumulative path weight value of each artificial intelligence model in the model subset from the root cause node to its own node, and determine the response sensitivity. The real-time adjustment component is multiplied by the response sensitivity to obtain the corrected real-time demand. Variance analysis is performed on each corrected real-time demand in the model subset to identify the fluctuating model group whose variance exceeds the preset discrete threshold. The corrected real-time demand of each artificial intelligence model in the fluctuating model group is time-series aligned according to the propagation depth information. The competition intensity index is calculated by fusing the time conflict coefficient and the resource overlap coefficient to identify the synchronous competition model. A competition intensity coefficient is constructed based on the competition intensity index. The real-time demand is then weighted and allocated according to the reciprocal of the competition intensity coefficient to obtain the real-time resource allocation ratio. For asynchronous competition models, the reserved adjustment components are expanded along the time axis, the cumulative growth slope is calculated to determine the priority, and the real-time resource allocation ratio and the reserved resource allocation ratio are merged to generate environmental optimization instructions.
6. The method according to claim 5, characterized in that, The immediate demand for modifications to each AI model in the fluctuation model group is time-series aligned according to propagation depth information. The competition intensity index is calculated by fusing the time conflict coefficient and resource overlap coefficient to identify synchronous competition models, including: The real-time demand of each AI model in the fluctuation model group is aligned in time according to the propagation depth information to construct a time series curve. The time series curve is then decomposed in the time domain to extract the peak demand time and peak duration. For the artificial intelligence models in the fluctuation model group, pairwise combinations are made, the time interval between the peak demand times of each artificial intelligence model group is calculated, and artificial intelligence model combinations with time intervals less than a preset time threshold are marked as time-overlapping model pairs. For each time-overlapping model pair, calculate the length of the intersection interval of the peak duration of each AI model in the time-overlapping model pair, divide the length of the intersection interval by the minimum value of the peak duration, and obtain the time conflict coefficient. The instantaneous adjustment components of the time overlap model are projected onto the resource quota space to form a resource demand vector, and the cosine of the angle between the resource demand vectors is calculated to obtain the resource overlap coefficient. The competition intensity index is obtained by fusing the time conflict coefficient and the resource overlap coefficient, and the synchronous competition model is identified based on the competition intensity index.
7. A dynamic monitoring and optimization system for an artificial intelligence sandbox environment, used to implement the method of any one of claims 1-6, characterized in that, include: The status monitoring unit is used to acquire the execution status data of the artificial intelligence model running in the sandbox environment. The execution status data includes resource usage information and output behavior characteristics. The anomaly tracing unit is used to identify anomalies in execution status data. It constructs a directed dependency graph with each monitoring dimension as a node, determines the anomaly starting node by tracing backward, determines the impact propagation link by traversing forward, and generates anomaly feature vectors. The root cause prediction unit is used to extract root cause dimension information from the abnormal feature vector, segment and cluster historical resource adjustment records according to the root cause dimension information, identify the transfer patterns between clusters, predict the resource demand status and generate resource adjustment requirements based on the current root cause dimension information to belong to the cluster. The demand correction unit is used to parse abnormal information from the abnormal feature vector and correct resource adjustment requirements based on loop dependency analysis. It is divided into immediate adjustment components and reserved adjustment components. The resource allocation unit is used to calculate the resource allocation ratio and generate environment optimization instructions based on the root cause dimension information and propagation depth information of the abnormal feature vectors corresponding to multiple artificial intelligence models in the sandbox environment.
8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.