Container migration method and apparatus for container cluster management system, device, and medium
By performing state analysis and prediction of containers running under cloud native systems, container migration is realized, and the problem of state information loss in k8s when container failure is solved, ensuring the integrity of business data and user experience.
Patent Information
- Application Number
- PCT/CN2023/140855
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-01
- Filing Date
- 2023-12-22
- Publication Date
- 2025-02-06
AI Technical Summary
In cloud native technology, frameworks such as k8s maintain high system availability by creating new replicas in the event of container failure, but this leads to the loss of status information in complex businesses that run for a long time, resulting in interruption or failure of user services, and reducing user experience.
By performing state analysis of containers running under cloud native system, predict failure conditions, determine the container to be migrated, transmit its business data to the target node, and generate a new container pod on the target node, restore business data, and realize the container's migrate.
Ensure the integrity of business data after migration, reduce the impact on user business, improve user experience, and avoid business interruptions.
Smart Images

Figure CN2023140855_06022025_PF_FP_ABST
Abstract
Description
Container migration method, device, equipment and medium for container cluster management system
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on August 1, 2023, with application number 202310954905.1, entitled “Container Migration Method, Apparatus, Equipment and Medium for Container Cluster Management System,” the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present application relates to the field of cloud native technology, and in particular to a container migration method, device, electronic device, and non-volatile readable storage medium for a container cluster management system. Background Art
[0004] Cloud-native technologies have become a critical core technology in the development of cloud computing, and enterprises' cloud-based businesses are gradually transitioning to cloud-native technologies. Key elements of cloud-native include containerization, microservices, continuous delivery, and DevOps (the integration of development and operations). Containerized services effectively isolate resources and, compared to traditional virtualization technologies, offer more granular resource allocation and automated, scalable service orchestration. Consequently, an increasing number of enterprises are migrating their services from traditional cloud computing physical or virtual machines to containers, enabling full-process containerized deployment and operations management. Furthermore, cloud service providers are increasingly shifting their services from IaaS (Infrastructure as a Service) to PaaS (Platform-as-a-Service) and SaaS (Software-as-a-Service), investing more resources and components to enhance their cloud-native service ecosystems.
[0005] As the scale of cloud native grows, effective management of cloud native-based cloud computing services is of great significance. Due to the large scale of containers, in order to improve the high availability of cloud computing services, they are currently usually scheduled and managed based on frameworks such as k8s (Kubernetes, an open source container cluster management system for cloud platforms) to achieve efficient utilization of resources.
[0006] However, since the most basic management method for containers or Pods (the smallest unit that can be created and managed in the k8s system, and the carrier for the operation of container instances) in k8s is to create or delete them, in terms of maintaining high system availability, when an existing node fails and some containers cannot work properly, k8s generally creates and restarts a new copy of the failed container at a new destination to provide the same service. Although this method is relatively simple in logic and easy to implement, for long-term complex businesses, since container businesses often have dependencies, a complete business is composed of a group of container services. The status information generated by this long-term operation cannot be maintained on the new copy, which will lead to interruption or failure of user business and reduce the user experience quality.
[0007] Summary of the Invention
[0008] The purpose of the embodiments of the present application is to provide a container migration method, device, electronic device and non-volatile readable storage medium for a container cluster management system, which can ensure the integrity of business data after migration during use, reduce the impact on user business, and improve the user experience.
[0009] To solve the above technical problems, an embodiment of the present application provides a container migration method for a container cluster management system, including:
[0010] Analyze the status of each running container in the cloud native system and obtain prediction results;
[0011] Determine the failed container to be migrated based on the prediction results;
[0012] Transferring the business data in the container to be migrated to the target node, where the target node is another node that is operating normally;
[0013] Generate a new container pod on the target node, and restore the business data in the new container pod to generate the corresponding container.
[0014] In one embodiment, the status of each running container in the cloud native system is analyzed to obtain prediction results, including:
[0015] Monitor the operating status of the host machine where the cloud native system resides and determine the predicted operating status of the host machine;
[0016] Monitor the running status of each virtual operating system on the host machine and determine the predicted running status corresponding to each virtual operating system;
[0017] Monitor the running status of the container cluster management system on each virtual operating system and determine the predicted running status of the container cluster management system;
[0018] A prediction result is generated based on the predicted operating status of the host machine, the predicted operating status corresponding to each virtual operating system, and the predicted operating status of the container cluster management system on each virtual operating system.
[0019] In one embodiment, before monitoring the running status of each virtual operating system on the host machine, the method further includes:
[0020] Based on the predicted running state of the host machine, it is determined whether the state of the host machine is a fault state. If the state of the host machine is a fault state, the step of monitoring the running state of each virtual operating system on the host machine is executed.
[0021] In one embodiment, determining whether the host machine is in a fault state based on the predicted operating state of the host machine includes:
[0022] Continuously obtain the predicted operating status of the host machine in multiple time periods and the actual operating status of the host machine in each time period;
[0023] For each time period, the predicted operating status of the host machine in that time period is compared with the corresponding actual operating status;
[0024] Counting a first number of time periods in which the predicted operating state is different from the actual operating state;
[0025] When the ratio of the first number to the total number of the time period is greater than a preset threshold, it is determined that the state of the host machine is a fault state.
[0026] In one embodiment, monitoring the operating status of a host computer where a cloud native system resides and determining a predicted operating status of the host computer includes:
[0027] Obtain the operating status information of the host where the cloud native system is located in the current time period;
[0028] Analyze the running status information of the current time period to obtain the predicted status information of the host machine in the next time period;
[0029] The predicted operating state of the host machine in the next time period is determined based on the predicted state information of the host machine in the next time period.
[0030] In one embodiment, determining the predicted operating state of the host machine in the next time period based on the predicted state information of the host machine in the next time period includes:
[0031] Obtain predicted values of various status parameters based on the host machine's predicted status information in the next time period;
[0032] Compare the predicted values of various status parameters with the corresponding normal thresholds;
[0033] When the predicted value of at least one type of state parameter is greater than the corresponding normal threshold, determining that the predicted operating state of the host machine in the next time period is an abnormal state;
[0034] When the predicted values of various status parameters do not exceed the corresponding normal thresholds, it is determined that the predicted operating state of the host machine in the next time period is a normal state.
[0035] In one embodiment, the operating status information includes one or more combinations of central processing unit utilization, memory utilization, network bandwidth utilization, and storage disk utilization.
[0036] In one embodiment, the operating status information of the current time period is analyzed to obtain the predicted status information of the host machine in the next time period, including:
[0037] Use the pre-established state prediction neural network model to analyze the operating status information of the current time period to obtain the predicted operating status of the host machine in the next time period;
[0038] Among them, the state prediction neural network model is obtained by training the deep learning network based on the time series analysis method and combining the historical operating status information of the host machine.
[0039] In one embodiment, the training process of the state prediction neural network model includes:
[0040] Obtain the host's operating status information in multiple historical time periods;
[0041] The deep learning network is trained using time series analysis and operating status information from multiple historical time periods. The network parameters are updated during the training process until the loss function converges to determine the final network parameters.
[0042] A trained state prediction neural network model is obtained based on the final network parameters.
[0043] In one embodiment, monitoring the running status of each virtual operating system on the host machine and determining the predicted running status corresponding to each virtual operating system includes:
[0044] In the process of monitoring the running status of each virtual operating system on the host machine, for each virtual machine operating system, obtaining the current running log of the virtual machine operating system;
[0045] The pre-established first document topic generation model is combined with the Gibbs sampling method to analyze the current operation log of the virtual machine operating system to obtain the predicted operation status of the virtual operating system in the next time period;
[0046] The first document topic generation model is established in advance by using the Gibbs sampling method in combination with the historical operation logs of the virtual machine operating system.
[0047] In one embodiment, the process of establishing the first document topic generation model includes:
[0048] Obtaining multiple first historical running logs of the virtual machine operating system in multiple historical time periods;
[0049] For each historical time period, generating a corresponding first text based on a plurality of first historical operation logs within the historical time period;
[0050] For each first text, randomly assign a first topic number to each word in the first text;
[0051] A Gibbs sampling method is used to perform topic resampling on each word in the first text, and a first probability distribution parameter and a second probability distribution parameter are continuously updated during the sampling process; wherein the first probability distribution parameter is used to calculate the parameters of the probability distribution of the topic under the text, and the second probability distribution parameter is used to calculate the parameters of the probability distribution of the words under the topic;
[0052] When both the first probability distribution parameter and the second probability distribution parameter converge, determining a final second probability distribution parameter corresponding to each first topic number;
[0053] Forming a first topic word co-occurrence frequency matrix based on the final second probability distribution parameter of each first topic number, each first topic number, each word, and the probability of the word under each topic;
[0054] The first topic word co-occurrence frequency matrix is used as the first document topic generation model.
[0055] In one embodiment, a pre-established first document topic generation model is used in combination with the Gibbs sampling method to analyze the current operation log of the virtual machine operating system to obtain the predicted operation state of the virtual operating system in the next time period, including:
[0056] Generate a first current operation log text based on the current operation log of the virtual machine operating system;
[0057] Randomly assigning a first topic number to each word in the first current running log file;
[0058] Resampling topics of the first current operation log using the Gibbs sampling method, and updating corresponding first probability distribution parameters in combination with the first document topic generation model until the first probability distribution parameters corresponding to the first current operation log text converge, thereby obtaining a topic probability distribution under the first current operation log text;
[0059] Determine a first topic number with the highest probability based on a topic probability distribution under the first current running log text;
[0060] Based on the first topic number with the highest probability and the first document topic generation model, a first preset number of words with the highest probability corresponding to the first topic number with the highest probability is obtained;
[0061] Based on the first preset number of words, a predicted running state of the virtual operating system in a next time period is determined.
[0062] In one embodiment, determining a predicted operating state of the virtual operating system in a next time period based on a first preset number of words includes:
[0063] It is determined whether there are words with wrong meanings among the first preset number of words. If so, it is determined that the predicted operating state of the virtual operating system in the next time period is abnormal; if not, it is determined that the predicted operating state of the virtual operating system in the next time period is normal.
[0064] In one embodiment, monitoring the operating status of the container cluster management system on each virtual operating system and determining the predicted operating status of the container cluster management system includes:
[0065] In the process of monitoring the running status of the container cluster management system on each virtual operating system, for each container cluster management system, obtaining the current running log of the container cluster management system;
[0066] The pre-established second document topic generation model is combined with the Gibbs sampling method to analyze the current operation log of the container cluster management system to obtain the predicted operation status of the container cluster management system in the next time period;
[0067] The second document topic generation model is established in advance by using the Gibbs sampling method combined with the historical operation log of the container cluster management system.
[0068] In one embodiment, the process of establishing the second document topic generation model includes:
[0069] Obtain multiple second historical operation logs of the container cluster management system in multiple historical time periods;
[0070] For each historical time period, generating a corresponding second text based on a plurality of second historical operation logs within the historical time period;
[0071] For each second text, randomly assign a second topic number to each word in the second text;
[0072] The Gibbs sampling method is used to perform topic resampling on each word in the second text, and the first probability distribution parameters and the second probability distribution parameters are continuously updated during the sampling process; wherein the first probability distribution parameters are used to calculate the parameters of the probability distribution of the topic under the text, and the second probability distribution parameters are used to calculate the parameters of the probability distribution of the words under the topic;
[0073] When both the first probability distribution parameter and the second probability distribution parameter converge, determining a final second probability distribution parameter corresponding to each second topic number;
[0074] Forming a second topic word co-occurrence frequency matrix based on the final second probability distribution parameter of each second topic number, each second topic number, each word, and the probability of the word under each topic;
[0075] The co-occurrence frequency matrix of the second topic words is used as the second document topic generation model.
[0076] In one embodiment, a pre-established second document topic generation model is used in combination with the Gibbs sampling method to analyze the current operation log of the container cluster management system to obtain the predicted operation status of the container cluster management system in the next time period, including:
[0077] Generate a second current running log text based on the current running log of the container cluster management system;
[0078] Randomly assigning a second topic number to each word in the second current running log file;
[0079] Resampling the topic of the second current operation log using the Gibbs sampling method, and updating the corresponding first probability distribution parameters in combination with the second document topic generation model until the first probability distribution parameters corresponding to the second current operation log text converge, thereby obtaining the topic probability distribution under the second current operation log text;
[0080] Determining a second topic number with the highest probability based on the topic probability distribution under the second current running log text;
[0081] Based on the second topic number with the highest probability and the second document topic generation model, obtain the first second preset number of words with the highest probability corresponding to the second topic number with the highest probability;
[0082] Based on the first second preset number of words, a predicted operating state of the container cluster management system in a next time period is determined.
[0083] In one embodiment, determining a predicted operating state of the container cluster management system in a next time period based on the first second preset number of words includes:
[0084] It is determined whether there are any words with incorrect meanings among the first second preset number of words. If so, it is determined that the predicted operating state of the container cluster management system in the next time period is abnormal; if not, it is determined that the predicted operating state of the container cluster management system in the next time period is normal.
[0085] In one embodiment, before transferring the service data in the container to be migrated to the target node, the method further includes:
[0086] A target node is selected from other normal nodes based on the container requirement information of the container to be migrated.
[0087] In one embodiment, the container requirement information includes CPU requirements, memory requirements, network requirements, and storage resource requirements.
[0088] In one embodiment, selecting a target node from other normal nodes based on container requirement information of the container to be migrated includes:
[0089] For each of the other normal nodes, select a candidate node that meets the CPU requirements, memory requirements, network requirements, and storage resource requirements of the container to be migrated from the other normal nodes. Combined with the remaining CPU, memory, network, and storage resources of each candidate node, calculate the average resource abundance rate corresponding to the candidate node.
[0090] The candidate node with the highest average resource abundance rate is selected from each candidate node as the target node.
[0091] In one embodiment, determining a failed container to be migrated based on the prediction result includes:
[0092] When it is determined that there is a virtual operating system whose operating state is predicted to be abnormal, it is determined whether the number of virtual operating systems whose operating state is predicted to be abnormal is greater than a threshold. If the number of virtual operating systems whose operating state is predicted to be abnormal is greater than the threshold, all containers under the host machine are determined as containers to be migrated; if the number of virtual operating systems whose operating state is predicted to be abnormal is not greater than the threshold, all containers under the virtual operating system whose operating state is preset to be abnormal are determined as containers to be migrated;
[0093] If the predicted running status of all virtual machine operating systems is normal, and there is a container cluster management system whose predicted running status is abnormal, the container with the abnormal status is determined according to the log information of the container cluster management system whose predicted running status is abnormal, and the container with the abnormal status is used as the container to be migrated.
[0094] In one embodiment, transferring the service data in the container to be migrated to the target node includes:
[0095] Take a snapshot of the business data in the container to be migrated, generate a dump file, and transfer the dump file to the target node.
[0096] Determine whether the dump file transfer duration is greater than a duration threshold. If so, take a snapshot of the updated business data in the container to be migrated within the transfer duration, generate an update dump file, and transfer the update dump file to the target node.
[0097] The updated dump file is used as the dump file, and the process returns to the step of determining whether the transfer time of the dump file is greater than a time threshold. The transfer is completed when the transfer time is less than the time threshold.
[0098] In one embodiment, after generating a new container pod on the target node and restoring the service data in the new container pod to generate a corresponding container, the method further includes:
[0099] Delete the old container pod corresponding to the container to be migrated from the corresponding host.
[0100] The present application also provides a container migration device for a container cluster management system, including:
[0101] The analysis module is used to analyze the status of each running container in the cloud native system and obtain prediction results;
[0102] A determination module, configured to determine a failed container to be migrated based on the prediction result;
[0103] A transmission module is used to transmit the business data in the container to be migrated to the target node, where the target node is another node that is operating normally;
[0104] The generation module is used to generate a new container pod on the target node and restore the business data in the new container pod to generate the corresponding container.
[0105] The present application also provides an electronic device, including:
[0106] memory for storing computer programs;
[0107] A processor is configured to implement the steps of the container migration method of the container cluster management system described above when executing a computer program.
[0108] The present application also provides a non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the container migration method of the container cluster management system as described above are implemented.
[0109] An embodiment of the present application provides a container migration method, device, electronic device and non-volatile readable storage medium for a container cluster management system, the method comprising: analyzing the status of each running container in a cloud native system to obtain a prediction result; determining a failed container to be migrated based on the prediction result; transmitting business data in the container to be migrated to a target node, wherein the target node is another node that is operating normally; generating a new container pod on the target node, and restoring the business data in the new container pod to generate a corresponding container.
[0110] It can be seen that the present application obtains prediction results by analyzing the status of each running container under the cloud native system in real time. According to the prediction results, the container that will fail can be further determined, and the determined container that will fail is used as the container to be migrated. The business data in the container to be migrated is then transferred to other normally running target nodes, and a new container pod is generated on the target node. The business data is restored to the corresponding container in the new container pod, thereby realizing the migration of the container. The present application determines the container that will fail by prediction and then migrates the container. During the migration of the container, the container is still in a running state, and the user business will not be interrupted. In addition, the business data of the container is migrated as a whole during the migration process, which can ensure the integrity of the business data after migration, reduce the impact on user business, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0111] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the prior art and the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0112] FIG1 is a flow chart of a container migration method of a container cluster management system provided by an embodiment of the present application;
[0113] FIG2 is a flow chart of another container migration method of a container cluster management system provided in an embodiment of the present application;
[0114] FIG3 is a schematic diagram of the structure of a container migration device of a container cluster management system provided by an embodiment of the present application;
[0115] FIG4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0116] FIG5 is a schematic structural diagram of a non-volatile readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0117] The embodiments of the present application provide a container migration method, device, electronic device, and non-volatile readable storage medium for a container cluster management system, which can ensure the integrity of business data after migration during use, reduce the impact on user business, and improve the user experience.
[0118] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0119] Please refer to Figure 1, which is a flow chart of a container migration method for a container cluster management system provided by an embodiment of the present application. The method includes:
[0120] S110: Analyze the status of each running container in the cloud native system to obtain a prediction result;
[0121] It should be noted that in the embodiment of the present application, by monitoring and analyzing the status of each running container in the cloud native system, the corresponding prediction results can be obtained. That is, by analyzing the status of the running container, the prediction results can be obtained, and the subsequent predicted status of the container can be determined based on the prediction results.
[0122] S120: Determine the failed container to be migrated based on the prediction result;
[0123] Specifically, after obtaining the prediction result, the predicted state of the container can be further determined based on the prediction result, thereby determining the container whose predicted state is failure, that is, determining the container that is about to fail, and determining the container as the container to be migrated. In actual applications, the number of containers to be migrated can be one or more, and can be determined according to actual needs.
[0124] S130: Transferring the service data in the container to be migrated to a target node, where the target node is another node that is operating normally.
[0125] It should be noted that after the container to be migrated is determined, the business data in the container to be migrated is migrated. Specifically, the business data in the container to be migrated is migrated to the target node, which is another node that is operating normally. In addition, since the container to be migrated that will fail is determined by the prediction results in the embodiment of the present application, the container to be migrated has not completely failed at this time, and the container to be migrated is still running, which will not cause business interruption.
[0126] S140: Generate a new container pod on the target node, and restore the business data in the new container pod to generate a corresponding container.
[0127] Specifically, after migrating the business data of the container to be migrated to the target node, a new container pod can be generated on the node to carry the container instance. This pod is the carrier for the container instance to run. The business data on the target node is then restored in the new container pod to obtain the corresponding container. That is, in the embodiment of the present application, the complete business data of the container to be migrated is restored to the corresponding container in the new pod of the target node, thereby ensuring that the newly generated container is the same as the container to be migrated, thereby reducing the impact on user business and improving user experience.
[0128] It can be seen that the present application obtains prediction results by analyzing the status of each running container under the cloud native system in real time. According to the prediction results, the container that will fail can be further determined, and the determined container that will fail is used as the container to be migrated. The business data in the container to be migrated is then transferred to other normally running target nodes, and a new container pod is generated on the target node. The business data is restored to the corresponding container in the new container pod, thereby realizing the migration of the container. The present application determines the container that will fail by prediction and then migrates the container. During the migration of the container, the container is still in a running state, and the user business will not be interrupted. In addition, the business data of the container is migrated as a whole during the migration process, which can ensure the integrity of the business data after migration, reduce the impact on user business, and improve the user experience.
[0129] Please refer to FIG2 . Based on the above embodiment, the present application is further introduced and explained below, specifically as follows:
[0130] S210: Monitor the operating status of the host machine where the cloud native system is located, and determine the predicted operating status of the host machine;
[0131] It should be noted that in the embodiment of the present application, in the process of monitoring the running containers under the cloud native system, the running status of the container cluster management system, the running status of the virtual operating system where the container cluster management system is located, and the running status of the corresponding host machine can be monitored.
[0132] Specifically, you can first monitor the operating status of the host machine where the cloud native system is located to determine the predicted operating status of the host machine.
[0133] In one embodiment, the process of monitoring the operating status of the host machine where the cloud native system is located and determining the predicted operating status of the host machine in S210 may specifically include:
[0134] Obtain the operating status information of the host where the cloud native system is located in the current time period;
[0135] Analyze the running status information of the current time period to obtain the predicted status information of the host machine in the next time period;
[0136] The predicted operating state of the host machine in the next time period is determined based on the predicted state information of the host machine in the next time period.
[0137] It should be noted that the operating status information of the host machine where the cloud native system is located in the current time period can be obtained, and then by analyzing the operating status information of the host machine in the current time period, the predicted status information of the host machine in the next time period can be obtained. Then, based on the predicted status information of the host machine at the next time, the predicted operating status of the host machine in the next time period can be determined.
[0138] Specifically, the process of analyzing the operating status information of the current time period to obtain the predicted status information of the host machine in the next time period may include:
[0139] Use the pre-established state prediction neural network model to analyze the operating status information of the current time period to obtain the predicted operating status of the host machine in the next time period;
[0140] Among them, the state prediction neural network model is obtained by training the deep learning network based on the time series analysis method and combining the historical operating status information of the host machine.
[0141] It should be noted that in the embodiment of the present application, the historical operating status information of the host machine can be obtained in advance, and then the time series analysis method and the historical operating status information of the host machine can be used to train the deep learning network to obtain a state prediction neural network model. Then, when the host machine is monitored, the state prediction neural network model can be used to analyze and predict the operating status information of the host machine in the current time period, so as to obtain the predicted operating status of the host machine in the next time period.
[0142] The process of establishing the state prediction neural network model in the embodiment of the present application may include:
[0143] Obtain the host's operating status information in multiple historical time periods;
[0144] The deep learning network is trained using time series analysis and operating status information from multiple historical time periods. The network parameters are updated during the training process until the loss function converges to determine the final network parameters.
[0145] A trained state prediction neural network model is obtained based on the final network parameters.
[0146] It is understandable that in the embodiment of the present application, the operating status information of the host machine in multiple historical time periods can be obtained based on the historical data of the host machine, wherein the operating status information can specifically include a combination of one or more of the central processing unit utilization, memory utilization, network bandwidth utilization, and storage disk utilization. The operating status information in the embodiment of the present application can include central processing unit (CPU) utilization, memory utilization, network bandwidth utilization, and storage disk utilization. That is, based on historical data, the operating status information x of the four types of status information of CPU, memory, network, and storage at the same time is formed for the time period t. t =(p c , p m , p n , p s ), where p c Indicates CPU utilization, p m Indicates memory utilization, p n Indicates the network bandwidth utilization, p s Determine the operating status information of each of the T historical time periods as x1, x2, ...x t ,...x T , forming the input data {x1, x2, ....x t ....x T}, input these data into the model to obtain the predicted value y for the t+1 period t+1 , compare the predicted value with the true value, calculate the loss function L, update the network parameters until the loss function converges, determine the final network parameters of the network model, and thus obtain a trained state prediction neural network model.
[0147] In one embodiment, the process of determining the predicted operating state of the host machine in the next time period based on the predicted state information of the host machine in the next time period may specifically include:
[0148] Obtain predicted values of various status parameters based on the host machine's predicted status information in the next time period;
[0149] Compare the predicted values of various status parameters with the corresponding normal thresholds;
[0150] When the predicted value of at least one type of state parameter is greater than the corresponding normal threshold, determining that the predicted operating state of the host machine in the next time period is an abnormal state;
[0151] When the predicted values of various status parameters do not exceed the corresponding normal thresholds, it is determined that the predicted operating state of the host machine in the next time period is a normal state.
[0152] It should be noted that, based on the predicted state information of the host machine in the next time period, the predicted values of various state parameters can be obtained, such as the predicted values of CPU utilization, memory utilization, network bandwidth utilization and storage disk utilization, and then the predicted values of various parameters are analyzed according to the pre-set normal thresholds corresponding to each type of state parameter, and the predicted values of various state parameters are compared with the corresponding normal thresholds. If the predicted value of the state parameter of this type exceeds the corresponding normal threshold, it means that the parameter of this type is abnormal. When the predicted values of one or more types of state parameters in each type of parameter exceed the corresponding normal threshold, it means that the host machine may have some faults, that is, the underlying host machine is very likely to be abnormal in the next time period, and the predicted operating state is abnormal. At this time, EX H =1, indicating that the predicted anomaly monitoring occurs at the host hardware level.
[0153] S220: Monitor the running status of each virtual operating system on the host machine and determine the predicted running status corresponding to each virtual operating system;
[0154] It should be noted that, in order to accurately predict the container status in the real-time example of this application, the running status of each virtual operating system on the host machine can also be monitored, and the predicted running status of each virtual operating system can be determined through analysis.
[0155] Specifically, for each virtual machine operating system, in the process of monitoring the running state of the virtual operating system and determining the predicted running state corresponding to the virtual operating system, the following steps may be specifically performed:
[0156] Get the current running log of the virtual machine operating system;
[0157] The pre-established first document topic generation model is combined with the Gibbs sampling method to analyze the current operation log of the virtual machine operating system to obtain the predicted operation status of the virtual operating system in the next time period;
[0158] The first document topic generation model is established in advance by using the Gibbs sampling method in combination with the historical operation logs of the virtual machine operating system.
[0159] It should be noted that in the embodiment of the present application, the predicted operating status of the virtual operating system in the next time period is determined by monitoring the status log of the virtual operating system. Usually, when an error message appears in a log, it means that some faults may have occurred at the system level. In order to improve the reliability of the log, multiple log data are used for analysis, and the topic model technology is used to find out the main factors of the fault.
[0160] Specifically, in an embodiment of the present application, the Gibbs sampling method can be used in advance to combine the historical operation logs of the virtual machine operating system to establish a first document topic generation model, and then the first document topic generation model can be used in combination with the Gibbs sampling method to analyze the current operation logs of the virtual machine operating system to obtain the predicted operation status of the virtual operating system in the next time period.
[0161] The process of establishing the first document topic generation model includes:
[0162] Obtaining multiple first historical running logs of the virtual machine operating system in multiple historical time periods;
[0163] For each historical time period, generating a corresponding first text based on a plurality of first historical operation logs within the historical time period;
[0164] For each first text, randomly assign a first topic number to each word in the first text;
[0165] A Gibbs sampling method is used to perform topic resampling on each word in the first text, and a first probability distribution parameter and a second probability distribution parameter are continuously updated during the sampling process; wherein the first probability distribution parameter is used to calculate the parameters of the probability distribution of the topic under the text, and the second probability distribution parameter is used to calculate the parameters of the probability distribution of the words under the topic;
[0166] When both the first probability distribution parameter and the second probability distribution parameter converge, determining a final second probability distribution parameter corresponding to each first topic number;
[0167] Forming a first topic word co-occurrence frequency matrix based on the final second probability distribution parameter of each first topic number, each first topic number, each word, and the probability of the word under each topic;
[0168] The first topic word co-occurrence frequency matrix is used as the first document topic generation model.
[0169] It should be noted that, in the embodiment of the present application, multiple first historical operation logs of the virtual machine operating system in multiple historical time periods can be obtained, that is, multiple first historical operation logs in each historical time period are obtained, and a long text is generated based on the multiple first historical operation logs, that is, a first text is obtained, thereby obtaining a first text corresponding to each of the multiple historical time periods. For each first text, a first topic number is randomly assigned to each word in the first text, for example, for the jth first text d j The i-th word w in i A first topic number tp is randomly assigned.
[0170] According to the Gibbs sampling relationship in the Gibbs sampling method:
[0171] Resample the topic for each word and update the first probability distribution parameter α and the second probability distribution parameter β, where p(w i |d j ) represents word w i Appears in text d j The frequency in the text can be j Calculate, is a known quantity, p(w i |tp k ) indicates topic tp k Next word w i The probability distribution of the second probability distribution parameter β is the parameter for generating the probability distribution, p(tp k |d j ) represents document d j Next topic tp k The probability distribution of the first probability distribution parameter α is used to generate the probability distribution p(tp k |d j ) parameter. K represents a total of K first topic numbers, that is, there are a total of K first topics, and k represents the kth topic number.
[0172] Specifically, the above process is repeated to perform Gibbs sampling processing on each first text, and the first probability distribution parameters and the second probability distribution parameters are continuously updated. When the first probability distribution parameters and the second probability distribution parameters converge, the final second probability distribution parameters corresponding to each first topic number can be determined, and then the first topic word co-occurrence frequency matrix is formed according to the final second probability distribution parameters corresponding to each first topic number, each first topic number, each word and the probability of the word under each topic, and the first topic word co-occurrence frequency matrix is used as the first document topic generation model.
[0173] In one embodiment, the process of analyzing the current operation log of the virtual machine operating system using the pre-established first document topic generation model in combination with the Gibbs sampling method to obtain the predicted operation state of the virtual operating system in the next time period may include:
[0174] Obtain the current running log of the virtual machine operating system, and generate a first current running log text based on the current running log of the virtual machine operating system, then randomly assign a first topic number to each word in the first current running log file, use the Gibbs sampling method to perform topic resampling on the first current running log, and update the corresponding first probability distribution parameters in combination with the first document topic generation model until the first probability distribution parameters corresponding to the first current running log text converge, and obtain the topic probability distribution under the first current running log text; wherein, each topic number in the first document topic generation model corresponds to a second probability distribution parameter, so when the corresponding first probability distribution parameter of the first document topic generation model is updated, the second probability distribution parameter is a fixed value, and for each word in the first current running log text, the frequency of the word appearing in the first current running log text can be calculated, and then the topic probability distribution under the first current running log text is further calculated.
[0175] Specifically, after obtaining the topic probability distribution under the first current running log text, the first topic number with the highest probability can be further determined based on the topic probability distribution under the first current running log text, and then the first topic number with the highest probability and the first preset number of words with the highest probability corresponding to the first topic number with the highest probability can be matched from the first document topic generation model based on the first topic number with the highest probability. For example, the top 5 words with the highest probability for the first topic number being 1 are determined, and then the predicted running status of the virtual operating system in the next time period is determined based on the first preset number of words.
[0176] Specifically, when determining the predicted operating state of the virtual operating system in the next time period based on the first preset number of words, it is possible to first determine whether there are words with wrong meanings among the first preset number of words. If so, it is determined that the predicted operating state of the virtual operating system in the next time period is an abnormal state; if not, it is determined that the predicted operating state of the virtual operating system in the next time period is a normal state.
[0177] That is, when the words such as Error or Fault are included in the first preset number of words with the highest probability, it is considered that the predicted running state of the virtual operating system in the next time period is abnormal, and the EX o =1, otherwise, the predicted running state of the virtual operating system in the next time period is considered to be normal.
[0178] In one embodiment, before monitoring the running status of each virtual operating system on the host machine in S220, the method may further include:
[0179] Based on the predicted running state of the host machine, it is determined whether the state of the host machine is a fault state. If the state of the host machine is a fault state, the step of monitoring the running state of each virtual operating system on the host machine is executed.
[0180] It is understandable that in order to further improve monitoring accuracy, when the host machine's state can be determined to be a fault state based on the predicted running state of the host machine, the running state of each virtual machine operating system on the host machine can be further monitored.
[0181] Furthermore, the process of determining whether the host machine is in a fault state based on the predicted operating state of the host machine may include:
[0182] Continuously obtain the predicted operating status of the host machine in multiple time periods and the actual operating status of the host machine in each time period;
[0183] For each time period, the predicted operating status of the host machine in that time period is compared with the corresponding actual operating status;
[0184] Counting a first number of time periods in which the predicted operating state is different from the actual operating state;
[0185] When the ratio of the first number to the total number of the time period is greater than a preset threshold, it is determined that the state of the host machine is a fault state.
[0186] That is, in order to determine the reliability of fault prediction in practical applications, we can obtain EX H The actual operating status is compared with the predicted status in the next time period. If the actual and predicted statuses are the same, the value is 0; if they are different, the value is 1. The frequency m1 of 1 is then counted. When m1 / m>u, a fault has actually occurred and further processing is required. Otherwise, the prediction is invalid and the prediction result is not adopted. u is the preset threshold, also known as the sensitivity value. A higher u value indicates that the host system can tolerate most errors, so the system sensitivity decreases. A lower u value indicates a higher system sensitivity.
[0187] S230: Monitor the operating status of the container cluster management system on each virtual operating system and determine the predicted operating status of the container cluster management system;
[0188] It should be noted that in the embodiment of the present application, the operating status of the container cluster management system on the virtual machine operating system can be monitored to further determine the predicted operating status of the container cluster management system. According to the predicted operating status of the container cluster management system, it can be further determined which containers are about to fail.
[0189] In one embodiment, the process of monitoring the operating status of the container cluster management system on each virtual operating system and determining the predicted operating status of the container cluster management system in S230 may specifically include:
[0190] In the process of monitoring the running status of the container cluster management system on each virtual operating system, for each container cluster management system, obtaining the current running log of the container cluster management system;
[0191] The pre-established second document topic generation model is combined with the Gibbs sampling method to analyze the current operation log of the container cluster management system to obtain the predicted operation status of the container cluster management system in the next time period;
[0192] The second document topic generation model is established in advance by using the Gibbs sampling method combined with the historical operation log of the container cluster management system.
[0193] Specifically, in an embodiment of the present application, the Gibbs sampling method can be used in advance in combination with the historical operation log of the container cluster management system to establish a second document topic generation model, and then the second document topic generation model can be used in combination with the Gibbs sampling method to analyze the current operation log of the container cluster management system to obtain the predicted operation status of the container cluster management system in the next time period.
[0194] In one embodiment, the second document topic generation model is pre-established using the Gibbs sampling method combined with historical operation logs of the container cluster management system, which may specifically include:
[0195] Obtain multiple second historical operation logs of the container cluster management system in multiple historical time periods;
[0196] For each historical time period, generating a corresponding second text based on a plurality of second historical operation logs within the historical time period;
[0197] For each second text, randomly assign a second topic number to each word in the second text;
[0198] The Gibbs sampling method is used to perform topic resampling on each word in the second text, and the first probability distribution parameters and the second probability distribution parameters are continuously updated during the sampling process; wherein the first probability distribution parameters are used to calculate the parameters of the probability distribution of the topic under the text, and the second probability distribution parameters are used to calculate the parameters of the probability distribution of the words under the topic;
[0199] When both the first probability distribution parameter and the second probability distribution parameter converge, determining a final second probability distribution parameter corresponding to each second topic number;
[0200] Forming a second topic word co-occurrence frequency matrix based on the final second probability distribution parameter of each second topic number, each second topic number, each word, and the probability of the word under each topic;
[0201] The co-occurrence frequency matrix of the second topic words is used as the second document topic generation model.
[0202] It should be noted that, in the embodiment of the present application, multiple second historical operation logs of the cluster management system in multiple historical time periods can be obtained, that is, multiple second historical operation logs in each historical time period are obtained, and a long text is generated based on the multiple second historical operation logs, that is, a second text is obtained, thereby obtaining a second text corresponding to each of the multiple historical time periods. For each second text, a second topic number is randomly assigned to each word in the second text, for example, for the jth second text d j The i-th word w in i A topic number tp (specifically the second topic number) is randomly assigned.
[0203] According to the Gibbs sampling relationship in the Gibbs sampling method:
[0204] Resample the topic for each word and update the first probability distribution parameter α and the second probability distribution parameter β, where p(w i |d j ) represents word w i Appears in text d j The frequency in the text can be j Calculate, is a known quantity, p(w i |tp k ) indicates topic tp k Next word w i The probability distribution of the second probability distribution parameter β is the parameter for generating the probability distribution, p(tp k |d j ) represents document d j Next topic tp k The probability distribution of the first probability distribution parameter α is used to generate the probability distribution p(tp k |d j ) parameter. K represents a total of K topic numbers (specifically, the second topic number), and k represents the kth topic number.
[0205] Specifically, the above process is repeated to perform Gibbs sampling processing on each second text, and the first probability distribution parameters and the second probability distribution parameters are continuously updated. When the first probability distribution parameters and the second probability distribution parameters converge, the final second probability distribution parameters corresponding to each second topic number can be determined, and then the second topic word co-occurrence frequency matrix is formed according to the final second probability distribution parameters corresponding to each second topic number, each second topic number, each word and the probability of the word under each topic, and the second topic word co-occurrence frequency matrix is used as the second document topic generation model.
[0206] In one embodiment, the process of analyzing the current operation log of the container cluster management system using the pre-established second document topic generation model in combination with the Gibbs sampling method to obtain the predicted operation status of the container cluster management system in the next time period may specifically include:
[0207] Generate a second current running log text based on the current running log of the container cluster management system;
[0208] Randomly assigning a second topic number to each word in the second current running log file;
[0209] Resampling the topic of the second current operation log using the Gibbs sampling method, and updating the corresponding first probability distribution parameters in combination with the second document topic generation model until the first probability distribution parameters corresponding to the second current operation log text converge, thereby obtaining the topic probability distribution under the second current operation log text;
[0210] Determining a second topic number with the highest probability based on the topic probability distribution under the second current running log text;
[0211] Based on the second topic number with the highest probability and the second document topic generation model, obtain the first second preset number of words with the highest probability corresponding to the second topic number with the highest probability;
[0212] Based on the first second preset number of words, a predicted operating state of the container cluster management system in a next time period is determined.
[0213] It should be noted that the current operation log of the container cluster management system is obtained, and a second current operation log text is generated based on the current operation log of the container cluster management system, and then a second topic number is randomly assigned to each word in the second current operation log file, and the Gibbs sampling method is used to perform topic resampling on the second current operation log, and the corresponding first probability distribution parameters are updated in combination with the second document topic generation model until the first probability distribution parameters corresponding to the second current operation log text converge, and the topic probability distribution under the second current operation log text is obtained; wherein, each topic number in the second document topic generation model corresponds to a second probability distribution parameter, so when the corresponding first probability distribution parameter of the second document topic generation model is updated, the second probability distribution parameter is a fixed value, and for each word in the second current operation log text, the frequency of the word appearing in the second current operation log text can be calculated, and then the topic probability distribution under the second current operation log text is further calculated.
[0214] Specifically, after obtaining the topic probability distribution under the second current running log text, the second topic number with the highest probability can be further determined based on the topic probability distribution under the second current running log text, and then the top second preset number of words with the highest probability corresponding to the second topic number with the highest probability can be matched from the second document topic generation model based on the second topic number with the highest probability. For example, the top 5 words with the highest probability of the first topic number being 1 are determined, and then the predicted running status of the virtual operating system in the next time period is determined based on the top second preset number of words.
[0215] In one embodiment, determining a predicted operating state of the container cluster management system in a next time period based on the first second preset number of words includes:
[0216] It is determined whether there are any words with incorrect meanings among the first second preset number of words. If so, it is determined that the predicted operating state of the container cluster management system in the next time period is abnormal; if not, it is determined that the predicted operating state of the container cluster management system in the next time period is normal.
[0217] Specifically, when determining the predicted operating status of the container cluster management system in the next time period based on the first second preset number of words, you can first determine whether there are words with wrong meanings among the first second preset number of words. If so, it is determined that the predicted operating status of the container cluster management system in the next time period is an abnormal state; if not, it is determined that the predicted operating status of the container cluster management system in the next time period is a normal state.
[0218] That is, when the words such as Error or fault are included in the second preset number of words with the highest probability, it is considered that the predicted running state of the container cluster management system in the next time period is abnormal, and the EX k =1, otherwise, the predicted operating status of the container cluster management system in the next time period is considered to be normal.
[0219] S240: Generate a prediction result based on the predicted operating status of the host machine, the predicted operating status corresponding to each virtual operating system, and the predicted operating status of the container cluster management system on each virtual operating system;
[0220] It should be noted that in the embodiment of the present application, the predicted operating status of the host machine, the predicted operating status corresponding to each virtual operating system, and the predicted operating status of the container cluster management system on each virtual operating system are integrated to generate a prediction result.
[0221] S250: Determine a failed container to be migrated based on the prediction result;
[0222] Specifically, in the embodiment of the present application, the failed container to be migrated can be determined based on the above prediction results. This can be determined by the following method:
[0223] When it is determined that there is a virtual operating system whose operating state is predicted to be abnormal, it is determined whether the number of virtual operating systems whose operating state is predicted to be abnormal is greater than a threshold. If the number of virtual operating systems whose operating state is predicted to be abnormal is greater than the threshold, all containers under the host machine are determined as containers to be migrated; if the number of virtual operating systems whose operating state is predicted to be abnormal is not greater than the threshold, all containers under the virtual operating system whose operating state is preset to be abnormal are determined as containers to be migrated;
[0224] If the predicted running status of all virtual machine operating systems is normal, and there is a container cluster management system whose predicted running status is abnormal, the container with the abnormal status is determined according to the log information of the container cluster management system whose predicted running status is abnormal, and the container with the abnormal status is used as the container to be migrated.
[0225] It is understandable that when a virtual machine operating system is determined to be abnormal, it is determined whether the number of abnormal virtual machine operating systems on the host machine is greater than a threshold (for example, 2). If it is greater than the threshold, it is considered that the host machine where the current virtual machine operating system is located has failed, and all containers on the virtual machine operating systems on the host machine can be used as containers to be migrated. When all virtual machine operating systems are in a normal state and there is a container cluster management system that is predicted to be in an abnormal state, the abnormal containers can be determined based on the log information of the abnormal container cluster management system and these containers can be used as containers to be migrated.
[0226] S260: Select a target node from other normal nodes based on the container requirement information of the container to be migrated;
[0227] It should be noted that the container requirement information in the embodiment of the present application includes central processing unit CPU requirements, memory requirements, network requirements and storage resource requirements.
[0228] Then, the process of selecting the target node from other normal nodes based on the container requirement information of the container to be migrated in S260 may specifically include:
[0229] For each of the other normal nodes, select a candidate node that meets the CPU, memory, network, and storage resource requirements of the container to be migrated from the other normal nodes. Then, based on the remaining CPU, memory, network, and storage resources of each candidate node, calculate the average resource surplus rate corresponding to the candidate node.
[0230] The candidate node with the highest average resource abundance rate is selected from each candidate node as the target node.
[0231] It should be noted that for the container to be migrated, the container c to be migrated can be d The CPU requirement is Memory requirements are The network requirements are Storage resource requirements are Specifically, it can be recorded as:
[0232] Other normal nodes are used as candidate nodes, and the nodes that can meet the requirements of the container c to be migrated are selected from all candidate nodes. d The required candidate node set H cadi .
[0233] Calculate the average resource abundance rate of each candidate node O avg :
[0234] in,
[0235] Represent the candidate nodes h i The current remaining status of CPU, memory, network, storage and other four resources and h i ∈H cadi , select H cadi Medium O avg The largest candidate node is used as the destination node for container migration.
[0236] S270: Transferring the service data in the container to be migrated to the target node;
[0237] It should be noted that in actual applications, since the business of the container to be migrated has not been stopped, when migrating all current business data on the container to be migrated, since the migration takes a certain amount of time, new business data may be generated during this period. Therefore, the business data in the container to be migrated can be transmitted to the target node multiple times to achieve multiple migrations, thereby further ensuring the integrity of the business data migrated to the target node and better ensuring the normal operation of user business.
[0238] In one embodiment, the process of transferring the service data in the container to be migrated to the target node in S270 may specifically include:
[0239] Take a snapshot of the business data in the container to be migrated, generate a dump file, and transfer the dump file to the target node.
[0240] Determine whether the dump file transfer duration is greater than a duration threshold. If so, take a snapshot of the updated business data in the container to be migrated within the transfer duration, generate an update dump file, and transfer the update dump file to the target node.
[0241] The updated dump file is used as the dump file, and the process returns to the step of determining whether the transfer time of the dump file is greater than a time threshold. The transfer is completed when the transfer time is less than the time threshold.
[0242] It should be noted that in actual applications, the business data of the container to be migrated can be migrated to the target node through the following process:
[0243] You can use the "dump --track-mem --leave-running" command in CRIU to take a snapshot of the business data in the container to be migrated on the pod to be migrated. Specifically, you can take a snapshot of the storage data and memory status information of the container to be migrated. Among them, CRIU (Checkpoint / Restore In Userspace) is a software on Linux that can be used to pause a running container or process, restore the container or process from the breakpoint based on the file generated by CRIU pause, and then continue execution.
[0244] Obtain a dump file from the CRIU snapshot data from the current container node and transfer it to the target node via the network. Since new business data may be generated during a migration process, and CRIU itself only implements one migration process, multiple CRIU operations are required to achieve online migration to pre-copy the memory space occupied by the container multiple times.
[0245] Specifically, the memory tracking feature compares the memory pages occupied by the container to be migrated in the current pod with the updated portion of the memory content in the dump file. It then plans to dump the updated portion again using the "pre-dump --prev-images-dir" command in CRIU and provide it to the target node. Specifically, if the current transfer duration exceeds a time threshold, a snapshot of the updated business data is taken, an updated dump file is generated, and the updated data is transferred again.
[0246] In CRIU terminology, all dumps except the last one are called pre-dumps, which only contain the memory pages of the container to reduce overhead. To evaluate performance, the iteration is stopped (that is, the acquisition and transmission of update data is stopped) when the time required for the last iteration is less than the time threshold thd. Therefore, when
[0247] When further dumping is stopped, D ps Indicates the size of the file generated by the latest dump (that is, the size of the current updated dump file), NB ct Indicates the network transmission capacity between the current node (that is, the host machine) where the container to be migrated is located and the target node.
[0248] S280: Generate a new container pod on the target node, and restore the business data in the new container pod to generate a corresponding container.
[0249] Specifically, after all business data is transferred to the target node, that is, when all dump files are stored in the disk of the target node, a new pod can be cloned (that is, a new pod is generated) through the "kubelet run" command in the target node, and all dump files (that is, business data) in the target node can be restored to containers using the "restore" command in CRIU, thereby realizing the overall migration of containers.
[0250] S290: Delete the old container pod corresponding to the container to be migrated from the corresponding host machine.
[0251] Specifically, in order to save storage resources in the embodiment of the present application, after the migration of the container to be migrated is completed, the old pod of the container to be migrated on the host machine can be deleted from the host machine to complete the hot migration of the container in the k8s environment.
[0252] As can be seen from the above, the container migration method in the embodiment of the present application can realize the collaborative fault prediction and detection technology from hardware infrastructure, virtual machine operating system to container platform, and can detect faults at different levels more accurately. At the same time, the voting mechanism is used to confirm the reliability of the fault prediction results in the form of a majority pass, ensuring that faults at different levels or situations can obtain the best fault tolerance, while ensuring the optimal overall migration consumption of the system. The present application also determines the migration destination (i.e., the target node) of the container to be migrated based on the resource situation in the candidate node, and performs hot migration of the running container based on CRIU technology to shorten the downtime of the container service.
[0253] Based on the above embodiment, the present application also provides a container migration device for a container cluster management system. For details, please refer to FIG3 . The device includes:
[0254] An analysis module 11 is used to analyze the status of each running container in the cloud native system and obtain prediction results;
[0255] A determination module 12 is configured to determine a failed container to be migrated based on the prediction result;
[0256] A transmission module 13 is configured to transmit the service data in the container to be migrated to a target node, where the target node is another node that is operating normally;
[0257] The generation module 14 is configured to generate a new container pod on the target node and restore the service data in the new container pod to generate a corresponding container.
[0258] In one embodiment, the analysis module 11 includes:
[0259] A first monitoring unit is configured to monitor the operating status of the host machine where the cloud native system resides and determine a predicted operating status of the host machine;
[0260] A second monitoring unit is used to monitor the running state of each virtual operating system on the host machine and determine the predicted running state corresponding to each virtual operating system;
[0261] a third monitoring unit, configured to monitor the operating status of the container cluster management system on each virtual operating system and determine a predicted operating status of the container cluster management system;
[0262] The first generating unit is configured to generate a prediction result based on the predicted running state of the host machine, the predicted running state corresponding to each virtual operating system, and the predicted running state of the container cluster management system on each virtual operating system.
[0263] In one embodiment, it further includes:
[0264] The first judgment module is used to judge whether the state of the host machine is a fault state based on the predicted running state of the host machine, and trigger the second monitoring unit if the state of the host machine is a fault state.
[0265] In one embodiment, the first judgment module includes:
[0266] A first acquisition unit is configured to continuously acquire the predicted operating status of the host machine in multiple time periods and the actual operating status of the host machine in each time period;
[0267] a first comparing unit, for comparing, for each time period, the predicted operating state of the host machine in the time period with the corresponding actual operating state;
[0268] a counting unit, configured to count a first number of time periods in which the predicted operating state is different from the actual operating state;
[0269] The first determining unit is configured to determine that the state of the host machine is a fault state when a ratio of the first number to the total number of the time period is greater than a preset threshold.
[0270] In one embodiment, the first monitoring module includes:
[0271] The second acquisition unit is used to obtain the operating status information of the host machine where the cloud native system is located in the current time period;
[0272] A first analysis unit is configured to analyze the operating status information of the current time period to obtain predicted status information of the host machine in the next time period;
[0273] The second determining unit is configured to determine a predicted operating state of the host machine in the next time period according to the predicted state information of the host machine in the next time period.
[0274] In one embodiment, the second determining unit includes:
[0275] The first acquisition subunit is used to obtain predicted values of various status parameters based on the predicted status information of the host machine in the next time period;
[0276] A first comparison subunit is used to compare the predicted values of various state parameters with corresponding normal thresholds;
[0277] a first determining subunit, configured to determine that the predicted operating state of the host machine in the next time period is an abnormal state when the predicted value of at least one type of state parameter is greater than the corresponding normal threshold;
[0278] The second determining subunit is configured to determine that the predicted operating state of the host machine in the next time period is a normal state when the predicted values of the various state parameters do not exceed the corresponding normal thresholds.
[0279] In one embodiment, the operating status information includes one or more combinations of central processing unit utilization, memory utilization, network bandwidth utilization, and storage disk utilization.
[0280] In one embodiment, the first analysis unit is configured to:
[0281] Use the pre-established state prediction neural network model to analyze the operating status information of the current time period to obtain the predicted operating status of the host machine in the next time period;
[0282] Among them, the state prediction neural network model is obtained by training the deep learning network through the training module based on the time series analysis method and combining the historical operation status information of the host machine.
[0283] In one embodiment, the training module includes:
[0284] A third acquisition unit is used to obtain the operating status information of the host machine in multiple historical time periods;
[0285] A training unit is used to train the deep learning network using a time series analysis method and operating status information from multiple historical time periods, and to update the network parameters during the training process until the loss function converges to determine the final network parameters;
[0286] The second generating unit is used to obtain a trained state prediction neural network model based on the final network parameters.
[0287] In one embodiment, the second monitoring unit includes:
[0288] The second acquisition subunit is used to acquire the current operation log of each virtual machine operating system for each virtual machine operating system in the process of monitoring the operation status of each virtual operating system on the host machine;
[0289] The second analysis subunit is configured to analyze the current operation log of the virtual machine operating system using a pre-established first document topic generation model combined with a Gibbs sampling method to obtain a predicted operation state of the virtual operating system in the next time period;
[0290] The first document topic generation model is established in advance by the first establishing unit using the Gibbs sampling method in combination with the historical operation log of the virtual machine operating system.
[0291] In one embodiment, the first establishing unit includes:
[0292] A fourth acquisition sub-unit is used to acquire a plurality of first historical operation logs of the virtual machine operating system in a plurality of historical time periods;
[0293] A first generating subunit is configured to generate, for each historical time period, a corresponding first text based on a plurality of first historical operation logs within the historical time period;
[0294] A first assignment subunit is configured to randomly assign a first topic number to each word in each first text;
[0295] A first sampling subunit is configured to perform topic resampling on each word in the first text using a Gibbs sampling method, and continuously update first probability distribution parameters and second probability distribution parameters during the sampling process; wherein the first probability distribution parameters are used to calculate parameters of the probability distribution of topics under the text, and the second probability distribution parameters are used to calculate parameters of the probability distribution of words under the topics;
[0296] A third determining subunit is configured to determine, when both the first probability distribution parameter and the second probability distribution parameter converge, a final second probability distribution parameter corresponding to each first topic number;
[0297] A second generating subunit is configured to form a first topic word co-occurrence frequency matrix based on the final second probability distribution parameter of each first topic number, each first topic number, each word, and the probability of the word under each topic;
[0298] The fourth determining subunit is configured to use the first topic word co-occurrence frequency matrix as a first document topic generation model.
[0299] In one embodiment, the second analysis subunit comprises:
[0300] A third generating subunit is configured to generate a first current running log text based on the current running log of the virtual machine operating system;
[0301] a second assignment subunit, configured to randomly assign a first topic number to each word in the first current running log file;
[0302] a second sampling subunit, configured to perform topic resampling on the first current operation log using a Gibbs sampling method, and update corresponding first probability distribution parameters in combination with the first document topic generation model until the first probability distribution parameters corresponding to the first current operation log text converge, thereby obtaining a topic probability distribution under the first current operation log text;
[0303] A fifth determining subunit, configured to determine a first topic number with the highest probability based on the topic probability distribution under the first current running log text;
[0304] A sixth determining subunit is configured to obtain a first preset number of words with the highest probability corresponding to the first topic number with the highest probability based on the first topic number with the highest probability and in combination with the first document topic generation model;
[0305] The seventh determining subunit is configured to determine a predicted running state of the virtual operating system in a next time period based on the first preset number of words.
[0306] In one embodiment, the seventh determining subunit includes:
[0307] The first judging subunit is configured to judge whether there is a word with an incorrect meaning among the first preset number of words, and if so, trigger the eighth determining subunit; if not, trigger the ninth determining subunit;
[0308] an eighth determining subunit, configured to determine that a predicted running state of the virtual operating system in a next time period is an abnormal state;
[0309] The ninth determining subunit is configured to determine whether the predicted running state of the virtual operating system in the next time period is a normal state.
[0310] In one embodiment, the third monitoring unit includes:
[0311] The third acquisition subunit is configured to acquire a current operation log of the container cluster management system for each container cluster management system during monitoring of the operation status of the container cluster management system on each virtual operating system;
[0312] The third analysis subunit is configured to analyze the current operation log of the container cluster management system using a pre-established second document topic generation model combined with a Gibbs sampling method to obtain a predicted operation status of the container cluster management system in the next time period;
[0313] The second document topic generation model is established in advance by the second establishing unit using the Gibbs sampling method in combination with the historical operation log of the container cluster management system.
[0314] In one embodiment, the second establishing unit includes:
[0315] a tenth determining subunit, configured to obtain a plurality of second historical operation logs of the container cluster management system in a plurality of historical time periods;
[0316] a fourth generating subunit, configured to generate, for each historical time period, a corresponding second text based on a plurality of second historical operation logs within the historical time period;
[0317] a third assignment subunit, for randomly assigning a second topic number to each word in each second text;
[0318] a third sampling subunit, configured to perform topic resampling on each word in the second text using a Gibbs sampling method, and continuously updating a first probability distribution parameter and a second probability distribution parameter during the sampling process; wherein the first probability distribution parameter is used to calculate parameters of a probability distribution of a topic under the text, and the second probability distribution parameter is used to calculate parameters of a probability distribution of words under the topic;
[0319] an eleventh determining subunit, configured to determine, when both the first probability distribution parameter and the second probability distribution parameter converge, a final second probability distribution parameter corresponding to each second topic number;
[0320] a fifth generating subunit, configured to form a second topic word co-occurrence frequency matrix based on the final second probability distribution parameter of each second topic number, each second topic number, each word, and the probability of the word under each topic;
[0321] The twelfth determining subunit is configured to use the second topic word co-occurrence frequency matrix as a second document topic generation model.
[0322] In one embodiment, the third analysis subunit comprises:
[0323] a sixth generating subunit, configured to generate a second current running log text based on the current running log of the container cluster management system;
[0324] a fourth assignment subunit, configured to randomly assign a second topic number to each word in the second current running log file;
[0325] a fourth sampling subunit, configured to perform topic resampling on the second current operation log using a Gibbs sampling method, and update the corresponding first probability distribution parameters in combination with the second document topic generation model until the first probability distribution parameters corresponding to the second current operation log text converge, thereby obtaining a topic probability distribution under the second current operation log text;
[0326] a thirteenth determining subunit, configured to determine a second topic number with the highest probability based on the topic probability distribution under the second current running log text;
[0327] A fourteenth determining subunit is configured to obtain a second preset number of words with the highest probability corresponding to the second topic number with the highest probability based on the second topic number with the highest probability and in combination with the second document topic generation model;
[0328] The fifteenth determining subunit is configured to determine a predicted operating state of the container cluster management system in a next time period based on the first second preset number of words.
[0329] In one embodiment, the fifteenth determining subunit includes:
[0330] The second judging subunit is configured to judge whether there is a word with an incorrect meaning among the first second preset number of words, and if so, trigger the sixteenth determining subunit; if not, trigger the seventeenth determining subunit;
[0331] A sixteenth determining subunit is configured to determine that a predicted operating state of the container cluster management system in a next time period is an abnormal state;
[0332] The seventeenth determining subunit is configured to determine that the predicted operating state of the container cluster management system in the next time period is a normal state.
[0333] In one embodiment, it further includes:
[0334] The selection module is used to select a target node from other normal nodes based on the container requirement information of the container to be migrated.
[0335] In one embodiment, the container requirement information includes CPU requirements, memory requirements, network requirements, and storage resource requirements.
[0336] In one embodiment, the selection module includes:
[0337] The first selection subunit is configured to select, for each of the other normal nodes, a candidate node that meets the CPU requirements, memory requirements, network requirements, and storage resource requirements of the container to be migrated from the other normal nodes, and calculate the average resource abundance rate corresponding to the candidate node based on the remaining CPU, memory, network, and storage resource conditions of each candidate node;
[0338] The second selection subunit is used to select a candidate node with the highest average resource abundance rate from each candidate node as the target node.
[0339] In one embodiment, the determination module 12 includes:
[0340] a third determining subunit, configured to, upon determining that there is a virtual operating system whose operating state is predicted to be abnormal, determine whether the number of virtual operating systems whose operating state is predicted to be abnormal is greater than a threshold, triggering an eighteenth determining subunit if the number of virtual operating systems whose operating state is predicted to be abnormal is greater than the threshold; and triggering a nineteenth determining subunit if the number of virtual operating systems whose operating state is predicted to be abnormal is not greater than the threshold;
[0341] An eighteenth determining subunit is configured to determine all containers on the host machine as containers to be migrated;
[0342] A nineteenth determining subunit is configured to determine all containers under the virtual operating system whose preset running state is an abnormal state as containers to be migrated;
[0343] The twentieth determination sub-unit is used to, when the predicted running status of all virtual machine operating systems is normal, and there is a container cluster management system whose predicted running status is abnormal, determine the container with the abnormal status based on the log information of the container cluster management system whose predicted running status is abnormal, and use the container with the abnormal status as the container to be migrated.
[0344] In one embodiment, the transmission module 13 includes:
[0345] A snapshot unit is used to take a snapshot of the business data in the container to be migrated, generate a dump file, and transfer the dump file to the target node;
[0346] a fourth judging subunit, configured to judge whether the transmission time of the dump file is greater than a time threshold, and trigger the updating unit if the transmission time of the dump file is greater than the time threshold;
[0347] An update unit, configured to take a snapshot of the updated business data in the container to be migrated within the transfer duration, generate an update dump file, and transfer the update dump file to the target node;
[0348] The return unit is used to use the updated dump file as the dump file and return to the step of determining whether the transmission time of the dump file is greater than the time threshold, until it is less than the time threshold, the transmission is completed.
[0349] In one embodiment, it further includes:
[0350] The deletion module is used to delete the old container pod corresponding to the container to be migrated from the corresponding host machine.
[0351] It should be noted that the container migration device of the container cluster management system in the embodiment of the present application has the same beneficial effects as the container migration method of the container cluster management system provided in the above embodiment, and for the specific introduction of the container migration method of the container cluster management system involved in the embodiment of the present application, please refer to the above embodiment, and this application will not repeat it here.
[0352] FIG4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in FIG4 , the electronic device includes: a memory 20 for storing computer programs;
[0353] The processor 21 is configured to implement the steps of the container migration method of the container cluster management system in the above embodiment when executing a computer program.
[0354] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0355] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0356] The memory 20 may include one or more non-volatile readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the container migration method of the container cluster management system disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to a set offset, etc.
[0357] In some embodiments, the electronic device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0358] Those skilled in the art will appreciate that the structure shown in FIG. 4 does not limit the electronic device and may include more or fewer components than shown.
[0359] It is understandable that if the container migration method of the container cluster management system in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a non-volatile readable storage medium and executes all or part of the steps of the various embodiments of the present application. The aforementioned non-volatile readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program code.
[0360] Based on this, as shown in Figure 5, an embodiment of the present application also provides a non-volatile readable storage medium, on which a computer program 31 is stored. When the computer program 31 is executed by the processor, the steps of the container migration method of the container cluster management system as described above are implemented.
[0361] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0362] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0363] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A container migration method for a container cluster management system, characterized in that: include: Analyze the status of each running container in the cloud native system and obtain prediction results; Determine the failed container to be migrated based on the prediction result; Transferring the service data in the container to be migrated to a target node, wherein the target node is another node that is running normally; A new container pod is generated on the target node, and the service data is restored in the new container pod to generate a corresponding container.
2. The container migration method of the container cluster management system according to claim 1, characterized in that: The state of each running container in the cloud native system is analyzed to obtain prediction results, including: Monitoring the operating status of a host machine where the cloud native system is located, and determining a predicted operating status of the host machine; Monitoring the running state of each virtual operating system on the host machine, and determining the predicted running state corresponding to each virtual operating system; Monitoring the running status of the container cluster management system on each of the virtual operating systems to determine the predicted running status of the container cluster management system; A prediction result is generated based on the predicted running state of the host machine, the predicted running state corresponding to each of the virtual operating systems, and the predicted running state of the container cluster management system on each of the virtual operating systems.
3. The container migration method of the container cluster management system according to claim 2, characterized in that: Before monitoring the running status of each virtual operating system on the host machine, the method further includes: Based on the predicted running state of the host machine, it is determined whether the state of the host machine is a fault state. If the state of the host machine is a fault state, the step of monitoring the running state of each virtual operating system on the host machine is performed.
4. The container migration method of the container cluster management system according to claim 2, characterized in that: The determining whether the state of the host machine is a fault state based on the predicted running state of the host machine includes: Continuously obtaining the predicted operating status of the host machine in multiple time periods and the actual operating status of the host machine in each of the time periods; For each of the time periods, comparing the predicted operating state of the host machine in the time period with the corresponding actual operating state; Counting a first number of time periods in which the predicted operating state is different from the actual operating state; When the ratio of the first number to the total number of the time period is greater than a preset threshold, it is determined that the state of the host machine is a fault state.
5. The container migration method of the container cluster management system according to claim 2, characterized in that: The monitoring the operating status of the host machine where the cloud native system is located and determining the predicted operating status of the host machine includes: Get the running status information of the host where the cloud native system is located in the current time period; Analyze the running status information of the current time period to obtain the predicted status information of the host machine in the next time period; The predicted operating state of the host machine in the next time period is determined according to the predicted state information of the host machine in the next time period.
6. The container migration method of the container cluster management system according to claim 5, characterized in that: The step of determining the predicted operating state of the host machine in the next time period according to the predicted state information of the host machine in the next time period includes: Obtain predicted values of various state parameters according to the predicted state information of the host machine in the next time period; Comparing the predicted values of each type of state parameter with the corresponding normal threshold value; When the predicted value of at least one type of state parameter is greater than the corresponding normal threshold, determining that the predicted operating state of the host machine in the next time period is an abnormal state; When the predicted values of each type of the state parameters do not exceed the corresponding normal threshold value, it is determined that the predicted operating state of the host machine in the next time period is a normal state.
7. The container migration method of the container cluster management system according to claim 5, characterized in that: The operation status information includes one or more combinations of central processing unit utilization, memory utilization, network bandwidth utilization, and storage disk utilization.
8. The container migration method of the container cluster management system according to claim 5, characterized in that: The analyzing the operation status information of the current time period to obtain the predicted status information of the host machine in the next time period includes: Using a pre-established state prediction neural network model to analyze the operating state information of the current time period to obtain a predicted operating state of the host machine in the next time period; Among them, the state prediction neural network model is obtained by training a deep learning network based on a time series analysis method and combining the historical operating state information of the host machine.
9. The container migration method of the container cluster management system according to claim 8, characterized in that: The training process of the state prediction neural network model includes: Obtaining the operating status information of the host machine in multiple historical time periods; The deep learning network is trained using a time series analysis method and the operation status information of the plurality of historical time periods, and the network parameters are updated during the training process until the loss function converges to determine the final network parameters; A trained state prediction neural network model is obtained based on the final network parameters.
10. The container migration method of the container cluster management system according to claim 2, characterized in that: The monitoring the running state of each virtual operating system on the host machine and determining the predicted running state corresponding to each virtual operating system respectively includes: In the process of monitoring the running status of each virtual operating system on the host machine, for each virtual machine operating system, obtaining the current running log of the virtual machine operating system; The pre-established first document topic generation model is used in combination with the Gibbs sampling method to analyze the current operation log of the virtual machine operating system to obtain the predicted operation state of the virtual operating system in the next time period; The first document topic generation model is established in advance by using the Gibbs sampling method in combination with the historical operation log of the virtual machine operating system.
11. The container migration method of the container cluster management system according to claim 10, characterized in that: The process of establishing the first document topic generation model includes: Acquire a plurality of first historical operation logs of the virtual machine operating system in a plurality of historical time periods; For each historical time period, generating a corresponding first text based on a plurality of first historical operation logs within the historical time period; For each first text, randomly assign a first topic number to each word in the first text; The Gibbs sampling method is used to perform topic resampling on each word in the first text, and the first probability distribution parameter and the second probability distribution parameter are continuously updated during the sampling process; wherein the first probability distribution parameter is used to calculate Parameters of probability distribution of topics under the text, wherein the second probability distribution parameters are used to calculate parameters of probability distribution of words under the topic; When both the first probability distribution parameter and the second probability distribution parameter converge, determine the final second probability distribution parameter corresponding to each first topic number; Forming a first topic word co-occurrence frequency matrix based on the final second probability distribution parameter of each first topic number, each first topic number, each word, and the probability of the word under each topic; The first topic word co-occurrence frequency matrix is used as a first document topic generation model.
12. The container migration method of the container cluster management system according to claim 11, characterized in that: The method of using the pre-established first document topic generation model in combination with the Gibbs sampling method to analyze the current operation log of the virtual machine operating system to obtain the predicted operation state of the virtual operating system in the next time period includes: Generate a first current operation log text based on the current operation log of the virtual machine operating system; Randomly assigning a first topic number to each word in the first current running log file; The Gibbs sampling method is used to perform topic resampling on the first current operation log, and the corresponding first probability distribution parameters are updated in combination with the first document topic generation model until the first probability distribution parameters corresponding to the first current operation log text converge, thereby obtaining the topic probability distribution under the first current operation log text; Determine a first topic number with the highest probability based on the topic probability distribution under the first current running log text; Based on the first topic number with the highest probability and the first document topic generation model, obtaining a first preset number of words with the highest probability corresponding to the first topic number with the highest probability; Based on the first preset number of words, a predicted running state of the virtual operating system in a next time period is determined.
13. The container migration method of the container cluster management system according to claim 12, characterized in that: The step of determining the predicted running state of the virtual operating system in the next time period based on the first preset number of words includes: Determine whether there is a word with an erroneous meaning among the first preset number of words. If so, determine that the predicted operating state of the virtual operating system in the next time period is an abnormal state; if not, determine that the predicted operating state of the virtual operating system in the next time period is a normal state.
14. The container migration method of the container cluster management system according to claim 2, characterized in that: Monitoring the running state of the container cluster management system on each of the virtual operating systems to determine the predicted running state of the container cluster management system includes: In the process of monitoring the running status of the container cluster management system on each of the virtual operating systems, for each container cluster management system, obtaining the current running log of the container cluster management system; The current operation log of the container cluster management system is analyzed by using a pre-established second document topic generation model combined with a Gibbs sampling method to obtain a predicted operation state of the container cluster management system in the next time period; The second document topic generation model is established in advance by using the Gibbs sampling method in combination with the historical operation log of the container cluster management system.
15. The container migration method of the container cluster management system according to claim 14, characterized in that: The process of establishing the second document topic generation model includes: Acquire multiple second historical operation logs of the container cluster management system in multiple historical time periods; For each historical time period, generating a corresponding second text based on a plurality of second historical operation logs within the historical time period; For each second text, randomly assigning a second topic number to each word in the second text; Using Gibbs sampling method to perform topic resampling on each word in the second text, and continuously updating the first probability distribution parameter and the second probability distribution parameter during the sampling process; wherein the first probability distribution parameter is used to calculate the parameters of the probability distribution of the topic under the text, and the second probability distribution parameter is used to calculate the parameters of the probability distribution of the word under the topic; When both the first probability distribution parameter and the second probability distribution parameter converge, determine a final second probability distribution parameter corresponding to each second topic number; Forming a second topic word co-occurrence frequency matrix based on the final second probability distribution parameter of each second topic number, each second topic number, each word, and the probability of the word under each topic; The second topic word co-occurrence frequency matrix is used as a second document topic generation model.
16. The container migration method of the container cluster management system according to claim 15, characterized in that: The method of using the pre-established second document topic generation model in combination with the Gibbs sampling method to analyze the current operation log of the container cluster management system to obtain the predicted operation state of the container cluster management system in the next time period includes: Generate a second current operation log text based on the current operation log of the container cluster management system; Randomly assigning a second topic number to each word in the second current running log file; The Gibbs sampling method is used to perform topic resampling on the second current operation log, and the corresponding first probability distribution parameters are updated in combination with the second document topic generation model until the first probability distribution parameters corresponding to the second current operation log text converge, thereby obtaining the topic probability distribution under the second current operation log text; Determine a second topic number with the highest probability based on the topic probability distribution under the second current running log text; Based on the second topic number with the highest probability and the second document topic generation model, obtain the first second preset number of words with the highest probability corresponding to the second topic number with the highest probability; Based on the first second preset number of words, a predicted operating state of the container cluster management system in a next time period is determined.
17. The container migration method of the container cluster management system according to claim 16, characterized in that: The step of determining the predicted operating state of the container cluster management system in the next time period based on the first second preset number of words includes: It is determined whether there is a word with an erroneous meaning among the first second preset number of words. If so, it is determined that the predicted operating state of the container cluster management system in the next time period is an abnormal state; if not, it is determined that the predicted operating state of the container cluster management system in the next time period is a normal state.
18. The container migration method of the container cluster management system according to claim 1, characterized in that: Before the business data in the container to be migrated is transferred to the target node, the method further includes: A target node is selected from other normal nodes based on the container requirement information of the container to be migrated.
19. The container migration method of the container cluster management system according to claim 18, characterized in that: The container requirement information includes CPU requirement, memory requirement, network requirement and storage resource requirement.
20. The container migration method of the container cluster management system according to claim 19, characterized in that: The selecting a target node from other normal nodes based on the container requirement information of the container to be migrated includes: For each normal node among the other normal nodes, a candidate node that meets the requirements is selected from the other normal nodes according to the CPU requirements, memory requirements, network requirements, and storage resource requirements of the container to be migrated, and the average resource abundance rate corresponding to the candidate node is calculated in combination with the remaining CPU conditions, remaining memory conditions, remaining network conditions, and remaining storage resource conditions of each candidate node; A candidate node with the highest average resource abundance rate is selected from each of the candidate nodes as the target node.
21. The container migration method of the container cluster management system according to any one of claims 2 to 20, characterized in that: The step of determining the failed container to be migrated according to the prediction result includes: When it is determined that there is a virtual operating system whose predicted running state is an abnormal state, it is determined whether the number of virtual operating systems whose predicted running state is an abnormal state is greater than a threshold value, and if the number of virtual operating systems whose predicted running state is an abnormal state is greater than the threshold value, all containers under the host machine are determined as containers to be migrated; if the number of virtual operating systems whose predicted running state is an abnormal state is not greater than the threshold value, all containers under the virtual operating system whose preset running state is an abnormal state are determined as containers to be migrated; When the predicted running status of all virtual machine operating systems is normal, and there is a container cluster management system whose predicted running status is abnormal, the container with the abnormal status is determined according to the log information of the container cluster management system whose predicted running status is abnormal, and the container with the abnormal status is used as the container to be migrated.
22. The container migration method of the container cluster management system according to any one of claims 1 to 20, characterized in that: The transferring the service data in the container to be migrated to the target node includes: Taking a snapshot of the business data in the container to be migrated, generating a dump file, and transmitting the dump file to the target node; Determine whether the transmission time of the dump file is greater than a time threshold. If the transmission time of the dump file is greater than the time threshold, take a snapshot of the updated service data updated in the container to be migrated within the transmission time, generate an updated dump file, and transmit the updated dump file to the target node. The updated dump file is used as the dump file, and the step of determining whether the transmission time of the dump file is greater than a time threshold is returned to be executed, until the transmission is completed when the transmission time is less than the time threshold.
23. The container migration method of the container cluster management system according to claim 22, characterized in that: After generating a new container pod on the target node and restoring the service data in the new container pod to generate a corresponding container, the method further includes: The old container pod corresponding to the container to be migrated is deleted from the corresponding host machine.
24. A container migration device for a container cluster management system, characterized in that: include: The analysis module is used to analyze the status of each running container in the cloud native system and obtain prediction results; A determination module, used to determine a failed container to be migrated according to the prediction result; A transmission module, used to transmit the service data in the container to be migrated to a target node, wherein the target node is another node that is operating normally; A generation module is used to generate a new container pod on the target node, and to restore the business data in the new container pod to generate a corresponding container.
25. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the container cluster management system according to any one of claims 1 to 23 when executing the computer program. The steps of the container migration method for the management system.
26. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the container migration method of the container cluster management system according to any one of claims 1 to 23 are implemented.
Citation Information
Patent Citations
Container migration method, source node and target node
CN115509681A
Automatic migration method and device of server container instance
CN116089005A
Container migration method and device of container cluster management system, equipment and medium
CN116668271A
Machine learning to predict container failure for data transactions in distributed computing environment
US11550672B1
Cited By
Server data supervision method and electronic equipment
CN120849222A
Data monitoring method of a server and electronic device
CN120849222B
Deep learning training task state monitoring method and device, equipment and medium
CN121328778A
Distributed collaboration-based containerized gap atom service operation method
CN121984916A