A label marking method, device, equipment, medium and product of a Pod

By monitoring Pod parameter information in real time and matching it with the tag database, and combining K-Means clustering and entropy weighting, Pod tag features are dynamically updated, solving the reliability and flexibility issues of Pod tag management in Kubernetes and achieving highly accurate tag marking.

CN120804761BActive Publication Date: 2026-01-23CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511262434.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2026-01-23
Estimated Expiration
2045-09-05

AI Technical Summary

Technical Problem

Existing Pod tag management technologies suffer from the risk of human error and poor node scheduling flexibility, especially when statically tagging nodes in Kubernetes via YAML files, resulting in insufficient reliability and scheduling flexibility.

Method used

A dynamic tag management method is adopted, which monitors the parameter information of Pods in real time and matches it with a preset tag database. K-Means clustering and entropy weight method are used to calculate weight values ​​and dynamically update the tag features of Pods to achieve fine-grained tag marking.

Benefits of technology

It enables dynamic tag management without human intervention, improves the accuracy and reliability of Pod tagging, adapts to the customized needs of different business scenarios, and ensures that tags match Pod status in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804761B_ABST
    Figure CN120804761B_ABST
Patent Text Reader

Abstract

The application discloses a label marking method, device and equipment of a Pod, a medium and a product, determines a Pod to be marked in a created Pod resource, and marks the Pod as a target Pod; acquires a preset label database; wherein the label database contains a plurality of label types and a plurality of labels under each label type; real-time parameter information of the target Pod is monitored in real time; the real-time parameter information of the target Pod is matched with labels of the label database, at least one label feature matched by the target Pod is determined; and corresponding labels are marked for the target Pod according to the label features matched by the target Pod. According to the application, dynamic label management can be performed on the Pod according to parameter information of the Pod, and label marking accuracy of the Pod is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing technology, and in particular to a method, apparatus, device, medium, and product for tagging Pods. Background Technology

[0002] With the rapid increase in computing power demand, cloud computing has gradually become the mainstream method of computing power supply. Container technology is an important cornerstone of the cloud computing field, becoming a core component of modern cloud computing application development and deployment. Currently, with the trend towards cloud-native computing, more and more enterprises are uploading their services to the cloud and managing them through Kubernetes (k8s). Kubernetes is an open-source container cluster management system, mainly used for automating the deployment, scaling, scheduling, and operation of containerized applications. It supports multi-node cluster collaboration, and its core functions include container scheduling, resource monitoring, and label management. For example, it allocates Pods to appropriate nodes based on resource requirements (such as CPU and memory); provides real-time resource utilization data for Pods and nodes; and supports adding labels to Pods, nodes, and other resources as a basis for scheduling and filtering. A Pod is the smallest deployment unit in a Kubernetes cluster. A Pod can contain one or more associated containers, sharing network, storage, and other resources. Containers within a Pod are co-located and scheduled to the same node, sharing network namespaces and storage resources.

[0003] Existing tag management technologies have certain drawbacks. For example, some solutions involve manually and statically assigning tags to Kubernetes resources using YAML files, which carries the risk of human error and leads to poor reliability. Other solutions involve tagging all nodes in the same node group with the same tag, resulting in poor operability of node tags within the same group and limited flexibility in node scheduling. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus, device, medium, and product for tagging Pods, which can dynamically manage the tags of Pods based on their parameter information, thereby improving the accuracy of Pod tagging.

[0005] To achieve the above objectives, embodiments of the present invention provide a method for tagging Pods, including:

[0006] In the created Pod resources, identify the Pod to be tagged and denote it as the target Pod;

[0007] Obtain a preset tag database; wherein the tag database contains several tag types and several tags under each tag type;

[0008] Real-time monitoring of the target Pod's parameter information;

[0009] The real-time parameter information of the target Pod is matched with the tags in the tag database to determine at least one tag feature that matches the target Pod;

[0010] Based on the tag features matched by the target Pod, the target Pod is labeled with the corresponding tag.

[0011] As an improvement to the above solution, the step of matching the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod includes:

[0012] Based on the real-time parameter information of the target Pod, a Pod-tag matrix is ​​constructed; wherein, the matrix elements of the Pod-tag matrix are 1 or 0; 1 represents that the target Pod has the characteristics of a tag, and 0 represents that the target Pod does not have the characteristics of a tag;

[0013] The tag features matched by the target Pod are obtained based on the matrix elements that are 1 in the Pod-tag matrix.

[0014] As an improvement to the above scheme, after matching the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod, the method further includes:

[0015] The K-Means clustering method is used to cluster all the target Pods, resulting in several target Pod groups; wherein each target Pod group includes at least one target Pod.

[0016] Then, based on the tag features matched by the target Pod, a corresponding tag is assigned to the target Pod, including:

[0017] Based on the target Pods of the target Pod group, determine several key parameter indicators for the target Pod group;

[0018] The weight value of each key parameter index is calculated using the entropy weight method;

[0019] The weight values ​​are sorted in descending order, and the top T key parameter indicators are selected as target parameter indicators; where T≥1.

[0020] In each of the target Pods in the Pod group, the label features corresponding to the target parameter index are obtained and used as the target label features;

[0021] Based on the target label characteristics, the target Pod is labeled with the corresponding label.

[0022] As an improvement to the above scheme, the K-Means clustering method is used to cluster all the target Pods, resulting in several Pod groups, including:

[0023] Determine k initial cluster centroids; wherein the cluster centroids are generated based on the parameter information of the target Pod;

[0024] Calculate the Euclidean distance between each target Pod and the cluster centroid, and determine the cluster to which each target Pod belongs based on the Euclidean distance, to obtain k clustering results;

[0025] Update the k cluster centroids based on the real-time parameter information of the target Pod in the k clustering results;

[0026] Recalculate the Euclidean distance between each target Pod and the cluster centroid, and determine the cluster to which each target Pod belongs based on the Euclidean distance, until a preset iteration termination condition is met, and obtain the final k clustering results, which are used as k Pod groups.

[0027] As an improvement to the above scheme, the iteration termination condition is: minimization of the objective function; wherein, the objective function is the sum of the Euclidean distances between all target Pods and the centroids of all clustering results.

[0028] As an improvement to the above scheme, the step of calculating the weight value of each key parameter index using the entropy weight method includes:

[0029] Each of the key parameter indicators is subjected to data standardization processing to obtain standardized key parameter indicators;

[0030] Calculate the information entropy of each of the key parameter indicators;

[0031] The weight value of each key parameter is calculated based on the information entropy of each key parameter.

[0032] This invention provides a Pod tagging device, comprising:

[0033] The target Pod determination module is used to identify the Pods to be tagged in the created Pod resources, denoted as the target Pods;

[0034] The tag data acquisition module is used to acquire a preset tag database; wherein, the tag database contains several tag types and several tags under each tag type;

[0035] The parameter information monitoring module is used to monitor the real-time parameter information of the target Pod.

[0036] The tag feature generation module is used to match the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod.

[0037] The tagging module is used to tag the target Pod with a corresponding tag based on the tag features matched by the target Pod.

[0038] This invention provides a Pod tagging device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the Pod tagging method as described in any of the preceding claims.

[0039] This invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a Pod tagging method as described in any of the preceding claims.

[0040] This invention provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the Pod tagging method as described in any of the above embodiments.

[0041] Compared with existing technologies, the Pod tagging method, apparatus, device, medium, and product disclosed in this invention achieve dynamic tag management of target Pods without manual intervention, effectively avoiding errors in manual tagging and improving the reliability of Pod tagging. By configuring fine-grained tags, it can effectively meet the customized needs of different business scenarios and is more adaptable to specific application scenarios. Furthermore, the Pod tag characteristics are determined and dynamically updated based on the Pod's real-time parameter information, ensuring that the tags assigned to Pods match the Pod's status in real time, improving the effectiveness and accuracy of Pod tagging. Attached Figure Description

[0042] Figure 1 This is a flowchart illustrating a Pod tagging method provided in an embodiment of the present invention;

[0043] Figure 2 This is a schematic diagram of the structure of a Pod tagging device provided in an embodiment of the present invention;

[0044] Figure 3 This is a schematic diagram of the structure of a Pod tagging device provided in an embodiment of the present invention. Detailed Implementation

[0045] 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.

[0046] In the description of this application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0047] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0048] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0049] See Figure 1 This is a flowchart illustrating a Pod tagging method provided in an embodiment of the present invention. The embodiment of the present invention provides a Pod tagging method, including the following steps S11 to S15:

[0050] S11. Identify the Pod to be tagged in the created Pod resource and denote it as the target Pod;

[0051] S12. Obtain a preset tag database; wherein, the tag database contains several tag types and several tags under each tag type;

[0052] S13. Monitor the real-time parameter information of the target Pod;

[0053] S14. Match the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod;

[0054] S15. Based on the tag features matched by the target Pod, label the target Pod with the corresponding tag.

[0055] This invention enables dynamic tagging of Pods by extracting basic parameter information of Pods based on custom tags for resources in Kubernetes.

[0056] Specifically, Kubernetes defines Pod configurations and creates Pod resources using YAML or JSON files. After creating the Pod resources, it selects the Pods that need to be tagged and designates them as target Pods. Preset filtering rules can be used to filter the Pods that need to be tagged; optionally, these filtering rules are set based on the Pod's namespace.

[0057] As an example, in an e-commerce platform scenario, developers write a YAML configuration file for the order processing Pod and submit this YAML file to the Kubernetes cluster of the serverless platform. The Kubernetes cluster then creates order-pod-01. The platform's built-in filtering rules automatically include Pods with namespace=e-commerce and container.name=order-service in the list of Pods to be tagged. The Kubernetes API is used to query Pods that meet the criteria, ultimately selecting order-pod-01 through order-pod-10 as the target Pods.

[0058] A tag database is pre-built to store existing tags or newly added custom tags. Tags in the tag database are categorized and stored according to preset tag types.

[0059] Optionally, the tag types include: request type (request.type), resource utilization (resource.usage), Pod lifecycle phase (status.phase), and Pod health check status (health.check). The request type (request.type) can be used to adjust the Pod creation strategy based on traffic load; the resource utilization (resource.usage) can be used to adjust the Pod scheduling strategy based on the usage of resources such as CPU, memory, or network; the lifecycle phase (status.phase) can be used to identify resource utilization; and the health check status (health.check) can be used to optimize performance and cost, facilitating dynamic management and troubleshooting.

[0060] Each of the aforementioned tag types has several selectable values, i.e., tag values, which can be set according to specific application scenarios. Taking an e-commerce platform scenario as an example, the tags under the request type include order processing and log collection; the tags under resource utilization include high utilization, medium utilization, and low utilization. The utilization rate is determined based on the actual usage of resources such as CPU, memory, or network. For example, CPU > 80% or memory > 80% is high utilization, CPU between 40% and 80% or memory between 40% and 80% is medium utilization, and CPU < 40% or memory < 40% is low utilization. The tags under the lifecycle stage include waiting, running, and terminated. The tags under the health check status include healthy, unhealthy, and unknown, determined by whether the Pod's probe status passes.

[0061] An example of the tag database is shown in Table 1:

[0062] Table 1

[0063]

[0064] The fine-grained labels mentioned above are stored in the label database to achieve unified label management.

[0065] Furthermore, by accessing the Kubernetes Metrics API and Pod API, the running status of each target Pod can be monitored in real time, and real-time parameter information of the target Pod can be extracted. For example, the real-time parameter information includes CPU utilization, memory utilization, request type, request frequency, lifecycle stage, health score, etc.

[0066] Based on the tags in the database and the real-time parameter information of the target Pod, it is determined whether the target Pod meets the corresponding tag features, thus obtaining the tag features of each target Pod and forming a tag feature library for each target Pod. Understandably, the tag feature library is dynamically updated as the real-time parameter information of the target Pod changes.

[0067] The label features of each target Pod are analyzed in the label feature library, and a suitable label is selected from the database and assigned to the target Pod. The selected label will also be dynamically updated as the label feature library is updated, thereby achieving the effect of dynamically labeling the Pod.

[0068] By employing the technical means of this invention, dynamic tag management of target Pods without manual intervention is achieved, effectively avoiding errors in manual tagging and improving the reliability of Pod tagging. By configuring fine-grained tags, it can effectively meet the customized needs of different business scenarios and is more adaptable to specific application scenarios. Furthermore, the tag characteristics of a Pod are determined and dynamically updated based on the Pod's real-time parameter information, ensuring that the tags assigned to Pods match the Pod's status in real time, improving the effectiveness and accuracy of Pod tagging.

[0069] As a preferred embodiment, this invention further implements the above embodiments. Step S14, namely, matching the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature matched by the target Pod, includes steps S141 and S142:

[0070] S141. Construct a Pod-tag matrix based on the real-time parameter information of the target Pod; wherein, the matrix elements of the Pod-tag matrix are 1 or 0; 1 represents that the target Pod has the characteristics of a tag, and 0 represents that the target Pod does not have the characteristics of a tag;

[0071] S142. Obtain the tag features matched by the target Pod based on the matrix elements that are 1 in the Pod-tag matrix.

[0072] In this embodiment of the invention, in order to extract the obvious features of Pod tags, the tags can first be subjected to multi-tag binarization processing to vectorize the tag data. Assuming there are N target Pods and M tags, a Pod-tag matrix with dimensions N×M is constructed.

[0073] Elements in the matrix The definition is as follows:

[0074] ;

[0075] As an example, assume the number of target Pods to be processed is N=3, namely order-pod-01, order-pod-02, and log-pod-01. The number of tags is M=5, namely request.type=order-processing (request type is order processing), resource.usage=high (high resource utilization), resource.usage=medium (medium resource utilization), status.phase=Running (lifecycle stage is running), and health.check=healthy (health check status is healthy).

[0076] The real-time parameter information for each target Pod is obtained using the Kubernetes API. The real-time parameter information for order-pod-01 is as follows:

[0077] CPU utilization: 75%;

[0078] Memory utilization: 60%;

[0079] Request type: Order processing;

[0080] Lifecycle phase: running;

[0081] Health score: 9 (score range 0~9).

[0082] The real-time parameter information for order-pod-02 is as follows:

[0083] CPU utilization: 82%;

[0084] Memory utilization: 80%;

[0085] Request type: Order processing;

[0086] Lifecycle phase: running;

[0087] Health score: 8.

[0088] The real-time parameter information for log-pod-01 is as follows:

[0089] CPU utilization: 28%;

[0090] Memory utilization: 30%;

[0091] Request type: log-collecting;

[0092] Lifecycle phase: running;

[0093] Health score: 9.

[0094] Based on the real-time parameter information of the Pod and the preset tags, the Pod-tag matrix is ​​constructed as shown in Table 2:

[0095] Table 2

[0096]

[0097] By employing the technical means of this invention, in order to achieve real-time monitoring of the status and performance of Pods in Kubernetes, the basic parameter information of the required Pods can be obtained by accessing the Kubernetes API and using the Kubernetes Metrics API. Then, the extracted data is filtered, cleaned, and transformed as necessary, and finally the extracted feature information is stored in a tag feature library for further analysis.

[0098] In a preferred embodiment, after step S14, i.e., matching the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod, the method further includes step S16:

[0099] S14'. The K-Means clustering method is used to cluster all the target Pods to obtain several target Pod groups; wherein each target Pod group includes at least one target Pod.

[0100] In this embodiment of the invention, in order to further extract the features of the tag parameters, the Pod-tag matrix can be clustered using the K-Means clustering method to divide the target Pod into k clustering results and determine the clustering of each target Pod.

[0101] Preferably, the K-Means clustering method is used to cluster all the target Pods, resulting in several Pod groups, including S141' to S144':

[0102] S141' Determine k initial cluster centroids; wherein the cluster centroids are generated based on the parameter information of the target Pod;

[0103] S142' Calculate the Euclidean distance between each target Pod and the cluster centroid, and determine the cluster to which each target Pod belongs based on the Euclidean distance, to obtain k clustering results;

[0104] S143' Update the k cluster centroids based on the real-time parameter information of the target Pod in the k clustering results;

[0105] S144' Recalculate the Euclidean distance between each target Pod and the cluster centroid, and determine the cluster to which each target Pod belongs based on the Euclidean distance, until the preset iteration termination condition is met, and obtain the final k clustering results, which are used as k Pod groups.

[0106] Specifically, assuming there are N target Pods Each Pod's data is an n-dimensional vector. K cluster centroids are randomly selected as... Using the real-time parameter information of each target Pod, calculate the Euclidean distance between each target Pod and the cluster centroid.

[0107] ;

[0108] Based on the Euclidean distance, the cluster to which each target Pod belongs is determined, resulting in k clustering results.

[0109] For each clustering result, recalculate the cluster centroids of that cluster:

[0110]

[0111] Determine if the preset iteration termination condition is met. If the iteration termination condition is not met, recalculate the Euclidean distance between each target Pod and the updated cluster centroid, and redetermine the cluster to which each target Pod belongs based on the Euclidean distance, obtaining the updated k clustering results. When the iteration termination condition is met, stop the iteration and output the final k clustering results.

[0112] In a preferred embodiment, the iteration termination condition is: minimization of the objective function; wherein, the objective function is the sum of the Euclidean distances between all target Pods and the cluster centroids in all clustering results.

[0113] Specifically, the expression for the objective function is:

[0114]

[0115] in, For the first i One target Pod, For the first k Cluster centroids, These are the preset weighting coefficients.

[0116] The smaller the objective function value, the closer the parameter information of all Pods within the same cluster is to the centroid of that cluster, and the higher the feature similarity among Pods within that cluster. When the change in the objective function value is less than a preset threshold for two consecutive iterations, or when the objective function value no longer decreases, it indicates that the cluster partitioning has stabilized, the centroid no longer changes significantly, and Pod affiliation no longer needs adjustment. At this point, iteration stops.

[0117] As an example, assume k=2, meaning there are 2 clustering results. Based on the parameter information of the N target Pods, two initial cluster centroids are randomly selected. For example, centroid 1 is CPU=70%, memory=60%, and centroid 2 is CPU=30%, memory=30%, corresponding to the high-load group and the low-load group, respectively.

[0118] Calculate the Euclidean distance between each target Pod and centroid 1 and centroid 2 respectively. Taking two target Pods, order-pod-01 and log-pod-01, as examples, the distance between order-pod-01 and centroid 1 is approximately 5, and the distance between order-pod-01 and centroid 2 is approximately 53. Therefore, order-pod-01 is classified as a high-load Pod. The distance between log-pod-01 and centroid 2 is approximately 4, and the distance between log-pod-01 and centroid 1 is approximately 50. Therefore, log-pod-01 is classified as a low-load Pod.

[0119] The centroids of the two clusters were recalculated. The new centroids of the high-load group were CPU=78.5% and memory=65%, and the new centroids of the low-load group were CPU=28% and memory=28%. The process was iterated until the objective function was minimized. Finally, it was determined that target Pods such as order-pod-01 belonged to the high-load group and target Pods such as log-pod-01 belonged to the low-load group, providing a classification basis for the subsequent weight calculation of label features.

[0120] By employing the technical means of this invention, clustering can group Pods with similar label characteristics into the same cluster. Clustering strengthens the feature differences between different Pods, providing a grouping basis for subsequent label allocation and avoiding misclassification due to feature mixing. When calculating label feature weights using the entropy weight method, weight priority can be determined based on the common features of Pods within the same cluster, ensuring that weight calculations better reflect the actual operational needs of Pods within the cluster. Furthermore, the grouping approach for label analysis and marking eliminates the need for individual feature analysis for each Pod, significantly simplifying the label management process.

[0121] Then step S15, which is to label the target Pod with the corresponding label based on the label features matched by the target Pod, includes steps S151 to S155:

[0122] S151. Based on the target Pods of the target Pod group, determine several key parameter indicators of the target Pod group;

[0123] S152. Calculate the weight value of each of the key parameter indicators using the entropy weight method;

[0124] S153. Sort the weight values ​​in descending order and select the top T key parameter indicators as target parameter indicators; where T≥1;

[0125] S154. Among the label features matched by each target Pod in the Pod group, obtain the label features corresponding to the target parameter index and use them as target label features;

[0126] S155. Based on the target tag features, label the target Pod with the corresponding tag.

[0127] In this embodiment of the invention, based on the above clustering results, all target Pods are divided into k target Pod groups. It can be seen that the target Pods in each target Pod group have the same or similar label features or parameter information. By analyzing the parameter information of the target Pods in each Pod group, labels are assigned to the target Pods in each Pod group.

[0128] The key parameter indicators are determined based on the parameter information of each target Pod in the target Pod group. For example, taking the three target Pods in the high load group, namely order-pod-01, order-pod-02, and order-pod-03, four key parameter indicators are selected, namely CPU utilization, memory utilization, request frequency, and health score.

[0129] To achieve dynamic tagging, real-time parameter information of Pods is monitored. Based on the tag features extracted in the previous step, the entropy weight method is used to calculate the weights of key parameter indicators. The T key parameter indicators with the highest weights are selected as target parameter indicators to select the most suitable tags and dynamically label them on the target Pods. Furthermore, to further improve the effectiveness of dynamic Pod tagging, the labeled tags are dynamically updated based on updates to the tag feature library.

[0130] The label matrix constructed in the above steps is then used to calculate the weights of each key parameter using the entropy weight method. The entropy weight method effectively reduces errors caused by subjective factors. Objective weights are determined based on the magnitude of parameter variability; the smaller the entropy, the greater the variability of the parameter, the lower the degree of information confusion, the greater its usability, and the greater its role in comprehensive evaluation, thus its weight is also greater.

[0131] Preferably, step S152, namely, calculating the weight value of each key parameter index using the entropy weight method, includes:

[0132] Each of the key parameter indicators is subjected to data standardization processing to obtain standardized key parameter indicators;

[0133] Calculate the information entropy of each of the key parameter indicators;

[0134] The weight value of each key parameter is calculated based on the information entropy of each key parameter.

[0135] Specifically, the data for each key parameter indicator is standardized. Assuming k key parameter indicators are given... ,in, Assuming the standardized values ​​of each key parameter indicator are... ,So for:

[0136]

[0137] Calculate the information entropy of each key parameter. According to the definition of information entropy in information theory, the information entropy of a set of data... The calculation formula is:

[0138]

[0139] in ,if Then define .

[0140] Determine the weights of each key parameter indicator. Based on the formula for calculating information entropy, calculate the information entropy of each key parameter indicator. The weights of each key parameter indicator are calculated using information entropy.

[0141] ;

[0142] After determining the weights corresponding to each key parameter indicator, the target parameter indicator can be determined based on the largest T weights. Then, based on the target parameter indicator, the label features corresponding to the target parameter indicator of each target Pod in the current Pod group can be determined as target label features. Then, based on the target label features, an appropriate label can be selected to mark the corresponding target Pod resource, thereby realizing dynamic labeling of Pods.

[0143] Taking three target pods in the high-load group, namely order-pod-01, order-pod-02, and order-pod-03, and four key parameters, namely CPU utilization, memory utilization, request frequency, and health score, as an example, the data is standardized as shown in Table 3:

[0144] Table 3

[0145]

[0146] In the table above, taking CPU utilization as an example: assuming min=75 and max=85, the standardized value of CPU utilization for order-pod-01 is (75-75) / (85-75)=0, and the standardized value of CPU utilization for order-pod-02 is (85-75) / 10=1.

[0147] Calculate the information entropy of four key parameters: E_CPU, E_Memory, E_Request Frequency, and E_Health. Based on these information entropies, calculate the weight values ​​for each of the four key parameters. Assuming that CPU utilization has the highest weight value, it is determined as the target key parameter.

[0148] When labeling, CPU utilization has the highest weight. Therefore, CPU utilization is the core dimension. Based on the actual CPU utilization value of each target Pod in the current high load group, the label feature corresponding to the target Pod is matched, which is the label value under the preset resource.usage label type: high resource utilization, medium resource utilization, or low resource utilization. For example, order-pod-02 has a CPU utilization of 85% and a memory utilization of 80%, which meets the label resource.usage=high. Therefore, this label is assigned to order-pod-02 for labeling.

[0149] By employing the technical means of this invention, each Pod is grouped and its corresponding key parameter indicators are determined. The entropy weight method is used to calculate the weight value of each key parameter indicator, thereby determining the most core key parameter indicator as the core dimension to match the label that each Pod matches. This ensures that the label marked for the Pod is always related to the real-time and core parameter information of the Pod, thereby improving the accuracy of Pod labeling.

[0150] See Figure 2 This is a schematic diagram of a Pod tagging device provided in an embodiment of the present invention. The present invention also provides a Pod tagging device 10, comprising:

[0151] The target Pod determination module 11 is used to determine the Pod to be labeled in the created Pod resource group, denoted as the target Pod;

[0152] The tag data acquisition module 12 is used to acquire a preset tag database; wherein, the tag database contains several tag types and several tags under each tag type;

[0153] The parameter information monitoring module 13 is used to monitor the real-time parameter information of the target Pod.

[0154] The tag feature generation module 14 is used to match the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod.

[0155] The tag marking module 15 is used to mark the target Pod with a corresponding tag based on the tag features matched by the target Pod.

[0156] In a preferred embodiment, the label feature generation module 14 is specifically used for:

[0157] Based on the real-time parameter information of the target Pod, a Pod-tag matrix is ​​constructed; wherein, the matrix elements of the Pod-tag matrix are 1 or 0; 1 represents that the target Pod has the characteristics of a tag, and 0 represents that the target Pod does not have the characteristics of a tag;

[0158] The tag features matched by the target Pod are obtained based on the matrix elements that are 1 in the Pod-tag matrix.

[0159] In a preferred embodiment, the device 10 further includes a clustering processing module, which is used to perform clustering processing on all the target Pods using the K-Means clustering method to divide them into several target Pod groups; wherein each target Pod group includes at least one target Pod.

[0160] The label marking module 15 is specifically used for:

[0161] Based on the target Pods of the target Pod group, determine several key parameter indicators for the target Pod group;

[0162] The weight value of each key parameter index is calculated using the entropy weight method;

[0163] The weight values ​​are sorted in descending order, and the top T key parameter indicators are selected as target parameter indicators; where T≥1.

[0164] In each of the target Pods in the Pod group, the label features corresponding to the target parameter index are obtained and used as the target label features;

[0165] Based on the target label characteristics, the target Pod is labeled with the corresponding label.

[0166] By employing the technical means of this invention, dynamic tag management of target Pods without manual intervention is achieved, effectively avoiding errors in manual tagging and improving the reliability of Pod tagging. By configuring fine-grained tags, it can effectively meet the customized needs of different business scenarios and is more adaptable to specific application scenarios. Furthermore, the tag characteristics of a Pod are determined and dynamically updated based on the Pod's real-time parameter information, ensuring that the tags assigned to Pods match the Pod's status in real time, improving the effectiveness and accuracy of Pod tagging.

[0167] It should be noted that the Pod tagging device provided in this embodiment of the invention is used to execute all the process steps of the Pod tagging method in the above embodiment. The working principle and beneficial effects of the two are one-to-one, so they will not be described again.

[0168] See Figure 3 This is a schematic diagram of the structure of a Pod tagging device provided in an embodiment of the present invention. The present invention also provides a Pod tagging device 20, including a processor 21, a memory 22, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the Pod tagging method as described in any of the above embodiments.

[0169] This invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a Pod tagging method as described in any of the above embodiments.

[0170] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the Pod tagging method as described in any of the above embodiments.

[0171] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0172] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for tagging Pods, characterized in that, include: In the created Pod resources, identify the Pod to be tagged and denote it as the target Pod; Obtain a preset tag database; wherein the tag database contains several tag types and several tags under each tag type; Real-time monitoring of the target Pod's parameter information; The real-time parameter information of the target Pod is matched with the tags in the tag database to determine at least one tag feature that matches the target Pod; Based on the tag features matched by the target Pod, assign a corresponding tag to the target Pod; After matching the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod, the method further includes: The K-Means clustering method is used to cluster all the target Pods, resulting in several target Pod groups; wherein each target Pod group includes at least one target Pod. Then, based on the tag features matched by the target Pod, a corresponding tag is assigned to the target Pod, including: Based on the target Pods of the target Pod group, determine several key parameter indicators for the target Pod group; The weight value of each key parameter index is calculated using the entropy weight method; The weight values ​​are sorted in descending order, and the top T key parameter indicators are selected as target parameter indicators; where T≥1. In each of the target Pods in the Pod group, the label features corresponding to the target parameter index are obtained and used as the target label features; Based on the target label characteristics, the target Pod is labeled with the corresponding label.

2. The Pod tagging method as described in claim 1, characterized in that, The step of matching the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod includes: Based on the real-time parameter information of the target Pod, a Pod-tag matrix is ​​constructed; wherein, the matrix elements of the Pod-tag matrix are 1 or 0; 1 represents that the target Pod has the characteristics of a tag, and 0 represents that the target Pod does not have the characteristics of a tag; The tag features matched by the target Pod are obtained based on the matrix elements that are 1 in the Pod-tag matrix.

3. The Pod tagging method as described in claim 1, characterized in that, The K-Means clustering method is used to cluster all the target Pods, resulting in several Pod groups, including: Determine k initial cluster centroids; wherein the cluster centroids are generated based on the parameter information of the target Pod; Calculate the Euclidean distance between each target Pod and the cluster centroid, and determine the cluster to which each target Pod belongs based on the Euclidean distance, to obtain k clustering results; Update the k cluster centroids based on the real-time parameter information of the target Pod in the k clustering results; Recalculate the Euclidean distance between each target Pod and the cluster centroid, and determine the cluster to which each target Pod belongs based on the Euclidean distance, until a preset iteration termination condition is met, and obtain the final k clustering results, which are used as k Pod groups.

4. The Pod tagging method as described in claim 3, characterized in that, The iteration termination condition is: minimizing the objective function; wherein, the objective function is the sum of the Euclidean distances between all target Pods and the cluster centroids in all clustering results.

5. The Pod tagging method as described in claim 1, characterized in that, The calculation of the weight value of each key parameter index using the entropy weight method includes: Each of the key parameter indicators is subjected to data standardization processing to obtain standardized key parameter indicators; Calculate the information entropy of each of the key parameter indicators; The weight value of each key parameter is calculated based on the information entropy of each key parameter.

6. A tagging device for a Pod, characterized in that, include: The target Pod determination module is used to identify the Pods to be tagged in the created Pod resources, denoted as the target Pods; The tag data acquisition module is used to acquire a preset tag database; wherein, the tag database contains several tag types and several tags under each tag type; The parameter information monitoring module is used to monitor the real-time parameter information of the target Pod. The tag feature generation module is used to match the real-time parameter information of the target Pod with the tags in the tag database to determine at least one tag feature that matches the target Pod. The tagging module is used to tag the target Pod with a corresponding tag based on the tag features matched by the target Pod; The device further includes a clustering processing module, used to cluster all the target Pods using the K-Means clustering method to divide them into several target Pod groups; wherein each target Pod group includes at least one target Pod; The label marking module is specifically used for: Based on the target Pods of the target Pod group, determine several key parameter indicators for the target Pod group; The weight value of each key parameter index is calculated using the entropy weight method; The weight values ​​are sorted in descending order, and the top T key parameter indicators are selected as target parameter indicators; where T≥1. In each of the target Pods in the Pod group, the label features corresponding to the target parameter index are obtained and used as the target label features; Based on the target label characteristics, the target Pod is labeled with the corresponding label.

7. A tagging device for a Pod, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the Pod tagging method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium resides to perform the Pod tagging method as described in any one of claims 1 to 5.

9. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions that, when executed by a processor, implement the Pod tagging method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Prometheus-based dynamic label setting method and system for monitoring system

    CN119248421A