Pod label marking method, device, equipment, medium and product
By monitoring Pod parameters in real time and dynamically marking Pod labels using K-Means clustering and entropy weighting, the reliability and flexibility issues of label management in Kubernetes are resolved, achieving highly accurate and adaptable label management.
Patent Information
- Application Number
- CN202511262434.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-05
AI Technical Summary
Existing Pod label management technologies have the risk of human error and poor node scheduling flexibility, especially when statically labeling labels through YAML files in Kubernetes, resulting in insufficient reliability and scheduling flexibility.
By monitoring the real-time parameter information of Pods in real time, using the preset label database and dynamic matching algorithm, and adopting K-Means clustering and entropy weight method, the Pod labels are dynamically marked to achieve fine-grained label management without manual intervention.
The accuracy and reliability of Pod label marking are improved to meet the customization requirements of different business scenarios, ensure that labels match Pod status in real time, and adapt to specific application scenarios.
Smart Images

Figure CN120804761A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and in particular to a label marking method, device, equipment, medium and product of a Pod. BACKGROUND
[0002] Under the background of rapid growth of computing power demand, cloud computing has gradually become the mainstream way of computing power supply. Container technology is an important cornerstone in the field of cloud computing and has become the core component of modern cloud computing program development and deployment. At present, the trend of cloud native, more and more enterprises upload their services to the cloud and control them through the way of Kubernetes (k8s). Kubernetes is an open source container cluster management system, mainly used for automatic management of deployment, expansion, scheduling, operation and maintenance of containerized applications, supporting multi-node cluster cooperation. Its core functions include container scheduling, resource monitoring and label management, etc. For example, according to resource requirements (such as CPU and memory), the Pod is allocated to the appropriate node; real-time resource utilization data of Pod and node are provided; labels (Label) are added to Pod, node and other resources as the basis for scheduling and screening. Among them, Pod is the smallest deployment unit in Kubernetes cluster, which can contain one or more associated containers, sharing network, storage and other resources. Containers in Pod are scheduled together to the same node, sharing network namespace and storage resources.
[0003] The existing label management technology has certain defects, for example, there is a scheme of manually marking labels to resources in k8s through yaml file, which may cause human error and result in poor reliability. There is also a scheme of marking the same label to all nodes under the same node group, which may result in poor operability of node labels under the node group and poor flexibility of node scheduling. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a label marking method, device, equipment, medium and product of a Pod, which can dynamically manage labels of the Pod according to parameter information of the Pod, and improve the accuracy of label marking of the Pod.
[0005] To achieve the above purpose, the embodiments of the present application provide a label marking method of a Pod, comprising: determining a Pod to be marked in the created Pod resource, denoted as a target Pod; obtaining 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 monitoring of real-time parameter information of the target Pod; matching the real-time parameter information of the target Pod with the labels in the label database, determining at least one label feature matched by the target Pod; According to the label feature matched by the target Pod, the corresponding label is marked for the target Pod.
[0006] As an improvement of the above scheme, the matching of the real-time parameter information of the target Pod with the labels in the label database, to determine at least one label feature matched by the target Pod, comprises: According to the real-time parameter information of the target Pod, a Pod-label matrix is constructed; wherein the matrix elements of the Pod-label matrix are 1 or 0; 1 represents that the target Pod has the characteristics of the label, and 0 represents that the target Pod does not have the characteristics of the label; According to the matrix elements of 1 in the Pod-label matrix, the label feature matched by the target Pod is obtained.
[0007] As an improvement of the above scheme, after the matching of the real-time parameter information of the target Pod with the labels in the label database, to determine at least one label feature matched by the target Pod, the method further comprises: Using K-Means clustering method to cluster all the target Pods, and dividing to obtain several target Pod groups; wherein each target Pod group includes at least one target Pod; According to the label feature matched by the target Pod, the corresponding label is marked for the target Pod. According to the target Pods in the target Pod group, several key parameter indicators of the target Pod group are determined; Using entropy weight method to calculate the weight value of each key parameter indicator; According to the weight value from large to small, the first T key parameter indicators are selected as target parameter indicators; wherein T≥1; In the label feature matched by each target Pod in the Pod group, the label feature corresponding to the target parameter indicator is obtained as a target label feature; According to the target label feature, the corresponding label is marked for the target Pod.
[0008] As an improvement of the above scheme, the K-Means clustering method is used to cluster all the target Pods, and several Pod groups are divided, comprising: Determine k initial cluster centroids; wherein the cluster centroids are generated according to the parameter information of the target Pod; calculate the Euclidean distance between each target Pod and the cluster centroid point, and determine the cluster to which each target Pod belongs according to the Euclidean distance, to obtain k clustering results; According to the real-time parameter information of the target Pod in the k clustering results, update the k cluster centroid points; Recalculate the Euclidean distance between each target Pod and the cluster centroid point, and determine the cluster to which each target Pod belongs according to the Euclidean distance, until the preset iteration termination condition is met, to obtain the final k clustering results as the k Pod groups.
[0009] As an improvement of the above scheme, the iteration termination condition is that the objective function is minimized; wherein the objective function is the sum of the Euclidean distances between all target Pods and cluster centroid points in all clustering results.
[0010] As an improvement of the above scheme, the weight value of each key parameter index is calculated by using the entropy weight method, including: standardize the data of each key parameter index to obtain a standardized key parameter index; Calculate the information entropy of each key parameter index; According to the information entropy of each key parameter index, the weight value of each key parameter index is calculated.
[0011] The embodiment of the application provides a Pod label marking device, comprising: A target Pod determination module is configured to determine a Pod to be marked in a created Pod resource, denoted as a target Pod. A label data acquisition module is configured to acquire a preset label database; wherein the label database comprises a plurality of label types and a plurality of labels under each label type. A parameter information monitoring module is configured to monitor real-time parameter information of the target Pod in real time. A label feature generation module is configured to match the real-time parameter information of the target Pod with labels of the label database, and determine at least one label feature matched by the target Pod. A label marking module is configured to mark a corresponding label for the target Pod according to the label feature matched by the target Pod.
[0012] The embodiment of the application provides a Pod label marking device, comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to realize the Pod label marking method according to any one of the above.
[0013] The embodiment of the present application provides a computer readable storage medium, the computer readable storage medium comprises a stored computer program, wherein the computer readable storage medium is controlled by the computer program to execute the label marking method of the Pod when the computer program is running.
[0014] The embodiment of the present application provides a computer program product, the computer program product comprises a computer program or computer instructions, the computer program or the computer instructions are executed by the processor to realize the label marking method of the Pod.
[0015] Compared with the prior art, the label marking method, device, equipment, medium and product of the Pod disclosed by the present application realize the dynamic label management of the target Pod without manual intervention, effectively avoid the error of manual marking, and improve the reliability of the Pod label marking. By configuring the fine-grained label, the custom demand of different business scenarios can be effectively met, and the specific application scenarios are more adapted. Moreover, the label feature of the Pod is determined and dynamically updated according to the real-time parameter information of the Pod, so that the label marked for the Pod is matched with the real-time state of the Pod, and the effectiveness and accuracy of the Pod label marking are improved. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 is a flow diagram of the label marking method of the Pod provided by the embodiment of the present application; Figure 2 is a structural diagram of the label marking device of the Pod provided by the embodiment of the present application; Figure 3 is a structural diagram of the label marking device of the Pod provided by the embodiment of the present application. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.
[0018] In the description of the present application, it needs to be understood that the terms "center", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.
[0019] The terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, unless otherwise stated, the meaning of "a plurality of" is two or more.
[0020] In the description of the present application, it needs to be explained that, unless otherwise explicitly specified and limited, the terms "mounting", "connecting", "connecting" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0021] Referring to Figure 1 It is a flowchart of a label marking method of a Pod provided by an embodiment of the present application. The embodiment of the present application provides a label marking method of a Pod, which comprises the following steps S11 to S15: S11, determining a Pod to be marked in a created Pod resource, denoted as a target Pod; S12, acquiring a preset label database; wherein the label database comprises a plurality of label types and a plurality of labels under each label type; S13, real-time monitoring of real-time parameter information of the target Pod; S14, matching the real-time parameter information of the target Pod with the labels of the label database to determine at least one label feature matched by the target Pod; S15, marking a corresponding label for the target Pod according to the label feature matched by the target Pod.
[0022] The embodiment of the present application realizes dynamic marking of the labels of the Pods by extracting the basic parameter information of the Pods according to the self-defined labels of the resources in the Kubernetes.
[0023] Specifically, Kubernetes defines a Pod configuration through a YAML file or a JSON file, creates a Pod resource, selects a Pod that needs to be labeled as a target Pod after the creation of the Pod resource is completed. The Pod that needs to be labeled can be selected through preset filtering rules. Alternatively, the filtering rules are set according to the namespace of the Pod.
[0024] As an example, in an e-commerce platform scenario, a developer writes a YAML configuration file of an order processing Pod, submits the YAML file to a K8s cluster of a Serverless (serverless) platform, and the K8s cluster completes the creation of order-pod-01. The platform has built-in filtering rules: Pods with namespace=e-commerce and container.name=order-service are automatically included in the list of Pods that need to be labeled. order-pod-01~order-pod-10 are finally selected as target Pods through K8s API query of Pods that meet the conditions.
[0025] A label database is constructed in advance to store labels that have been created or labels that are currently added by the user. In the label database, labels are classified and stored according to preset label types.
[0026] Alternatively, the label types include a request type (request.type), resource utilization (resource.usage), a life cycle phase (status.phase) of the Pod, and a health check state (health.check) of the Pod. The request type (request.type) can be used to adjust the creation strategy of the Pod according to traffic load, the resource utilization (resource.usage) can be used to adjust the scheduling strategy of the Pod according to the usage of resources such as CPU, memory, or network, the life cycle phase (status.phase) can be used to identify resource utilization, and the health check state (health.check) can be used to optimize performance and cost, facilitating dynamic management and troubleshooting.
[0027] Each of the label types is divided into several optional values, i.e., label values, which can be set according to specific application scenarios. Taking an e-commerce platform scenario as an example, the labels under the request type include order processing, log collection; the labels under the resource utilization rate include high utilization rate, medium utilization rate, and low utilization rate, which are determined according to the actual usage of resources such as CPU, memory, or network, for example, CPU > 80% or memory > 80% is high utilization rate, CPU is in 40%-80% or memory is in 40%-80% is medium utilization rate, CPU < 40% or memory < 40% is low utilization rate. The labels under the life cycle stage include waiting, running, and termination. The labels under the health check state include healthy, unhealthy, and unknown, which are determined by whether the probe state of the Pod passes.
[0028] An example of the label database is shown in Table 1: Table 1
[0029] The above fine-grained labels are stored in the label database to achieve the function of unified management of labels.
[0030] Further, by accessing the K8s Metrics API and Pod API, the running state of each of the target Pods is monitored in real time, and real-time parameter information of the target Pods is extracted. As an example, the real-time parameter information includes CPU utilization rate, memory utilization rate, request type, request frequency, life cycle stage, health score, etc.
[0031] According to the labels in the database and the real-time parameter information of the target Pods, it is determined whether the target Pods meet the corresponding label characteristics, the label characteristics of each of the target Pods are obtained, and a label characteristic library of each target Pod is formed. Understandably, the label characteristic library will be dynamically updated as the real-time parameter information of the target Pods changes.
[0032] According to the label characteristics in the label characteristic library of each of the target Pods, analysis is performed, so that appropriate labels are selected from the database and assigned to the target Pods. The selected labels will also be dynamically updated as the label characteristic library is updated, thereby achieving the effect of dynamically labeling the labels of the Pods.
[0033] By adopting the technical means of the embodiment of the present application, the dynamic label management of the target Pod without manual intervention is realized, manual marking errors are effectively avoided, and the reliability of the Pod label marking is improved. By configuring fine-grained labels, the customization requirements of different business scenarios can be effectively met, and the specific application scenarios are more adapted. Moreover, the label features of the Pod are determined and dynamically updated according to the real-time parameter information of the Pod, so as to ensure that the labels marked for the Pod are real-time matched with the Pod state, and the effectiveness and accuracy of the Pod label marking are improved.
[0034] As a preferred embodiment, the embodiment of the present application is further implemented on the basis of the above-mentioned embodiment, and step S14, that is, the matching of the real-time parameter information of the target Pod with the labels of the label database to determine at least one label feature matched by the target Pod, includes steps S141 and S142: S141, constructing a Pod-label matrix according to the real-time parameter information of the target Pod; wherein the matrix elements of the Pod-label matrix are 1 or 0; 1 represents that the target Pod has the feature of the label, and 0 represents that the target Pod does not have the feature of the label; S142, obtaining the label features matched by the target Pod according to the matrix elements of 1 in the Pod-label matrix.
[0035] In the embodiment of the present application, in order to extract the obvious features of the Pod label, the label can be first subjected to multi-label binary processing to vectorize the label data. Assuming that there are N target Pods and M labels, a Pod-label matrix is constructed, and the dimension of the matrix is N*M.
[0036] The elements in the matrix are defined as follows: ; As an example, assuming that the number of target Pods to be processed currently is N=3, which are order-pod-01, order-pod-02 and log-pod-01. The number of labels is M=5, which are 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 phase is running), and health.check=healthy (health check state is healthy).
[0037] The real-time parameter information of each target Pod is obtained by using the K8s API. The real-time parameter information of order-pod-01 is as follows: CPU utilization: 75%; Memory utilization: 60%; Request type: order-processing; Life cycle stage: running; Health score: 9 (score range 0-9).
[0038] The real-time parameter information of order-pod-02 is as follows: CPU utilization: 82%; Memory utilization: 80%; Request type: order-processing; Life cycle stage: running; Health score: 8.
[0039] The real-time parameter information of log-pod-01 is as follows: CPU utilization: 28%; Memory utilization: 30%; Request type: log-collecting; Life cycle stage: running; Health score: 9.
[0040] According to the real-time parameter information of the Pods and the preset labels, a Pod-label matrix is constructed as shown in Table 2: Table 2
[0041] By using the technical means of the embodiment of the application, in order to realize real-time monitoring of the state and performance of the Pods in Kubernetes, the basic parameter information of the required Pods can be obtained by accessing the Kubernetes API through the Metrics API of Kubernetes, and the extracted data is filtered, cleaned and converted as necessary, and finally the extracted feature information is stored in the label feature library for further analysis.
[0042] As a preferred embodiment, after step S14, that is, after matching the real-time parameter information of the target Pod with the labels of the label database and determining at least one label feature matched by the target Pod, the method further comprises step S16: S14', using a K-Means clustering method to perform clustering processing on all the target Pods, and dividing to obtain a plurality of target Pod groups; wherein each of the target Pod groups includes at least one target Pod.
[0043] In the embodiments of the present application, in order to further extract the characteristics of the label parameters, the Pod-label matrix can be clustered, a K-Means clustering method is adopted, k clustering results are divided, and the clustering of each target Pod is determined.
[0044] Preferably, the K-Means clustering method is used to cluster all the target Pods, and a plurality of Pod groups are divided, including S141' to S144': S141', k initial clustering centroids are determined; wherein the clustering centroids are generated according to the parameter information of the target Pods; S142', the Euclidean distance between each target Pod and the clustering centroid is calculated, and according to the Euclidean distance, the cluster to which each target Pod belongs is determined, and k clustering results are obtained; S143', the k clustering centroids are updated according to the real-time parameter information of the target Pods in the k clustering results; S144', the Euclidean distance between each target Pod and the clustering centroid is recalculated, and according to the Euclidean distance, the cluster to which each target Pod belongs is determined, until a preset iteration termination condition is met, and the final k clustering results are obtained as k Pod groups.
[0045] Specifically, assuming that N target Pods are Each Pod data is an n-dimensional vector. k clustering centroids are randomly selected as The Euclidean distance between each target Pod and the clustering centroid is calculated through the real-time parameter information of each target Pod: ; According to the Euclidean distance, the cluster to which each target Pod belongs is determined, and k clustering results are obtained.
[0046] For each clustering result, the clustering centroid of the cluster is recalculated:
[0047] It is judged whether the current satisfies the preset iteration termination condition. When the iteration termination condition is not satisfied, the Euclidean distance between each target Pod and the updated clustering centroid is recalculated, and according to the Euclidean distance, the cluster to which each target Pod belongs is redetermined, and the updated k clustering results are obtained. When the iteration termination condition is satisfied, the iteration is stopped, and the final k clustering results are output.
[0048] As a preferred embodiment, the iteration termination condition is that the objective function is minimized; wherein the objective function is the sum of the Euclidean distances between all target Pods and cluster centroid points in all clustering results.
[0049] Specifically, the expression of the objective function is:
[0050] wherein, is the i-th target Pod, i is the j-th cluster centroid point, is a preset weight coefficient. k is a preset weight coefficient.
[0051] The smaller the objective function value is, the closer the distance between the parameter information of all Pods in the same cluster and the centroid point of the cluster is, and the higher the feature similarity between the Pods in the cluster is. When the change amount of the objective function value of two consecutive iterations is less than a preset threshold, or the objective function value no longer decreases, it is indicated that the cluster division is stable, the centroid point no longer changes significantly, and the Pod attribution no longer adjusts, and at this time, the iteration is stopped. As an example, it is assumed that k=2, that is, two clustering results are divided. According to the parameter information of N target Pods, two initial cluster centroid points are randomly selected, for example, the centroid point 1 is CPU=70%, memory=60%, and the centroid point 2 is CPU=30%, memory=30%, which correspond to two clustering results of a high-load group and a low-load group, respectively.
[0052] The Euclidean distances between each target Pod and the centroid point 1 and the centroid point 2 are calculated. Taking two target Pods order-pod-01 and log-pod-01 as examples, it is calculated that the distance between order-pod-01 and the centroid point 1 is approximately 5, and the distance between order-pod-01 and the centroid point 2 is approximately 53, so order-pod-01 is assigned to the high-load group; the distance between log-pod-01 and the centroid point 2 is approximately 4, and the distance between log-pod-01 and the centroid point 1 is approximately 50, so log-pod-01 is assigned to the low-load group.
[0053] The two cluster centroid points are recalculated. The new centroid point of the high-load group is CPU=78.5%, memory=65%, and the new centroid point of the low-load group is CPU=28%, memory=28%. The iteration is performed until the objective function is minimized, and finally it is determined that the target Pods such as order-pod-01 belong to the high-load group, and the target Pods such as log-pod-01 belong to the low-load group, thereby providing classification basis for weight calculation of subsequent label features.
[0054] By adopting the technical means of the embodiment of the application, the pods with similar label features can be classified into the same cluster through clustering, the feature difference between different pods is strengthened through cluster division, and the grouping basis is provided for subsequent label allocation, so that label misjudgment caused by mixed features is avoided. When the label feature weight is calculated by the subsequent entropy weight method, the weight priority can be determined based on the common features of the pods in the same cluster, so that the weight calculation is more in line with the actual operation requirements of the pods in the cluster. Moreover, the label analysis and marking are performed in the grouping form, and the features of each pod do not need to be analyzed separately, so that the label management process is greatly simplified.
[0055] Then, step S15, that is, according to the label features matched by the target pods, the corresponding labels are marked for the target pods, including steps S151 to S155: S151, according to the target pods in the target pod group, determining several key parameter indexes of the target pod group; S152, calculating the weight value of each key parameter index by using the entropy weight method; S153, sorting the weight values in descending order, and selecting the first T key parameter indexes as target parameter indexes; wherein, T≥1; S154, in the label features matched by each target pod in the pod group, obtaining the label features corresponding to the target parameter indexes as target label features; S155, according to the target label features, marking the corresponding labels for the target pods.
[0056] In the embodiment of the application, according to the clustering result, all target pods are divided into k target pod groups, and it can be seen that the target pods in each target pod group have the same or similar label features or parameter information. By respectively analyzing the parameter information of the target pods in each pod group, the target pods in each pod group are labeled.
[0057] The key parameter indexes are determined according to the parameter information of each target pod in the target pod group. For example, taking three target pods order-pod-01, order-pod-02 and order-pod-03 in the high-load group as examples, four key parameter indexes are selected, which are CPU utilization, memory utilization, request frequency and health score.
[0058] To enable dynamic labeling, we monitor pods' real-time parameter information and, based on the label features extracted in the previous step, use the entropy weight method to weight key parameter indicators. We then select the T key parameter indicators with the highest weights as target parameters, using them to select the most appropriate label and dynamically apply it to the target pods. To further improve the effectiveness of dynamic pod labeling, we dynamically update the labels based on updates to the label feature library.
[0059] The label matrix constructed in the above steps is used to calculate the weights of each key parameter indicator using the entropy weight method. Using the entropy weight method can effectively reduce the errors caused by subjective factors and determine the objective weights based on the variability of the parameter indicators. The smaller the entropy, the greater the variability of the parameter indicators, the lower the degree of information confusion, the greater the use value, the greater the role played in the comprehensive evaluation, and the greater the weight.
[0060] Preferably, step S152, i.e., calculating the weight value of each key parameter indicator using the entropy weight method, includes: Performing data standardization processing on each of the key parameter indicators to obtain standardized key parameter indicators; Calculating the information entropy of each of the key parameter indicators; The weight value of each key parameter indicator is calculated based on the information entropy of each key parameter indicator.
[0061] Specifically, the data of each key parameter index are standardized. Assuming that k key parameter indexes are given ,in, , assuming that the standardized values of the key parameter indicators are ,So for:
[0062] Calculate the information entropy of each key parameter indicator. According to the definition of information entropy in information theory, the information entropy of a set of data The calculation formula is:
[0063] in ,if , then define .
[0064] Determine the weight of each key parameter indicator. According to the calculation formula of information entropy, the information entropy of each key parameter indicator is calculated as The weights of key parameter indicators are calculated by information entropy: ; After the weights of the key parameter indicators are determined, the target parameter indicator can be determined according to the maximum T weights, and then the target parameter indicator corresponding to each target Pod in the current Pod group is determined as the target label feature according to the target parameter indicator, and then a suitable label is selected to mark the corresponding target Pod resource according to the target label feature, so as to realize dynamic marking of the Pod label.
[0065] Taking 3 target Pods, order-pod-01, order-pod-02 and order-pod-03, in a high-load group and 4 key parameter indicators, CPU utilization, memory utilization, request frequency and health score, as examples, data standardization is performed, as shown in Table 3: Table 3
[0066] Taking CPU utilization as an example in the above table: assuming that min=75 and max=85, the standardized value of the CPU utilization of order-pod-01 is (75-75) / (85-75)=0, and the standardized value of the CPU utilization of order-pod-02 is (85-75) / 10=1.
[0067] The information entropy of the 4 key parameter indicators is calculated respectively to obtain information entropy E_CPU, E_memory, E_request frequency and E_health. According to the above information entropy, the weight values of the 4 key parameter indicators are calculated respectively. Assuming that the weight value of the CPU utilization is the maximum, the CPU utilization is determined as the target key parameter.
[0068] When the label is marked, the weight of the CPU utilization is the highest, so the CPU utilization is preferentially taken as the core dimension, and the label feature corresponding to each target Pod in the current high-load group is matched according to the actual CPU utilization value of the target Pod, that is, the label value under the preset resource.usage label type: high resource utilization, medium resource utilization or low resource utilization. For example, the CPU utilization of order-pod-02 is 85%, the memory utilization is 80%, and the label of resource.usage=high is met, so the label is assigned to order-pod-02 for marking.
[0069] By adopting the technical means of the embodiment of the application, the corresponding key parameter indicators of each Pod group are determined, the weight values of the key parameter indicators are calculated by using the entropy weight method, and then the most core key parameter indicator is determined as the core dimension to match the label met by each Pod, so that the label marked for the Pod is always related to the real-time and core parameter information of the Pod, and the accuracy of the label marking of the Pod is improved.
[0070] Referring to Figure 2 , is a structural schematic diagram of a label marking device for a Pod provided in an embodiment of the present application. The embodiment of the present application further provides a label marking device 10 for a Pod, comprising: a target Pod determination module 11 configured to determine a Pod to be marked with a label in a created Pod resource group, denoted as a target Pod; a label data acquisition module 12 configured to acquire a preset label database; wherein the label database comprises a plurality of label types and a plurality of labels under each label type; a parameter information monitoring module 13 configured to monitor real-time parameter information of the target Pod in real time; a label feature generation module 14 configured to match the real-time parameter information of the target Pod with labels of the label database, and determine at least one label feature matched by the target Pod; a label marking module 15 configured to mark the target Pod with a corresponding label according to the label feature matched by the target Pod.
[0071] As a preferred implementation, the label feature generation module 14 is specifically configured to: construct a Pod-label matrix according to the real-time parameter information of the target Pod; wherein a matrix element of the Pod-label matrix is 1 or 0; 1 represents that the target Pod has a label feature, and 0 represents that the target Pod does not have a label feature; obtain the label feature matched by the target Pod according to the matrix element of 1 in the Pod-label matrix.
[0072] As a preferred implementation, the device 10 further comprises a clustering processing module configured to perform clustering processing on all the target Pods by using a K-Means clustering method, and divide to obtain a plurality of target Pod groups; wherein each target Pod group comprises at least one target Pod.
[0073] The label marking module 15 is specifically configured to: determine a plurality of key parameter indicators of the target Pod group according to the target Pods of the target Pod group; calculate a weight value of each key parameter indicator by using an entropy weight method; sort the weight values in descending order, and select the first T key parameter indicators as target parameter indicators; wherein T≥1; obtain a label feature corresponding to the target parameter indicators from the label features matched by each target Pod of the Pod group as a target label feature; According to the target label feature, a corresponding label is marked for the target Pod.
[0074] By adopting the technical means of the embodiments of the present application, the dynamic label management of the target Pod without manual intervention is realized, the manual marking error is effectively avoided, and the reliability of the Pod label marking is improved. By configuring the fine-grained label, the customized needs of different business scenarios can be effectively met, and the specific application scenarios are more adapted. Moreover, the label feature of the Pod is determined and dynamically updated according to the real-time parameter information of the Pod, so that the label marked for the Pod is matched with the Pod state in real time, and the effectiveness and accuracy of the Pod label marking are improved.
[0075] It should be noted that the Pod label marking device provided by the embodiments of the present application is used to execute all process steps of the Pod label marking method of the above-mentioned embodiments, and the working principles and beneficial effects of the two are one-to-one correspondence, so they will not be repeated.
[0076] Referring to Figure 3 is a structural schematic diagram of a Pod label marking device provided by the embodiments of the present application, the embodiments of the present application further provide a Pod label marking device 20, which comprises a processor 21, a memory 22, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the Pod label marking method as described in any one of the above-mentioned embodiments when executing the computer program.
[0077] The embodiments of the present application further provide a computer readable storage medium, which comprises a stored computer program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to execute the Pod label marking method as described in any one of the above-mentioned embodiments when the computer program runs.
[0078] The embodiments of the present application further provide a computer program product, which comprises a computer program or computer instructions, and the computer program or the computer instructions implement the Pod label marking method as described in any one of the above-mentioned embodiments when executed by a processor.
[0079] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the program can be stored in a computer readable storage medium, and when the program is executed, the processes of the above-mentioned embodiments of the methods can be included. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM) or a random access memory (RAM), etc.
[0080] The above is the preferred embodiment of the present application, it should be pointed out that, for those skilled in the art, without departing from the principles of the present application, can also make a number of improvements and refinements, these improvements and refinements are also considered to be within the scope of the present application.
Claims
1. A Pod labeling method, characterized in that: include: In the created Pod resources, identify the Pod to be labeled and record it as the target Pod; Obtaining a preset tag database; wherein the tag database includes a plurality of tag types and a plurality of tags under each of the tag types; Real-time monitoring of the target Pod's real-time parameter information; Matching the real-time parameter information of the target Pod with the labels in the label database to determine at least one label feature that matches the target Pod; According to the label features matched by the target Pod, the target Pod is marked with a corresponding label.
2. The Pod labeling method according to claim 1, wherein: Matching the real-time parameter information of the target Pod with the labels in the label database to determine at least one label feature matched by the target Pod includes: Construct a Pod-label matrix based on the real-time parameter information of the target Pod. The matrix elements of the Pod-label matrix are either 1 or 0. 1 indicates that the target Pod has the label feature, and 0 indicates that the target Pod does not have the label feature. According to the matrix elements that are 1 in the Pod-label matrix, the label features matched by the target Pod are obtained.
3. The Pod labeling method according to claim 1, wherein: After matching the real-time parameter information of the target Pod with the labels in the label database and determining at least one label feature matched by the target Pod, the method further includes: Clustering all the target Pods using the K-Means clustering method to obtain several target Pod groups; each target Pod group includes at least one target Pod; Based on the label features matched by the target Pod, the target Pod is marked with corresponding labels, including: Determine several key parameter indicators of the target Pod group according to the target Pod of the target Pod group; The entropy weight method is used to calculate the weight value of each key parameter indicator; Sort the weight values in descending order, and select the first T key parameter indicators as target parameter indicators; wherein T ≥ 1; From the label features matched by each target Pod in the Pod group, obtain the label feature corresponding to the target parameter indicator as the target label feature; According to the target label feature, the target Pod is marked with a corresponding label.
4. The Pod labeling method according to claim 3, wherein: The K-Means clustering method is used to cluster all the target Pods to obtain several Pod groups, including: Determine k initial cluster centroids; wherein the cluster centroids are generated based on 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 the preset iteration termination condition is met, and obtain the final k clustering results as k Pod groups.
5. The Pod labeling method according to claim 4, wherein: The iteration termination condition is: minimizing the objective function; wherein the objective function is the sum of the Euclidean distances between all target Pods in all clustering results and the cluster centroid.
6. The Pod labeling method according to claim 3, wherein: The entropy weight method is used to calculate the weight value of each key parameter indicator, including: Performing data standardization processing on each of the key parameter indicators to obtain standardized key parameter indicators; Calculating the information entropy of each of the key parameter indicators; The weight value of each key parameter indicator is calculated based on the information entropy of each key parameter indicator.
7. A label marking device for a Pod, characterized in that: include: The target Pod determination module is used to determine the Pod to be labeled in the created Pod resources and record it as the target Pod; A tag data acquisition module is used to acquire a preset tag database; wherein the tag database includes a plurality of tag types and a plurality of tags under each of the tag types; A parameter information monitoring module is used to monitor the real-time parameter information of the target Pod in real time; A label feature generation module is used to match the real-time parameter information of the target Pod with the labels in the label database to determine at least one label feature that matches the target Pod; The label marking module is used to mark the target Pod with a corresponding label according to the label features matched by the target Pod.
8. A Pod label marking device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the label marking method for a Pod according to any one of claims 1 to 6 is implemented.
9. 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, the device where the computer-readable storage medium is located is controlled to execute the Pod labeling method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product includes a computer program or computer instructions, and when the computer program or the computer instructions are executed by a processor, the label marking method for a Pod according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Community discovery method and device, computer equipment and storage medium
CN110738577A
Cluster node label creation method and system, electronic equipment and storage medium
CN112527449A
Pod management method and device in container cloud platform and electronic equipment
CN114416156A
Node scheduling method and device, electronic equipment and computer program product
CN116954843A
Activity tag determination method and device, computer equipment and storage medium
CN117194768A