Method and device for training detection model, method and device for detecting quality of service
By training the detection model in a cloud environment and using feature selection and recursive routing modules to filter effective features, the problem of service quality degradation caused by multi-tenant resource contention is solved, achieving high-precision and low-complexity service quality detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG LAB OF ARTIFICIAL INTELLIGENCE & DIGITAL ECONOMY (SZ)
- Filing Date
- 2025-12-10
- Publication Date
- 2026-06-05
AI Technical Summary
In a cloud environment with shared resources among multiple tenants, existing technologies struggle to effectively address the service quality degradation caused by resource contention. In particular, given the high computational complexity and deployment overhead, existing AI models are ill-suited to meet the service quality assurance requirements of multi-tenant resource contention scenarios.
By acquiring a feature dataset containing multiple input features and service quality, the detection model is trained. Effective features are learned using a feature selection module and a recursive routing module, and features related to service quality are selected. The target detection model is obtained through iterative optimization, reducing computational complexity and training overhead.
It enables accurate service quality prediction of monitoring data in the cloud system, ensures the matching of cluster resource scheduling with service quality requirements, improves detection accuracy and reduces computational complexity and training overhead.
Smart Images

Figure CN121309381B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a training method and apparatus for a detection model, and a service quality detection method and apparatus. Background Technology
[0002] Currently, in multi-tenant cloud environments with shared resources, resource contention and performance interference are difficult to avoid. When multiple tenants' tasks simultaneously compete for critical resources such as CPU, memory, and network I / O, it can easily lead to a decline in Quality of Service (QoS), manifested as increased task latency, fluctuating response times, or even service anomalies, severely impacting end-user experience and overall system stability.
[0003] Existing solutions utilize artificial intelligence models to automatically extract features from historical performance data, enabling adaptive identification and prediction of cloud system performance monitoring. However, these solutions still suffer from problems such as high feature acquisition costs and susceptibility to noise, high model computational complexity, large deployment overhead, and inconsistencies between model training and inference phases. Consequently, they are ill-suited to meet the service quality assurance requirements of multi-tenant resource contention scenarios. Summary of the Invention
[0004] This application provides a method and apparatus for training a detection model, and a method and apparatus for service quality detection, which can solve the problem that existing solutions for monitoring the performance of cloud systems are difficult to adapt to the service quality assurance requirements of multi-tenant resource contention scenarios.
[0005] In a first aspect, embodiments of this application provide a method for training a detection model, including:
[0006] Obtain a first feature dataset, wherein the first feature dataset contains multiple first input features and the service quality corresponding to each first input feature;
[0007] All the first input features and the corresponding service quality are used as model input samples and model output samples, respectively, to train the detection model and obtain an intermediate detection model; the intermediate detection model is used to learn the effective features related to the service quality in the first input features;
[0008] Based on the first feature dataset and the intermediate detection model, a second feature dataset is determined;
[0009] The intermediate detection model is trained based on the second feature dataset to obtain the target detection model.
[0010] In one possible implementation of the first aspect, the detection model includes a feature selection module and a recursive routing module;
[0011] The step of using all the first input features and the corresponding service quality as model input samples and model output samples respectively to train the detection model and obtain an intermediate detection model includes:
[0012] All the first input features are input into the feature selection module respectively to obtain the third input feature corresponding to each of the first input features;
[0013] Each of the third input features is input into the recursive routing module to obtain a first prediction result corresponding to each of the third input features;
[0014] Based on the service quality and the first prediction result, determine the first loss of the first prediction result;
[0015] The first model parameters of the feature selection module and the second model parameters of the recursive routing module are iteratively updated according to the first loss until the detection model meets the preset first training stopping condition, thus obtaining the intermediate detection model; the first training stopping condition is that the first loss is less than the first preset loss threshold or the number of iterations reaches the first preset number.
[0016] In one possible implementation of the first aspect, determining the second feature dataset based on the first feature dataset and the intermediate detection model includes:
[0017] Each of the first input features is input into the feature selection model of the intermediate detection model to filter out features whose feature weights are greater than a preset threshold, thus obtaining the second input features.
[0018] All the second input features and their corresponding service quality are used as the second feature dataset.
[0019] In one possible implementation of the first aspect, training the intermediate detection model based on the second feature dataset to obtain the target detection model includes:
[0020] Each of the second input features is input into the recursive routing module of the intermediate detection model to obtain the second prediction result;
[0021] Based on the second prediction result and the corresponding service quality, determine the second loss of the second prediction result;
[0022] The second model parameters of the recursive routing module are iteratively updated according to the second loss until the detection model meets the preset second training stopping condition, thus obtaining the target detection model; the second training stopping condition is that the second loss is less than the second preset loss threshold or the number of iterations reaches the second preset number.
[0023] In one possible implementation of the first aspect, the feature selection module is an automatic sparse feature selection module, used to learn effective features related to the service quality in the first input features and output the weight values of each feature; the recursive routing module is used to dynamically predict the required number of recursions based on the features of the current input data.
[0024] Secondly, embodiments of this application provide a service quality detection method, including:
[0025] Acquire monitoring data of the target to be detected;
[0026] The target monitoring data is input into the target detection model to obtain the service quality detection score corresponding to the target monitoring data, wherein the target detection model is trained using the training method of the detection model as described in any one of the first aspects above.
[0027] Thirdly, embodiments of this application provide a training apparatus for a detection model, comprising:
[0028] The first acquisition module is used to acquire a first feature dataset, wherein the first feature dataset includes multiple first input features and the service quality corresponding to each first input feature;
[0029] The first training module is used to train the detection model by using all the first input features and the corresponding service quality as model input samples and model output samples, respectively, to obtain an intermediate detection model; the intermediate detection model is used to learn the effective features related to the service quality in the first input features;
[0030] The determination module is used to determine the second feature dataset based on the first feature dataset and the intermediate detection model;
[0031] The second training module is used to train the intermediate detection model based on the second feature dataset to obtain the target detection model.
[0032] Fourthly, embodiments of this application provide a service quality detection device, comprising:
[0033] The second acquisition module is used to acquire monitoring data of the target to be detected.
[0034] The input / output module is used to input the target monitoring data into the target detection model to obtain the service quality detection score corresponding to the target monitoring data, wherein the target detection model is trained using the training method of the detection model as described in any one of the first aspects above.
[0035] Fifthly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a training method for a detection model as described in any one of the first aspects above; or, when the processor executes the computer program, it implements a service quality detection method as described in the second aspect above.
[0036] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a training method for a detection model as described in any one of the first aspects above; or, when executed by a processor, the computer program implements a quality of service detection method as described in the second aspect above.
[0037] In a seventh aspect, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the training method of the detection model described in any one of the first aspects; or causes the terminal device to execute the service quality detection method described in the second aspect.
[0038] The beneficial effects of the embodiments in this application compared with the prior art are:
[0039] The training method for the detection model provided in the first aspect of this application involves: First, acquiring a first feature dataset, which includes multiple first input features and corresponding service quality metrics. Then, using each first input feature in the first feature dataset as a model input sample and the corresponding service quality metric as a model output sample, the initial detection model undergoes a first-stage training to obtain an intermediate detection model. The core objective of this stage is to enable the intermediate detection model to autonomously learn and identify effective features related to service quality among the first input features, filtering out interference from redundant and noisy features. Next, based on the first feature dataset and the training results of the intermediate detection model, the effective features determined by the intermediate detection model are extracted, i.e., second input features. The second input features and their corresponding service quality metrics are combined to form a second feature dataset. Finally, using the second feature dataset as training data, the intermediate detection model undergoes a second-stage training. During the training process, the model hyperparameters can be adjusted according to actual needs, or fine-tuning, parameter freezing, and other methods can be used to reduce training overhead, ultimately obtaining a target detection model with high detection accuracy and low computational complexity. This training method enables the target detection model to accurately predict the service quality of monitoring data, ensuring that cluster resource scheduling and service quality requirements in the cloud system are matched.
[0040] It is understood that the beneficial effects of the third, fifth to seventh aspects mentioned above can be found in the relevant descriptions in the first aspect above, and will not be repeated here. The beneficial effects of the fourth, fifth to seventh aspects mentioned above can be found in the relevant descriptions in the second aspect above, and will not be repeated here. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a schematic flowchart of a training method for a detection model provided in an embodiment of this application;
[0043] Figure 2 This is a flowchart illustrating another method for training a detection model according to an embodiment of this application;
[0044] Figure 3 This is a flowchart illustrating another method for training a detection model according to an embodiment of this application;
[0045] Figure 4 This is a flowchart illustrating another method for training a detection model according to an embodiment of this application;
[0046] Figure 5 This is a schematic flowchart of a service quality testing method provided in an embodiment of this application;
[0047] Figure 6 This is a schematic diagram of the structure of a training device for a detection model provided in one embodiment of this application;
[0048] Figure 7 This is a schematic diagram of the structure of a service quality testing device provided in an embodiment of this application;
[0049] Figure 8 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0050] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0051] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0052] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0053] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0054] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0055] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0056] With the rapid development and widespread adoption of cloud computing technology, cloud platforms have become a core component of modern digital infrastructure. Whether it's enterprise application deployment, artificial intelligence inference computing, or online data storage and distribution services, their performance is highly dependent on cloud computing and storage resources. To maximize resource utilization within the constraints of Service Level Agreements (SLAs), cloud service providers typically employ resource over-allocation strategies, running multiple virtual machines or container instances on the same physical server to improve overall hardware utilization and profitability.
[0057] However, in multi-tenant cloud environments with shared resources, resource contention and performance interference are difficult to avoid. When multiple tenants' tasks simultaneously compete for critical resources such as CPU, memory, and network I / O, it can easily lead to a decline in Quality of Service (QoS). This decline manifests as increased task latency, significant response fluctuations, and even service anomalies, severely impacting the end-user experience and overall system stability. Therefore, performance monitoring of cloud computing systems becomes extremely important.
[0058] Currently, performance monitoring of cloud computing systems mainly relies on two types of methods: the first is the traditional monitoring method based on static thresholds or rules. This type of method detects anomalies by setting preset performance indicator thresholds (such as setting CPU utilization to 80% or network latency to 50 milliseconds), triggering alarms or resource adjustments when the indicators exceed the threshold range. However, the types of workloads in cloud environments are extremely diverse (such as database services, caching systems, video transcoding, and artificial intelligence inference), and the resource requirements and performance characteristics of different tasks vary significantly. Fixed threshold strategies are often difficult to adapt to complex and dynamic scenarios. This type of method has poor adaptability to heterogeneous workloads, is prone to false negatives and false negatives, and fails to meet the requirements of real-time performance and accuracy.
[0059] The second category is intelligent monitoring methods based on artificial intelligence. With the development of machine learning and deep learning technologies, more and more research is beginning to utilize artificial intelligence models to automatically extract features from historical performance data, achieving adaptive identification and prediction of performance degradation. These methods have demonstrated high detection accuracy and generalization ability in the field of cloud system performance monitoring. Although AI-driven detection methods have significant advantages in accuracy and robustness, they also face many challenges in practical deployment. First, acquiring high-quality performance data requires significant investment of manpower, resources, and time, and is susceptible to noise, leading to inaccurate data. Second, deep models have a large parameter scale and are heavily reliant on computing and storage resources, making real-time inference difficult on resource-constrained host machines or edge nodes, limiting their widespread application in the cloud. Finally, biases exist between model training and inference phases, affecting the model's performance stability in real-world environments.
[0060] Therefore, existing solutions for monitoring the performance of cloud systems still suffer from problems such as high feature acquisition costs and susceptibility to noise, high model computational complexity, large deployment overhead, and inconsistencies between model training and inference stages, making it difficult to meet the service quality assurance requirements of multi-tenant resource contention scenarios.
[0061] To address the aforementioned technical issues, this application provides a training method for a detection model. First, a first feature dataset is acquired, containing multiple first input features and corresponding service quality metrics. Then, each first input feature in the first feature dataset is used as a model input sample, and the corresponding service quality metric is used as a model output sample. This initial detection model undergoes a first-stage training to obtain an intermediate detection model. The core objective of this stage is to enable the intermediate detection model to autonomously learn and identify effective features related to service quality among the first input features, filtering out redundant and noisy features. Next, based on the first feature dataset and the training results of the intermediate detection model, effective features determined by the intermediate detection model are extracted, i.e., second input features. These second input features are combined with their corresponding service quality metrics to form a second feature dataset. Finally, the second feature dataset is used as training data to perform a second-stage training on the intermediate detection model. During training, model hyperparameters can be adjusted according to actual needs, or fine-tuning and parameter freezing can be used to reduce training overhead, ultimately resulting in a target detection model with high detection accuracy and low computational complexity. This training method enables the target detection model to accurately predict the service quality of monitoring data, ensuring that cluster resource scheduling and service quality requirements in the cloud system are matched.
[0062] See Figure 1 This is a flowchart illustrating the training method of the detection model provided in this application embodiment. It is intended as an example and not a limitation. The method may include the following steps:
[0063] Step S101: Obtain the first feature dataset, wherein the first feature dataset contains multiple first input features and the service quality corresponding to each first input feature.
[0064] In this embodiment, firstly, a large amount of historical monitoring data is collected. In cloud computing performance monitoring scenarios, historical monitoring data can be collected from various sources, such as server logs of the cloud computing system, network device monitoring panels, user access behavior records, and resource scheduling module statistics. Each piece of historical monitoring data is treated as a monitoring sample. By analyzing and processing the historical monitoring data, high-dimensional first input features and corresponding service quality are extracted from each monitoring sample. The service quality is used to quantify the cloud computing service operation level corresponding to the monitoring sample. The first input features extracted from all monitoring samples are combined with the corresponding service quality to form a first feature dataset.
[0065] The first input feature of each monitoring sample has a uniform number of dimensions (e.g., all monitoring samples contain 15 dimensional features). This first input feature is a high-dimensional set of multiple indicators, covering core technical indicators related to the operational status and service quality of the cloud computing system. Specifically, it includes, but is not limited to: memory utilization, disk I / O read / write speed, storage capacity utilization, GPU utilization, request response latency, request success rate, concurrent requests, timeout request percentage, average server load, network packet loss rate, connection establishment time, resource scheduling wait time, number of service interruptions per unit time, frequency of abnormal process restarts, and data transmission error rate.
[0066] Step S102: Use all the first input features and the corresponding service quality as model input samples and model output samples respectively to train the detection model and obtain the intermediate detection model; the intermediate detection model is used to learn the effective features related to service quality in the first input features.
[0067] For example, using the first feature dataset as the training dataset, all first input features in the first feature dataset are used as model input samples, and the service quality corresponding to each first input feature is used as the model output sample (i.e., the true label in the supervised training task). The detection model is then trained iteratively under supervised conditions based on the model input samples and model output samples, optimizing the model parameters until a preset first training stopping condition is met, ultimately yielding an intermediate detection model. The intermediate detection model can mine and filter low-dimensional effective features (defined as second input features) that are strongly correlated with service quality from the high-dimensional first input features, achieving dimensionality reduction of features and extraction of effective information.
[0068] Specifically, the detection model in this embodiment includes a feature selection module and a recursive routing module. The feature selection module, as the front-end preprocessing unit of the detection model, performs adaptive sparsity learning for the first input feature of dimension d through a gated sampling mechanism. This transforms the discrete feature selection problem into a continuous parameter optimization problem, ensuring both the gradientability of the training process and enabling deterministic feature selection in the later stages of training. Ultimately, it accurately retains effective features that are strongly correlated with service quality, providing a high-quality low-dimensional input foundation for feature fusion and inference in the subsequent recursive routing module.
[0069] For example, firstly, an independent learnable parameter ai is assigned to each dimension i (i=1,2,...,d, d=15 in this embodiment) of the first input feature to quantify the potential correlation strength between that feature dimension and service quality. Next, to avoid overfitting the model to specific patterns in the training data, random noise ui following a uniform distribution U(0,1) is introduced, and a random logit value li is generated using the formula li=log(ui)-log(1-ui)+ai. Then, a temperature-controlled sigmoid function and a pruning transformation are used to map the logit value li to the feature selection probability zi, i.e., feature gating. Finally, an expected L0 norm regularization term Lreg=λ is introduced. E[∣z∣0], where λ is the regularization coefficient, and ∣z∣0 represents the L0 norm (i.e., the number of non-zero elements) of the feature gate vector z. The expression ] represents the expectation operation. This regularization term penalizes the high-dimensional feature selection results, forcing the model to retain only a small number of effective features, thus achieving sparsity constraints and reducing model complexity and computational cost. Finally, the feature selection module filters the first input features dimension by dimension using the feature gating vector z, retaining features with zi≥0.5 and discarding features with zi<0.5, ultimately outputting the filtered third input features.
[0070] The recursive routing module serves as the prediction execution unit of the detection model. Its input is the third input feature output by the feature selection module. Its core function is to analyze the service quality correlation information contained in the features through recursive feature mapping and dynamic parameter calculation, and output the service quality prediction result.
[0071] Specifically, after receiving the third input feature, the recursive routing module performs a refined analysis of the hidden service quality dependencies (including temporal correlations and dimensional coupling correlations) in the third input feature through recursive feature transformation and adaptive parameter optimization (such as feature iterative mapping of multi-layer recursive neural networks and dynamic routing weight allocation algorithms). Finally, it outputs the first service quality prediction result corresponding to the third input feature. This first prediction result needs to be directly compared with the actual service quality (i.e., model training sample labels) corresponding to the first input feature. By calculating the first loss function value between the two (such as mean squared error loss and cross-entropy loss), backpropagation iteratively updates the first model parameters of the feature selection module (such as feature importance weight calculation parameters and mask generation parameters) and the second model parameters of the recursive routing module (such as recursive mapping network parameters and routing control parameters) until the preset first training stopping condition is met (such as the loss function value converging to a threshold or the number of iterations reaching an upper limit). Finally, an intermediate detection model with feature selection and deep modeling capabilities is obtained.
[0072] In this embodiment, the recursive routing module adopts a combination of parameter sharing and adaptive routing control from a single-layer Transformer encoder F to achieve efficient deep feature modeling. The specific design is as follows: An independent recursive router is introduced, which is jointly trained with the Transformer encoder F to synchronously learn the mapping relationship between the complexity features of the input features and the optimal recursion depth; during the inference phase, the recursive router, based on the current input features H^(k... 1) The feature distribution characteristics (such as feature variance, key dimension values, temporal fluctuation intensity, etc.) of the original input H^(0) during the initial iteration are used to dynamically predict the optimal recursion number N and adaptively adjust the computational depth of the model; wherein, the recursive calculation process satisfies the following formula: H^(k)=F(H^(k)) 1), k=1,2,…,N.
[0073] Where F represents the parameter-shared Transformer encoder, H^(k) is the feature representation after the kth recursion, and N is the number of adaptive recursions predicted by the routing controller.
[0074] The joint optimization of the feature selection module and the recursive routing module enables the intermediate detection model to synchronously learn the correlation between sparse feature masks and service quality on the first feature dataset.
[0075] Step S103: Determine the second feature dataset based on the first feature dataset and the intermediate detection model.
[0076] In this embodiment, the feature selection module of the intermediate detection model has mastered the quantitative correlation law between the first input features and service quality through iterative optimization during the joint training process in step S102. This includes the importance weights of each dimension index and the correlation threshold between features and prediction errors. Therefore, it can be directly used for batch screening and dimensionality reduction of the first feature dataset. The specific steps are as follows: all the original high-dimensional first input features (15 dimensions in this embodiment) in the first feature dataset are batch input into the feature selection module of the intermediate detection model; based on the correlation law learned during the training phase, the feature selection module outputs binary feature importance weight values (takes a value of 0 or 1) for each of the 15 dimension indexes of the first input features. Among them, a weight value of 1 indicates that the correlation between the dimension and service quality is higher than the preset threshold (the correlation threshold is set to 0.7 in this embodiment), and a weight value of 0 indicates that the correlation is lower than the threshold; the dimension index with a weight value of 1 is selected as the constituent dimension of the second input feature. For example, if the dimensions retained after filtering are request response latency, request success rate, number of concurrent requests, average server load, and network packet loss rate, then the dimensions of the second input feature are reduced from 15 to 5, achieving effective compression of high-dimensional features.
[0077] For each monitoring sample in the first feature dataset, the corresponding second input feature is extracted; at the same time, the original service quality (i.e., the true label) corresponding to the first input feature in each monitoring sample is retained, and the sample pairs of the second input feature and the corresponding service quality are recombined to finally form a second feature dataset with unified structure and optimized dimensions.
[0078] Taking the first input feature with 15 dimensions as an example, if the dimension indicators that meet the threshold requirements after filtering are request response latency, request success rate, number of concurrent requests, average server load, and network packet loss rate, then these 5 dimension indicators together constitute the second input feature. At this time, the dimension of the second input feature is reduced from 15 dimensions to 5 dimensions, achieving effective compression of high-dimensional features.
[0079] Step S104: Train the intermediate detection model based on the second feature dataset to obtain the target detection model.
[0080] In this embodiment, considering that the second feature dataset has already undergone redundant information removal by the feature selection module, retaining only effective features strongly correlated with service quality (5 dimensions in this embodiment), and that the feature selection module has learned stable feature selection rules during joint training in step S102, this step freezes all model parameters of the feature selection module, including the gating coefficients zi (binary mask parameters used to control whether features are retained) for each dimension of features, the regularization coefficients λ (constraint parameters used to balance feature sparsity and prediction accuracy), etc., to avoid disrupting the optimized feature selection logic due to subsequent training; only the core trainable parameters of the recursive routing module are iteratively updated, focusing on adapting to the deep modeling requirements of 5-dimensional simplified features. The parameters that need fine-tuning include: recursive mapping network parameters: self-attention weight matrix of single-layer Transformer encoder F, convolution kernel parameters and bias terms of feedforward neural network (FFN); output layer parameters: service quality prediction head connection weights after recursive feature mapping, activation function related parameters; routing control parameters: recursive routing controller (Recursive The decision network parameters (such as fully connected layer weights, feature complexity evaluation parameters, etc.) used in the Router to predict the optimal number of recursions N.
[0081] For example, the second feature dataset is divided into a training set and a validation set according to a preset ratio (e.g., 8:2). Standardization (e.g., Z-score normalization) is performed on the 5-dimensional second input features to ensure that the feature values are of the same order of magnitude, avoiding impact on model convergence speed and prediction accuracy. The second input features from the training set are input into the intermediate detection model. The feature selection module directly passes the second input features to the recursive routing module based on the frozen first model parameters. The recursive routing module receives the second input features and dynamically recursively calculates (according to the formula H(k)=F(H(k))) 1) Perform N iterations of mapping) parse the service quality association information in the features and finally output the second service quality prediction result; use the same loss function as in step S102 (such as mean squared error loss) to calculate the second loss value between the second prediction result and the real service quality label; use the backpropagation algorithm to pass the loss gradient only to the fine-tunable parameters of the recursive routing module, update the parameters according to the preset learning rate (set to 1e-5 in this embodiment, lower than the learning rate in the joint training stage to avoid parameter oscillation), and realize the model's adaptation learning to the simplified features; use the validation set to evaluate the model's prediction accuracy (such as MAE, RMSE indicators) for each preset number of iterations (such as 10 rounds); if the validation set accuracy does not improve or the loss value increases for several consecutive rounds (such as 5 rounds), trigger the early stopping mechanism to terminate the training to avoid overfitting; after training is terminated, save the complete parameters of the feature selection module (parameter frozen state) and the fine-tuned recursive routing module to form the final target detection model.
[0082] In some embodiments, such as Figure 2 As shown, step S102 further includes steps S1021 to S1024.
[0083] Step S1021: Input all the first input features into the feature selection module respectively to obtain the third input features corresponding to each first input feature.
[0084] In this embodiment, all first input features (original high-dimensional multi-indicator features, 15 dimensions in this embodiment) in the first feature dataset are input one by one into the feature selection module. Based on the initial model parameters (such as randomly initialized gating coefficient zi and regularization coefficient λ), the module performs the following filtering operation on each group of first input features: quantifies the importance of each of the 15 dimensional indicators by calculating the correlation between the features and the service quality labels (such as mutual information entropy and gradient contribution analysis); generates a binary filtering mask based on the quantization results, retaining the corresponding dimensional feature when the mask value is 1, and removing the dimensional feature when it is 0 (the mask parameters are dynamically optimized with iteration during the initial training phase); and reorganizes the effective features after mask filtering according to the original dimensional order to form a third input feature corresponding to a single group of first input features (dimensionality ≤ 15, the dimensionality may be high in the initial stage, and will be gradually reduced with training iteration).
[0085] Step S1022: Input each third input feature into the recursive routing module to obtain the first prediction result corresponding to each third input feature.
[0086] In this embodiment, the recursive router predicts the optimal number of recursions N based on the complexity of the current third input feature (such as feature variance and fluctuation range of key indicators). Based on the predicted number of recursions N, iterative feature mapping is performed through the parameter-shared Transformer encoder F, and the calculation process satisfies the formula: H^(k)=F(H^(k-1)), k=1,2,…,N
[0087] Where H(0) is the preprocessed third input feature, and H(N) is the final deep feature representation; H(N) is input to the prediction output layer (fully connected layer + activation function) and outputs the first service quality prediction result (such as service quality score, anomaly probability value, etc.) corresponding to the current third input feature.
[0088] Step S1023: Determine the first loss of the first prediction result based on the service quality and the first prediction result.
[0089] In this embodiment, the mean squared error (MSE) loss function is used to calculate the first loss between the first prediction result and the actual service quality.
[0090] Step S1024: Iteratively update the first model parameters of the feature selection module and the second model parameters of the recursive routing module according to the first loss until the detection model meets the preset first training stopping condition to obtain the intermediate detection model; the first training stopping condition is that the first loss is less than the first preset loss threshold or the number of iterations reaches the first preset number.
[0091] In this embodiment, based on the first loss calculated in step S1023, the first model parameters of the feature selection module and the second model parameters of the recursive routing module are iteratively updated through a backpropagation algorithm (such as the Adam optimizer) until a preset first training stopping condition is met. The specific process is as follows: the average first loss value is backpropagated to the feature selection module and the recursive routing module, and the gradient values of each trainable parameter are calculated respectively. The gradient of the first model parameter includes the gating coefficient zi, the regularization coefficient λ, and the weights related to feature importance calculation, etc.; the gradient of the second model parameter includes the self-attention weights of the Transformer encoder F, the parameters of the feedforward neural network, and the decision network weights of the recursive routing controller. The system first calculates the weights of the recursive and predictive output layer connections, then updates these parameters according to a preset learning rate. During the update process, regularization constraints (such as L0 regularization) are used to prevent overfitting of the feature selection module parameters, and gradient clipping (such as limiting the gradient norm to within 1.0) is used to prevent oscillation of the recursive routing module parameters. After each parameter update, the system checks whether any of the following first training stopping conditions are met: the average first loss value of the current batch is less than the first preset loss threshold; or the number of parameter update iterations reaches the first preset number. When any of the above conditions are met, training is terminated, and all parameters of the current feature selection module and recursive routing module are saved to form an intermediate detection model with preliminary feature selection and deep modeling capabilities.
[0092] In some embodiments, such as Figure 3 As shown, step S103 further includes steps S1031 and S1032.
[0093] Step S1031: Input each first input feature into the feature selection model of the intermediate detection model, and filter out the features whose feature weights are greater than a preset threshold among the first input features to obtain the second input features.
[0094] In this embodiment, each first input feature in the first feature dataset is input one by one into the feature selection module of the trained intermediate detection model. Through the adaptive sparsity filtering mechanism of this module, a set of low-dimensional features that are strongly correlated with service quality is extracted from the high-dimensional first input features to obtain the second input features.
[0095] Step S1032: Use all the second input features and their corresponding service quality as the second feature dataset.
[0096] In this embodiment, for each monitoring sample in the first feature dataset, the corresponding second input feature is extracted; at the same time, the original service quality (i.e., real label) corresponding to the first input feature in each monitoring sample is retained, and the sample pairs of the second input feature and the corresponding service quality are recombined to finally form a second feature dataset with unified structure and optimized dimensions.
[0097] It should be noted that the 15-dimensional first input feature and the 5-dimensional second input feature are specific examples of this embodiment, and this embodiment does not limit the specific dimensions of the first and second input features.
[0098] In some embodiments, such as Figure 4 As shown, step S104 further includes steps S1041 and S1043.
[0099] Step S1041: Input each second input feature into the recursive routing module of the intermediate detection model to obtain the second prediction result.
[0100] In this embodiment, the first model parameters of the fixed feature selection module are used to input the second input features one by one into the recursive routing module of the intermediate detection model. After receiving the second input features, the recursive routing module performs in-depth analysis on the service quality dependencies (temporal correlation, dimensional coupling correlation, etc.) hidden in the second input features according to its preset dynamic recursion depth and parameter-sharing Transformer encoding logic, and outputs the service quality prediction result corresponding to the second input feature, which is defined as the second prediction result.
[0101] Step S1042: Determine the second loss of the second prediction result based on the second prediction result and the corresponding service quality.
[0102] In this embodiment, for each second prediction result output in step S1041, it is compared with the corresponding real service quality label in the second feature dataset, and the degree of difference between the two is calculated by a preset loss function to obtain the second loss.
[0103] Step S1043: Iteratively update the second model parameters of the recursive routing module according to the second loss until the detection model meets the preset second training stopping condition to obtain the target detection model; the second training stopping condition is that the second loss is less than the second preset loss threshold or the number of iterations reaches the second preset number.
[0104] In this embodiment, the second loss calculated in step S1042 is used as the optimization target. The backpropagation algorithm is used to iteratively update only the second model parameters of the recursive routing module (including the self-attention weights of the Transformer encoder, the parameters of the feedforward neural network, and the decision network parameters of the recursive routing controller, etc.). The first model parameters of the feature selection module remain fixed. The iterative update process continues until the preset second training stopping condition is met. At this time, the recursive routing module completes the fine optimization, and the intermediate detection model is upgraded to the final target detection model.
[0105] The second training termination condition is as follows: the average loss value of the current batch is less than the second preset loss threshold; the number of parameter update iterations reaches the second preset number; when any of the above conditions are met, the parameter iteration update process is immediately terminated, the backpropagation calculation is stopped, and all parameters of the current model are completely saved, including the fixed parameters of the feature selection module (first model parameters); and the parameters of the recursive routing module optimized by the second loss (updated second model parameters); thus forming the final object detection model. The object detection model inherits the efficient feature selection capability of the intermediate detection model, and at the same time has the deep association analysis and accurate prediction capability optimized by the effective feature dataset.
[0106] Figure 5 A schematic flowchart of a service quality inspection process according to an embodiment of this application is shown. See also Figure 5 As shown, the service quality detection method includes steps S201 and S202.
[0107] Step S201: Obtain monitoring data of the target to be detected.
[0108] In cloud computing performance monitoring scenarios, newly generated monitoring data is used as target monitoring data. Specifically, distributed monitoring components deployed in cloud computing systems, such as server-side monitoring agents, network device traffic collectors, or data loggers in resource scheduling modules, can be used to capture dynamic indicators during system operation in real time. The captured content must completely match the dimensions of the first input feature in step S101, including but not limited to: real-time memory utilization, disk I / O read / write speed, GPU real-time load, request response latency, concurrent request count, network packet loss rate, and service interruption count per unit time, among other 15 dimensions.
[0109] Step S202: Input the target monitoring data into the target detection model to obtain the service quality detection score corresponding to the target monitoring data. The target detection model is trained using the training method of the detection model described above.
[0110] In this embodiment, target monitoring data is input into the target detection model trained by the above training method. The feature selection module of the target detection model quickly filters the first input features of the high-dimensional target monitoring data based on the feature importance weight mask learned during the training phase, retaining only the second input features that are strongly correlated with service quality. The filtered second input features are then input into the fine-tuned recursive routing module. The prediction output layer of the fine-tuned recursive routing module outputs the service quality detection score corresponding to the effective features of the filtered target monitoring data.
[0111] The target detection model provided in this invention addresses key technical bottlenecks in existing cloud service quality (QoS) detection models, such as high feature dimensionality redundancy, large computational overhead, high inference latency, and poor deployment adaptability. It employs an adaptive sparse feature selection module to accurately select effective features strongly correlated with service quality from high-dimensional raw features (reducing the dimensionality from the traditional 15-20 dimensions to 3-5 dimensions), significantly reducing the number of metrics collected. This reduces sampling frequency and communication bandwidth consumption while avoiding the performance impact of excessive collection on virtual machine applications, achieving a balance between lightweight collection and accurate detection. A single-layer Transformer encoder reuses a set of parameters to complete multiple rounds of recursive mapping, achieving lightweight model (parameter count ≤ 1 million) and low-latency inference (inference time ≤ 30ms), allowing direct deployment on resource-constrained cloud edge nodes or lightweight computing environments. The first stage involves jointly training the feature selection module and the recursive routing module to obtain an intermediate detection model, learning feature importance and fundamental correlations. The second stage fixes the feature selection parameters and optimizes only the recursive routing module, ensuring the stability of feature selection while improving prediction accuracy and avoiding performance degradation across stages.
[0112] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0113] Corresponding to the training method of the detection model described in the above embodiments, Figure 6 This is a structural block diagram of the training device for the detection model provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0114] Reference Figure 6 The training apparatus for this detection model includes:
[0115] The first acquisition module 61 is used to acquire a first feature dataset, wherein the first feature dataset includes a plurality of first input features and the service quality corresponding to each first input feature;
[0116] The first training module 62 is used to train the detection model by using all the first input features and the corresponding service quality as model input samples and model output samples respectively, to obtain an intermediate detection model; the intermediate detection model is used to learn the effective features related to the service quality in the first input features;
[0117] The determining module 63 is used to determine the second feature dataset based on the first feature dataset and the intermediate detection model;
[0118] The second training module 64 is used to train the intermediate detection model based on the second feature dataset to obtain the target detection model.
[0119] Corresponding to the service quality testing method described in the above embodiments, Figure 7 This is a structural block diagram of the service quality detection method and apparatus provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0120] Reference Figure 7 The service quality testing device includes:
[0121] The second acquisition module 71 is used to acquire monitoring data of the target to be detected;
[0122] The input / output module 72 is used to input the target monitoring data into the target detection model to obtain the service quality detection score corresponding to the target monitoring data, wherein the target detection model is trained using the training method of the above-mentioned detection model.
[0123] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0124] in addition, Figure 6 The training device for the detection model shown Figure 7 The service quality detection device shown can be a software unit, hardware unit, or a combination of software and hardware built into existing terminal equipment, or it can be integrated into the terminal equipment as an independent component, or it can exist as an independent terminal equipment.
[0125] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0126] Figure 8This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. For example... Figure 8 As shown, the terminal device 8 of this embodiment includes: at least one processor 80 ( Figure 8 The diagram shows only one processor, a memory 81, and a computer program 82 stored in the memory 81 and executable on the at least one processor 80. When the processor 80 executes the computer program 82, it implements the steps in the training method or service quality detection method embodiments of any of the above detection models.
[0127] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. This terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 8 This is merely an example of terminal device 8 and does not constitute a limitation on terminal device 8. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0128] The processor 80 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0129] In some embodiments, the memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. In other embodiments, the memory 81 may be an external storage device of the terminal device 8, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 8. Furthermore, the memory 81 may include both internal and external storage units of the terminal device 8. The memory 81 is used to store the operating system, applications, boot loader, data, and other programs, such as the program code of the computer program. The memory 81 can also be used to temporarily store data that has been output or will be output.
[0130] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the above-described method embodiments.
[0131] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.
[0132] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0133] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0134] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0135] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0136] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0137] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for training a detection model, characterized in that, include: Obtain a first feature dataset, wherein the first feature dataset contains multiple first input features and the service quality corresponding to each first input feature; All the first input features and the corresponding service quality are used as model input samples and model output samples, respectively, to train the detection model and obtain an intermediate detection model; the detection model includes a feature selection module and a recursive routing module; the intermediate detection model is used to learn effective features related to the service quality from the first input features; When training the detection model to obtain the intermediate detection model, the following operations are performed: All the first input features are input into the feature selection module respectively to obtain the third input feature corresponding to each of the first input features; Each of the third input features is input into the recursive routing module to obtain a first prediction result corresponding to each of the third input features; Based on the service quality and the first prediction result, determine the first loss of the first prediction result; The first model parameters of the feature selection module and the second model parameters of the recursive routing module are iteratively updated according to the first loss until the detection model meets the preset first training stopping condition, thus obtaining the intermediate detection model; the first training stopping condition is that the first loss is less than the first preset loss threshold or the number of iterations reaches the first preset number. Based on the first feature dataset and the intermediate detection model, a second feature dataset is determined; The intermediate detection model is trained based on the second feature dataset to obtain the target detection model.
2. The training method for the detection model according to claim 1, characterized in that, The step of determining the second feature dataset based on the first feature dataset and the intermediate detection model includes: Each of the first input features is input into the feature selection model of the intermediate detection model to filter out features whose feature weights are greater than a preset threshold, thus obtaining the second input features. All the second input features and their corresponding service quality are used as the second feature dataset.
3. The training method for the detection model according to claim 2, characterized in that, The step of training the intermediate detection model based on the second feature dataset to obtain the target detection model includes: Each of the second input features is input into the recursive routing module of the intermediate detection model to obtain the second prediction result; Based on the second prediction result and the corresponding service quality, determine the second loss of the second prediction result; The second model parameters of the recursive routing module are iteratively updated according to the second loss until the detection model meets the preset second training stopping condition, thus obtaining the target detection model; the second training stopping condition is that the second loss is less than the second preset loss threshold or the number of iterations reaches the second preset number.
4. The training method for the detection model according to any one of claims 1-3, characterized in that, The feature selection module is an automatic sparse feature selection module, which is used to learn the effective features related to the service quality in the first input features and output the weight values of each feature; the recursive routing module is used to dynamically predict the required number of recursions based on the features of the current input data.
5. A service quality testing method, characterized in that, include: Acquire monitoring data of the target to be detected; The target monitoring data is input into the target detection model to obtain the service quality detection score corresponding to the target monitoring data, wherein the target detection model is trained using the training method of the detection model as described in any one of claims 1-4.
6. A training device for a detection model, characterized in that, include: The first acquisition module is used to acquire a first feature dataset, wherein the first feature dataset includes multiple first input features and the service quality corresponding to each first input feature; The first training module is used to train the detection model by using all the first input features and the corresponding service quality as model input samples and model output samples, respectively, to obtain an intermediate detection model; the detection model includes a feature selection module and a recursive routing module; the intermediate detection model is used to learn effective features related to the service quality from the first input features; The first training module is further configured to perform the following operations when training the detection model to obtain the intermediate detection model: inputting all the first input features into the feature selection module to obtain third input features corresponding to each of the first input features; inputting each of the third input features into the recursive routing module to obtain first prediction results corresponding to each of the third input features; determining a first loss of the first prediction results based on the service quality and the first prediction results; iteratively updating the first model parameters of the feature selection module and the second model parameters of the recursive routing module based on the first loss until the detection model meets a preset first training stopping condition to obtain the intermediate detection model; the first training stopping condition is that the first loss is less than a first preset loss threshold or the number of iterations reaches a first preset number; The determination module is used to determine the second feature dataset based on the first feature dataset and the intermediate detection model; The second training module is used to train the intermediate detection model based on the second feature dataset to obtain the target detection model.
7. A service quality testing device, characterized in that, include: The second acquisition module is used to acquire monitoring data of the target to be detected. The input / output module is used to input the target monitoring data into the target detection model to obtain the service quality detection score corresponding to the target monitoring data, wherein the target detection model is trained using the training method of the detection model as described in any one of claims 1-4.
8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the training method of the detection model as described in any one of claims 1 to 4; or, when the processor executes the computer program, it implements the service quality detection method as described in claim 5.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the training method of the detection model as described in any one of claims 1 to 4; or, when the processor executes the computer program, it implements the service quality detection method as described in claim 5.