A pod rollback version determination method and device, electronic equipment and storage medium
By using a Bayesian version selection model in the Kubernetes cluster, the Pod rollback version is automatically determined, which solves the anomaly caused by version conflicts and achieves efficient and accurate version rollback and fault repair.
Patent Information
- Application Number
- CN202210709920.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-06-22
AI Technical Summary
In Kubernetes clusters, version conflicts can cause anomalies when rolling back Pod versions. Current technologies rely on manual experience to resolve these issues, which is inefficient.
A Bayesian version selection model is adopted, which is divided into a primary classification sub-model and a secondary classification sub-model. The version selection probability obtained by training is used to automatically determine the rollback version. The code is compared and corrected by combining the mirror database and the historical function library.
It improves the efficiency and accuracy of Pod version rollback, can intelligently and automatically fix version conflict issues, reduce manual intervention, and ensure high availability of the cluster.
Smart Images

Figure CN115167976B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a Pod rollback version determination method and device, electronic equipment and storage medium. BACKGROUND
[0002] A Kubernetes cluster is used to manage containerized applications on multiple hosts in a cloud platform. The Kubernetes cluster mainly includes three objects, namely a master node, a node and a Pod. The master node is a machine that controls the Kubernetes node and is also a place where a job task is created. The node executes the assigned task under the control of the master node. The Pod is a collection of one or more containers, which is deployed as a whole to a single node.
[0003] In the related art, there are multiple versions of a Pod. During the uploading process of the Pod code, the current version of the Pod code may conflict with the previous version of the Pod code. At this time, the master node defaults to rolling back the current version to the previous version. However, due to the conflict between the current version and the previous version, the version rollback is abnormal. At this time, the version rollback problem can only be manually solved by relying on human experience, resulting in low version rollback efficiency. SUMMARY
[0004] To solve the above technical problems, the present application provides a Pod rollback version determination method, device, electronic equipment and storage medium.
[0005] In a first aspect, an embodiment of the present application provides a Pod rollback version determination method, which comprises:
[0006] When the current version of the Pod code does not match the previous version of the Pod code, input the file information of the current version of the Pod in the image database into a pre-trained version selection model. The version selection model includes a first classification sub-model and a second classification sub-model. The first classification sub-model is trained based on the first classification data and the first classification version selection probability in the abnormal rollback history data of the historical version of the Pod. The second classification sub-model is trained based on the second classification data and the second classification version selection probability in the abnormal rollback history data of the historical version of the Pod. The second classification data is the sub-data of the first classification data.
[0007] Through the first classification sub-model, the first classification version selection probability corresponding to the current version is obtained, and through the second classification sub-model, the second classification version selection probability corresponding to the current version is obtained.
[0008] determine version selection probabilities of each version corresponding to the current version based on the primary classification version selection probability and the secondary classification version selection probability;
[0009] determine a target rollback version corresponding to the current version based on the determined version selection probabilities of each version.
[0010] Optionally, the process of training the version selection model comprises:
[0011] obtain abnormal rollback history data of a historical version of the Pod;
[0012] determine primary classification data in the abnormal rollback history data, the primary classification data comprising middleware types, plug-in types and database types;
[0013] calculate primary classification version selection probabilities corresponding to the middleware types, the plug-in types and the database types respectively, the primary classification version selection probabilities being determined based on a total number of abnormal rollback history data alarms of the Pod, a number of false alarms of the abnormal rollback history data alarms of the Pod, and a number of alarms corresponding to each type of primary classification data in the total number of abnormal rollback history data alarms of the Pod;
[0014] train a primary classification sub-model based on the middleware types and the primary classification version selection probabilities corresponding to the middleware types, the plug-in types and the primary classification version selection probabilities corresponding to the plug-in types, and the database types and the primary classification version selection probabilities corresponding to the database types, to obtain a trained primary classification sub-model;
[0015] determine secondary classification data in the abnormal rollback history data, the secondary classification data comprising middleware sub-types corresponding to the middleware types, plug-in sub-types corresponding to the plug-in types, and database sub-types corresponding to the database types;
[0016] calculate secondary classification version selection probabilities corresponding to the middleware sub-types, the plug-in sub-types and the database sub-types respectively, the secondary classification version selection probabilities being determined based on a total number of secondary classification data alarms in the abnormal rollback history data of the Pod, a number of false alarms of the secondary classification data alarms in the abnormal rollback history data of the Pod, and a number of alarms corresponding to each type of secondary classification data in the total number of abnormal rollback history data alarms of the Pod;
[0017] train a secondary classification sub-model based on the middleware sub-types and the secondary classification version selection probabilities corresponding to the middleware sub-types, the plug-in sub-types and the secondary classification version selection probabilities corresponding to the plug-in sub-types, and the database sub-types and the secondary classification version selection probabilities corresponding to the database sub-types, to obtain a trained secondary classification sub-model.
[0018] Optionally, the method further comprises:
[0019] By running the exception detection program, the image database data corresponding to each Pod is obtained, the image database data including file information of each version of each Pod;
[0020] Based on the image database data corresponding to each Pod, an exception source causing the Pod code of the current version to be unmatched with the Pod code of the previous version is determined, wherein the exception source includes at least one of middleware type, database type and plug-in type.
[0021] Optionally, the method further comprises:
[0022] Determining a sub-exception source corresponding to the exception source, the sub-exception source including at least one of a middleware sub-type, a database sub-type and a plug-in sub-type;
[0023] In the pre-stored historical function library, a target historical function library corresponding to the sub-exception source is searched;
[0024] By executing the target historical function library, the Pod code of the target rollback version is compared with the Pod code of the current version to obtain a target Pod code, the target Pod code being a Pod code existing version mismatch between the current version and the target version;
[0025] The target Pod code is subjected to correction processing to obtain a corrected Pod code;
[0026] The corrected Pod code is tested in the current Pod environment, and after the test is passed, the corrected Pod code is uploaded in the Pod.
[0027] Optionally, the determining of the version selection probability of each version corresponding to the current version based on the first-level classification version selection probability and the second-level classification version selection probability comprises:
[0028] For each version, the first-level classification version selection probability and the second-level classification version selection probability corresponding to the version are weighted and summed to obtain the version selection probability of the version;
[0029] Correspondingly, the determining of the target rollback version corresponding to the current version based on the determined version selection probability of each version comprises:
[0030] Based on the version selection probability of each version, all versions are sorted, and a version with a sorting serial number less than a preset serial number is determined as the target rollback version corresponding to the current version.
[0031] In a second aspect, the embodiments of the present application provide a Pod rollback version determination apparatus, which comprises:
[0032] An information input module is configured to input file information of a Pod of a current version in an image database into a pre-trained version selection model when the Pod code of the current version does not match the Pod code of a previous version.
[0033] A version selection probability acquisition module is configured to obtain a first-level classification version selection probability corresponding to the current version through the first-level classification sub-model, and obtain a second-level classification version selection probability corresponding to the current version through the second-level classification sub-model.
[0034] A version selection probability determination module is configured to determine version selection probabilities of each version corresponding to the current version based on the first-level classification version selection probability and the second-level classification version selection probability.
[0035] A rollback version determination module is configured to determine a target rollback version corresponding to the current version based on the determined version selection probabilities of each version.
[0036] Optionally, the apparatus further comprises a version selection model training module, which is configured to:
[0037] Obtain abnormal rollback history data of a historical version of a Pod.
[0038] Determine first-level classification data in the abnormal rollback history data, wherein the first-level classification data comprises middleware types, plug-in types and database types.
[0039] Calculate first-level classification version selection probabilities corresponding to the middleware types, the plug-in types and the database types respectively, wherein the first-level classification version selection probabilities are determined based on a total number of abnormal rollback history data alarms of the Pod, a false alarm number of the abnormal rollback history data alarms of the Pod, and an alarm number corresponding to each first-level classification data in the total number of abnormal rollback history data alarms of the Pod.
[0040] The first-class classification sub-model is trained based on the middleware type and the first-class classification version selection probability corresponding to the middleware type, the plug-in type and the first-class classification version selection probability corresponding to the plug-in type, and the database type and the first-class classification version selection probability corresponding to the database type, to obtain the trained first-class classification sub-model.
[0041] Second-class classification data is determined in the abnormal rollback history data, and the second-class classification data includes a middleware sub-type corresponding to the middleware type, a plug-in sub-type corresponding to the plug-in type, and a database sub-type corresponding to the database type.
[0042] Second-class classification version selection probabilities corresponding to the middleware sub-type, the plug-in sub-type and the database sub-type are calculated, and the second-class classification version selection probability is determined based on the total number of alarms of the second-class classification data in the abnormal rollback history data of the Pod, the number of false alarms of the second-class classification data in the abnormal rollback history data of the Pod, and the number of alarms corresponding to each second-class classification data in the total number of alarms of the abnormal rollback history data of the Pod.
[0043] The second-class classification sub-model is trained based on the middleware sub-type and the second-class classification version selection probability corresponding to the middleware sub-type, the plug-in sub-type and the second-class classification version selection probability corresponding to the plug-in sub-type, and the database sub-type and the second-class classification version selection probability corresponding to the database sub-type, to obtain the trained second-class classification sub-model.
[0044] Optionally, the device further comprises:
[0045] The data acquisition module is configured to acquire image database data corresponding to each Pod by running an abnormality detection program, wherein the image database data includes file information of each version of each Pod.
[0046] The abnormal source determination module is configured to determine an abnormal source causing the Pod code of the current version to be inconsistent with the Pod code of the previous version based on the image database data corresponding to each Pod, wherein the abnormal source includes at least one of a middleware type, a database type and a plug-in type.
[0047] Optionally, the device further comprises:
[0048] The sub-abnormal source determination module is configured to determine a sub-abnormal source corresponding to the abnormal source, wherein the sub-abnormal source includes at least one of a middleware sub-type, a database sub-type and a plug-in sub-type.
[0049] The historical function library searching module is configured to search for a target historical function library corresponding to the sub-abnormal source in a pre-stored historical function library.
[0050] a code comparison module, configured to compare the Pod code of the target rollback version with the Pod code of the current version by executing the target historical function library, to obtain target Pod code, the target Pod code being Pod code that has version mismatch between the current version and the target version;
[0051] a code repair module, configured to correct the target Pod code, to obtain corrected Pod code;
[0052] a code test module, configured to test the corrected Pod code in a current Pod environment, and upload the corrected Pod code to the Pod after the test is passed.
[0053] Optionally, the version selection probability determination module is specifically configured to:
[0054] for each version, perform weighted summation on the first-class classification version selection probability and the second-class classification version selection probability corresponding to the version, to obtain the version selection probability of the version;
[0055] Correspondingly, the rollback version determination module is specifically configured to:
[0056] sort all versions based on the version selection probability of each version, and determine a version with a sorting serial number less than a preset serial number as the target rollback version corresponding to the current version.
[0057] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the Pod rollback version determination method in the first aspect when executing the program.
[0058] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executable on a processor to implement the steps of the Pod rollback version determination method in the first aspect.
[0059] The technical scheme provided in the embodiments of the present application is that when the current version of Pod code does not match the previous version of Pod code, the file information of the current version of Pod in the image database is input into a version selection model pre-trained; the version selection model includes a first classification sub-model and a second classification sub-model; through the first classification sub-model, a first classification version selection probability corresponding to the current version is obtained, and through the second classification sub-model, a second classification version selection probability corresponding to the current version is obtained; based on the first classification version selection probability and the second classification version selection probability, a version selection probability of each version corresponding to the current version is determined; and based on the determined version selection probability of each version, a target rollback version corresponding to the current version is determined.
[0060] It can be seen that by using the technical scheme provided in the embodiments of the present application, the version selection model is used to replace the manual rollback version selection method, which can more intelligently improve the efficiency of determining the rollback version, and the version selection model is divided into two parts, namely the first classification sub-model and the second classification sub-model, the first classification sub-model realizes coarse classification of the rollback version selection, the second classification sub-model realizes fine classification of the rollback version selection, and through the first classification version selection probability and the second classification version selection probability, the version selection probability of each version corresponding to the current version is determined, which can make the rollback version determined by the version selection model more accurate and closer to the truth. BRIEF DESCRIPTION OF DRAWINGS
[0061] Figure 1 is a step flowchart of a Pod rollback version determination method provided by the embodiments of the present application;
[0062] Figure 2 is a specific implementation of training a version selection model provided by the embodiments of the present application;
[0063] Figure 3 is a step flowchart of another Pod rollback version determination method provided by the embodiments of the present application;
[0064] Figure 4 is a schematic diagram of the complete technical scheme of the embodiments of the present application;
[0065] Figure 5 is a structural block diagram of a Pod rollback version determination apparatus according to the embodiments of the present application;
[0066] Figure 6 is a structural block diagram of an electronic device according to the embodiments of the present application. DETAILED DESCRIPTION
[0067] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0068] A Kubernetes cluster is used to manage containerized applications on multiple hosts in a cloud platform. The cluster of Kubernetes mainly includes three objects, namely a master node, a node and a Pod. The master node is a machine for controlling Kubernetes nodes and is also a place for creating job tasks. The node executes the assigned tasks under the control of the master node. The Pod is a collection of one or more containers, which is deployed as a whole to a single node.
[0069] In the related art, there are multiple versions of the Pod. During the uploading process of the Pod code, the current version of the Pod code may conflict with the previous version of the Pod code. At this time, the master node defaults to rolling back the current version to the previous version. However, due to the conflict between the current version and the previous version, the version rollback is abnormal. At this time, the version rollback problem can only be solved manually by experience, which leads to low efficiency of version rollback.
[0070] To solve the above technical problems, the embodiment of the present application provides a Pod rollback version determination method, device, electronic equipment and storage medium.
[0071] In the first aspect, a Pod rollback version determination method provided by the embodiment of the present application is first described in detail.
[0072] It should be noted that the execution subject of the Pod rollback version determination method provided by the embodiment of the present application can be a cluster management server. The cluster management server is constructed based on a Kubernetes cluster. A Kubernetes cluster mainly includes three objects, namely a Master (master node), a Node (node) and a Pod.
[0073] The Master (master node) is a machine for controlling Kubernetes nodes and is also a place for creating job tasks.
[0074] The Node (node) is used to execute the assigned tasks under the control of the master node.
[0075] The Pod runs in the node (node) and is a collection of one or more containers, which is deployed as a whole to a single Node (node). The containers in the same pod share IP addresses, inter-process communication (IPC), host names and other resources. The Pod abstracts the network and storage of the underlying container, making it more convenient for container migration within the cluster.
[0076] The master stores an image database of all versions of all pods and a history function library. The master manages the version settings and fallback mechanisms of the pods through a configuration file. The fallback mechanism is to automatically fallback to the previous version when the current version of the pod abnormally.
[0077] The image database is used to collect and store file information of each version of the pod.
[0078] The history function library is used to collect and store the development environment middleware, plug-ins, and component development languages and script languages of each updated version of the pod.
[0079] The embodiment of the application provides a pod fallback version determination method, as shown in Figure 1 The method can include the following steps:
[0080] S110, when the current version of the pod code does not match the previous version of the pod code, inputting the file information of the current version of the pod in the image database into a pre-trained version selection model.
[0081] The version selection model includes a first classification sub-model and a second classification sub-model. The first classification sub-model is trained based on first classification data and first classification version selection probability in the abnormal fallback history data of the historical version of the pod. The second classification sub-model is trained based on second classification data and second classification version selection probability in the abnormal fallback history data of the historical version of the pod. The second classification data is sub-data of the first classification data.
[0082] Specifically, to replace the manual selection of the fallback version in the related art and improve the efficiency of determining the fallback version more intelligently, the embodiment of the application uses a Bayesian-based version selection model to replace the manual selection of the fallback version. When the current version of the pod code does not match the previous version of the pod code, i.e., when the current version of the pod code conflicts with the previous version of the pod code, the file information of the current version of the pod in the image database is input into a pre-trained version selection model. The file information of the current version of the pod in the image database includes first classification data and second classification data.
[0083] In addition, to make the fallback version determined by the version selection model more accurate and closer to the truth, the version selection model is divided into two parts, i.e., a first classification sub-model and a second classification sub-model.
[0084] The first-class classification sub-model is trained based on first-class classification data and first-class classification version selection probability in the abnormal rollback history data of the historical version of the Pod, wherein the first-class classification data can include middleware type, plug-in type and database type. Each first-class classification data corresponds to a first-class classification version selection probability.
[0085] The second-class classification sub-model is trained based on second-class classification data and second-class classification version selection probability in the abnormal rollback history data of the historical version of the Pod, wherein the second-class classification data can include: middleware sub-type corresponding to the middleware type, plug-in sub-type corresponding to the plug-in type and database sub-type corresponding to the database type. Each second-class classification data corresponds to a second-class classification version selection probability.
[0086] In order to clearly describe the scheme, the specific training process of the first-class classification data, the second-class classification data, the first-class classification version selection probability and the second-class classification version selection probability, and the first-class classification sub-model and the second-class classification sub-model will be described in detail in the following embodiments.
[0087] In S120, the first-class classification version selection probability corresponding to the current version is obtained by the first-class classification sub-model, and the second-class classification version selection probability corresponding to the current version is obtained by the second-class classification sub-model.
[0088] Specifically, the first-class classification data in the file information of the current version of the Pod can be input into the first-class classification sub-model, and the first-class classification sub-model outputs the first-class classification version selection probability corresponding to the current version. And the second-class classification data in the file information of the current version of the Pod can be input into the second-class classification sub-model to obtain the second-class classification version selection probability corresponding to the current version.
[0089] In S130, the version selection probability of each version corresponding to the current version is determined based on the first-class classification version selection probability and the second-class classification version selection probability.
[0090] Specifically, after obtaining the first-class classification version selection probability and the second-class classification version selection probability, the high availability characteristics of the cluster are considered, that is, when any Pod in the cluster fails, all tasks on the Pod can be automatically transferred to other normal Pods, and this process does not affect the operation of the entire cluster and does not affect the provision of business. This is because many Pods use the same environment, which provides a theoretical basis and feasibility for determining the version selection probability of each version corresponding to the current version based on the first-class classification version selection probability and the second-class classification version selection probability, thereby obtaining the final rollback version selection probability. That is, the first-class classification version selection probability and the second-class classification version selection probability can be combined to obtain the version selection probability of each version corresponding to the current version, so as to accurately determine the version selection probability of each version.
[0091] In actual application, in an embodiment, based on the primary classification version selection probability and the secondary classification version selection probability, determining the version selection probability of each version corresponding to the current version can include the following steps:
[0092] For each version, the primary classification version selection probability and the secondary classification version selection probability corresponding to the version are weighted and summed to obtain the version selection probability of the version.
[0093] For example, the primary classification database version selection probability output from the primary classification sub-model is 60%, and the mysql version selection probability output from the secondary classification sub-model is 80%, then the probability of the current version selecting the mysql version is (60%+80%) / 2=70%. In this example, the primary classification version selection probability and the secondary classification version selection probability are averaged to obtain the version selection probability of the version. In actual application, the weighting coefficient can be determined according to actual conditions, and the embodiment of the present application is not limited specifically.
[0094] S140, based on the determined version selection probability of each version, determining the target rollback version corresponding to the current version.
[0095] Specifically, if the version selection probability of a version is large, it means that the possibility of the current version selecting the version is large, and therefore the version is determined as the target rollback version corresponding to the current version. If the version selection probability of a version is small, it means that the possibility of the current version selecting the version is small, and therefore the version is not determined as the target rollback version corresponding to the current version.
[0096] In an embodiment, based on the determined version selection probability of each version, determining the target rollback version corresponding to the current version can include the following steps:
[0097] Based on the version selection probability of each version, all versions are sorted, and the versions with a sorting serial number less than a preset serial number are determined as the target rollback version corresponding to the current version.
[0098] Specifically, after the version selection probability of each version is calculated, the version selection probability of each version is sorted, and the version selection probability of the version at the front of the sorting is high, and therefore the version at the front of the sorting is determined as the target rollback version.
[0099] The technical scheme provided in the embodiments of the present application is that when the current version of Pod code does not match the previous version of Pod code, the file information of the current version of Pod in the image database is input into the version selection model pre-trained; the version selection model includes a first classification sub-model and a second classification sub-model; through the first classification sub-model, the first classification version selection probability corresponding to the current version is obtained, and through the second classification sub-model, the second classification version selection probability corresponding to the current version is obtained; based on the first classification version selection probability and the second classification version selection probability, the version selection probability of each version corresponding to the current version is determined; and based on the determined version selection probability of each version, the target rollback version corresponding to the current version is determined.
[0100] It can be seen that, by using the technical scheme provided in the embodiments of the present application, the version selection model is used to replace the manual method of selecting a rollback version, which can more intelligently improve the efficiency of determining a rollback version, and the version selection model is divided into two parts, i.e., the first classification sub-model and the second classification sub-model, the first classification sub-model realizes coarse classification of the rollback version selection, the second classification sub-model realizes fine classification of the rollback version selection, and through the first classification version selection probability and the second classification version selection probability, the version selection probability of each version corresponding to the current version is determined, which can make the rollback version determined by the version selection model more accurate and closer to the truth.
[0101] In order to clearly describe the scheme, the training process of the version selection model will be described in detail in the following embodiments.
[0102] As shown in Figure 2 , the process of training the version selection model includes:
[0103] S210, obtaining abnormal rollback history data of a historical version of Pod.
[0104] Specifically, the Master (master node) in the Kubernetes cluster manages the business of all Pods, and the image database on the Master (master node) stores the abnormal rollback history data of the historical version of Pod.
[0105] S220, determining first classification data in the abnormal rollback history data.
[0106] The first classification data includes middleware types, plug-in types and database types.
[0107] Specifically, when training the first classification sub-model, the first classification data needs to be obtained, and the first classification data includes three categories of data, i.e., middleware types, plug-in types and database types. These three categories of data are the training data of the first classification sub-model.
[0108] S230, calculate the first-class classification version selection probability corresponding to the middleware type, the plug-in type and the database type respectively.
[0109] S240, train the first-class classification sub-model based on the middleware type and the first-class classification version selection probability corresponding to the middleware type, the plug-in type and the first-class classification version selection probability corresponding to the plug-in type, and the database type and the first-class classification version selection probability corresponding to the database type, to obtain the trained first-class classification sub-model.
[0110] The first-class classification version selection probability is determined based on the total number of abnormal rollback history data alarms of the Pod, the number of false alarms of the abnormal rollback history data alarms of the Pod, and the number of alarms corresponding to each first-class classification data in the total number of abnormal rollback history data alarms of the Pod.
[0111] Specifically, after determining the middleware type, the plug-in type and the database type as the training data, the prior probability, the conditional probability, the adjustment factor, the posterior probability and other parameters corresponding to the three types of data can be calculated respectively.
[0112] The prior probability is the total number of Pod abnormal rollback alarm data / the total number of Pod rollback data.
[0113] The conditional probability is the training conditional probability obtained by counting the total number of data of the Pod after the abnormal rollback alarm is classified according to the middleware type, the plug-in type and the database type.
[0114] The adjustment factor is the number of false alarms of the abnormal rollback history data alarms of the Pod / the prior probability.
[0115] The posterior probability=prior probability x adjustment factor.
[0116] The first-class classification sub-model is obtained by putting the above parameters into the model.
[0117] Specifically, the mathematical formula of the model parameters of the first-class classification sub-model is:
[0118] Master(D|+) = Master(+|D) Master(D) / (Master(+|D) Master(D) + Master(+|N) Master(N))
[0119] The mathematical formula of the model parameters of the first-class classification sub-model can be described as: Master(+|D) x adjustment factor.
[0120] Where D = the reasonable probability of a Pod abnormal rollback alarm. / represents division. Master is the probability that historical alarm data from Pod abnormal rollback is close to the truth, without considering the false positive rate. Master(D|+) is the probability that historical alarm data from Pod abnormal rollback is close to the truth, considering the false positive rate. Master(+|D) represents the accuracy of Pod abnormal rollback, i.e., prior probability = 1 - false positive rate. For example, if the false positive rate of middleware type alarm data categorized by Pod abnormal rollback is 1%, then Master(+|D)1 - 0.01 = 0.99. Master(+|N) represents the false positive rate of Pod abnormal rollback alarm data, which can be calculated as: number of false positives for Pod abnormal rollback alarms / total number of Node alarms. Master(N) represents the reasonable probability of the current Pod abnormal rollback alarm, which is 1 - Master(D).
[0121] The above parameters are fed into the training of the first-level classification sub-model to obtain the analysis results, namely the first-level classification version selection probability. This completes the construction and training of the first-level classification sub-model.
[0122] S250, Identify secondary category data from historical data of abnormal rollback.
[0123] The secondary classification data includes middleware subtypes corresponding to middleware types, plugin subtypes corresponding to plugin types, and database subtypes corresponding to database types.
[0124] Specifically, when training a secondary classification sub-model, it is necessary to obtain secondary classification data, which includes three sub-types: middleware sub-type, plugin sub-type, and database sub-type. These three sub-types of data are the training data for the secondary classification sub-model.
[0125] The middleware subtype can be web server software such as Apache, Tomcat, and Resin; the plugin subtype can be development languages or scripts such as jQuery, PHP, Python, Java, C++, C, VB, VC, Delphin, and HTML5; the database type can be MySQL, SQL Server, Oracle, MongoDB, RRD, SQLite, DB2, Azure SQL Database, BigQuery, domestic databases such as DM, GBase, ShenTong Database, Kingbase, and Inspur K-DB. This application does not specifically limit the middleware subtype, plugin subtype, and database subtype in its embodiments.
[0126] S260, calculate the probability of selecting the secondary category version for each of the middleware subtype, plugin subtype, and database subtype.
[0127] The secondary classification version selection probability is determined based on the total number of alarms of the secondary classification data in the abnormal rollback history data of the Pod, the number of false alarms of the secondary classification data in the abnormal rollback history data of the Pod, and the number of alarms corresponding to each secondary classification data in the total number of alarms in the abnormal rollback history data of the Pod.
[0128] S270, based on the middleware sub-type and the secondary classification version selection probability corresponding to the middleware sub-type, the plug-in sub-type and the secondary classification version selection probability corresponding to the plug-in sub-type, and the database sub-type and the secondary classification version selection probability corresponding to the database sub-type, training the secondary classification sub-model to obtain the trained secondary classification sub-model.
[0129] Specifically, after obtaining the middleware sub-type, the plug-in sub-type and the database sub-type, the prior probability, the conditional probability, the adjustment factor, the posterior probability and other parameters required by the secondary classification sub-model can be obtained. The related parameters are described as follows:
[0130] The prior probability is the total number of alarm data of the specific analysis object of the Pod abnormal rollback / / the total number of Pod rollback data, wherein the specific analysis object can be any one of the middleware sub-type, the plug-in sub-type and the database sub-type.
[0131] The conditional probability is the total number of alarm data of the Pod after the specific analysis object classification, and the conditional probability of this training is obtained by statistics.
[0132] The adjustment factor = the number of false alarms of the specific analysis object of the Pod abnormal rollback history data / the prior probability.
[0133] The posterior probability = the prior probability x the adjustment factor.
[0134] The secondary classification sub-model is obtained by putting the above parameters into the model.
[0135] The mathematical formula of the model parameters of the secondary classification sub-model can be:
[0136] SubMaster(D|+) = SubMaster(+|D) SubMaster(D) / (SubMaster(+|D) SubMaster(D)+SubMaster(+|N) SubMaster(N))
[0137] The mathematical formula of the model parameters of the secondary classification sub-model can be described as: SubMaster(+|D) x adjustment factor
[0138] D is the alarm reasonable probability of the current Pod abnormal fallback specific analysis object; / is the division symbol; SubMaster is the probability that the historical abnormal data of the current Pod abnormal fallback specific analysis object is close to the true value without considering the false positive rate; SubMaster(D|+) is the probability that the historical abnormal data of the current Pod abnormal fallback specific analysis object is close to the true value considering the false positive rate; SubMaster(+|D) represents the accuracy of the current Pod abnormal fallback specific analysis object, that is, (prior probability) = 1-false positive rate, for example: according to the false positive rate of 1% of the apache abnormal data of the current Pod abnormal fallback middleware sub-type, then SubMaster(+|D) 1-0.01 = 0.99; SubMaster(+|N) is the false positive rate of the current Pod abnormal fallback specific analysis object data, which is the false positive number of the current Pod abnormal fallback specific analysis object / Node (node) alarm total; SubMaster(N) represents the reasonable probability of the current Pod abnormal fallback specific analysis object, that is, 1-SubMaster(D).
[0139] After obtaining the above parameters, the above parameters can be put into the secondary classification sub-model, and the analysis result, that is, the secondary classification version selection probability, is trained to complete the construction and training of the secondary classification sub-model.
[0140] It can be seen that the technical scheme provided by the embodiments of the present application divides the version selection model into two parts when training the version selection model, that is, a primary classification sub-model and a secondary classification sub-model. The primary classification sub-model realizes coarse classification of the fallback version selection, and the secondary classification sub-model realizes fine classification of the fallback version selection. Through the primary classification version selection probability and the secondary classification version selection probability, the version selection probability of each version corresponding to the current version is determined, which helps to make the rollback version determined by the version selection model more accurate and closer to the true value. Then, the version selection model can be used to replace manual selection of the rollback version in the future, which can more intelligently improve the efficiency of determining the rollback version.
[0141] On the basis of the above embodiments, in an implementation manner, the Pod rollback version determination method can further include the following steps, that is, step a and step b:
[0142] Step a: obtaining image database data corresponding to each Pod by running an abnormality detection program, wherein the image database data includes file information of each version of each Pod.
[0143] Step b: determining an abnormal source causing the Pod code of the current version to be unmatched with the Pod code of the previous version based on the image database data corresponding to each Pod.
[0144] The abnormal source includes at least one of a middleware type, a database type and a plug-in type.
[0145] Specifically, the image database data corresponding to the Pod is acquired by an abnormality detection program of the Master (master node), so as to determine the abnormal source. The abnormal source can be the middleware type, the database type and the plug-in type. That is, which one of the three types causes the version submission abnormality and results in the rollback.
[0146] It can be seen that by the technical solution provided by the embodiment, the abnormal source causing the rollback can be accurately determined by the abnormality detection program of the Master (master node), so as to repair the abnormal problem of the rollback version in the subsequent step.
[0147] On the basis of the above embodiment, in an embodiment, as shown in Figure 3 The Pod rollback version determination method can further include the following steps:
[0148] S310, determining a sub-abnormal source corresponding to the abnormal source.
[0149] The sub-abnormal source includes at least one of a middleware sub-type, a database sub-type and a plug-in sub-type.
[0150] After the abnormal source is determined, a secondary classification object corresponding to the abnormal source is determined. The secondary classification object is the sub-abnormal source. If the abnormal source is the middleware type, the secondary classification object is the middleware sub-type, i.e. the specific middleware type, which can be apache, tomcat or Resin. If the abnormal source is the database type, the sub-abnormal source is the database sub-type, i.e. the specific database type, which can be mysql, sqlserver or oracle. If the abnormal source is the plug-in type, the sub-abnormal source is the plug-in sub-type, i.e. the specific plug-in type, which can be a development language or script such as java, C++ or C.
[0151] S320, searching for a target historical function library corresponding to the sub-abnormal source in a pre-stored historical function library.
[0152] Specifically, after the same secondary classification object of the rollback version and the current submission abnormal version is determined, the historical function library deployed on the Master (master node) is accessed by taking the secondary classification object as a query condition. A function set in the public function library of the sub-abnormal source is acquired.
[0153] S330, comparing the Pod code of the target rollback version with the Pod code of the current version by executing the target historical function library, to obtain target Pod code.
[0154] The target Pod code is a Pod code that has a version mismatch between a current version and a target version.
[0155] S340, correcting the target Pod code to obtain a corrected Pod code.
[0156] Specifically, the function set in the common function library of the obtained sub-exception source is compared with the common function library of the current submission exception version to obtain the target Pod code to be corrected, and the target Pod code to be corrected is corrected to obtain a corrected Pod code.
[0157] S350, testing the corrected Pod code in the current Pod environment, and uploading the corrected Pod code in the Pod after the test is passed.
[0158] Specifically, the updated current submission exception version is put into a temporarily built Pod environment for testing. If the master node shows normal after the submission version, it means that the problem of this rollback exception processing is solved. The corrected Pod code is uploaded in the Pod.
[0159] If the master node shows an exception after the submission version, the submission exception version before the update is restored through the program execution, and the Pod version of the rollback is confirmed by manually modifying the master node configuration file by the administrator, and the manual modification and testing of the exception code this time are performed.
[0160] As can be seen, through the technical solution of the embodiment, when the version exception is rolled back, the exception source can be found and repaired and tested, thereby intelligently and automatically repairing the exception rollback problem caused by code conflict, and greatly improving the efficiency of handling the exception rollback when the cluster fails.
[0161] In order to clearly describe the scheme, the complete scheme of the embodiment of the present application will be described as a whole. As shown in Figure 4 .
[0162] The Kubernetes cluster mainly includes three objects, namely Master (master node), Node (node) and Pod.
[0163] The Master (master node) manages the business of all Pods, and stores an image database and a historical function library. The image database and the historical database have been described in detail in the above embodiment, and will not be described here.
[0164] Next, a version selection model is constructed according to the historical abnormal rollback data of all the Pods. In order to make the rollback version determined by the version selection model more accurate, the version selection model is divided into two parts, namely a first classification sub-model and a second classification sub-model. The probability of the most likely version selected by the abnormal version selection rollback is (the output result of the first classification model + the output result of the second classification sub-model) / 2. The version with the highest probability is determined as the rollback version.
[0165] Then, the abnormal problem detection and repair of the rollback version are performed by the abnormal rollback program. And the solution to the rollback abnormality can be automatically performed. Specifically, the abnormal source, i.e., the second classification object, is compared with the general function library of the current abnormal version and is put into the temporarily built Pod environment for testing. If the testing is passed, the abnormal rollback problem is solved. Otherwise, a bottom operation is performed, i.e., the rollback abnormality is manually solved.
[0166] It can be seen that, by the technical solution of the embodiment, the version selection model is used to replace the method of manually selecting the rollback version, the efficiency of determining the rollback version can be more intelligently improved, and the version selection model is divided into two parts, namely a first classification sub-model and a second classification sub-model. The first classification sub-model realizes the coarse classification of the rollback version selection, and the second classification sub-model realizes the fine classification of the rollback version selection. By the first classification version selection probability and the second classification version selection probability, the version selection probability of each version corresponding to the current version is determined, which can make the rollback version determined by the version selection model more accurate and closer to the truth.
[0167] And when the version abnormality is rolled back, the abnormal source can be found and repaired and tested, so that the abnormal rollback problem caused by the code conflict can be intelligently and automatically repaired, and the efficiency of processing the abnormal rollback when the cluster fails is greatly improved.
[0168] It should be noted that, for the method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by the present application.
[0169] In a second aspect, the embodiments of the present application provide a Pod rollback version determination apparatus, as shown in Figure 5 The apparatus comprises:
[0170] The information input module 510 is configured to input file information of a current version of a Pod in an image database into a pre-trained version selection model when the Pod code of the current version does not match the Pod code of a previous version; the version selection model includes a first classification sub-model and a second classification sub-model, the first classification sub-model is trained based on first classification data and first classification version selection probability in abnormal rollback history data of a historical version of the Pod, and the second classification sub-model is trained based on second classification data and second classification version selection probability in the abnormal rollback history data of the historical version of the Pod, the second classification data being sub-data of the first classification data;
[0171] The version selection probability acquisition module 520 is configured to obtain first classification version selection probability corresponding to the current version through the first classification sub-model, and obtain second classification version selection probability corresponding to the current version through the second classification sub-model.
[0172] The version selection probability determination module 530 is configured to determine version selection probability of each version corresponding to the current version based on the first classification version selection probability and the second classification version selection probability.
[0173] The rollback version determination module 540 is configured to determine a target rollback version corresponding to the current version based on the determined version selection probability of each version.
[0174] The technical scheme provided by the embodiments of the present application is that when the Pod code of a current version does not match the Pod code of a previous version, file information of the current version of the Pod in an image database is input into a pre-trained version selection model; the version selection model includes a first classification sub-model and a second classification sub-model; first classification version selection probability corresponding to the current version is obtained through the first classification sub-model, and second classification version selection probability corresponding to the current version is obtained through the second classification sub-model; version selection probability of each version corresponding to the current version is determined based on the first classification version selection probability and the second classification version selection probability; and a target rollback version corresponding to the current version is determined based on the determined version selection probability of each version.
[0175] It can be seen that the technical scheme provided by the embodiment of the application uses a version selection model to replace the method of manually selecting a rollback version, can more intelligently improve the efficiency of determining the rollback version, and divides the version selection model into two parts, i.e., a first classification sub-model and a second classification sub-model. The first classification sub-model realizes coarse classification of the rollback version selection, and the second classification sub-model realizes fine classification of the rollback version selection. By using the first classification version selection probability and the second classification version selection probability, the version selection probability of each version corresponding to the current version is determined, so that the rollback version determined by the version selection model is more accurate and closer to the truth.
[0176] Optionally, a version selection model training module is further included; the version selection model training module is configured to:
[0177] Obtain abnormal rollback history data of the historical version of the Pod;
[0178] Determine first classification data in the abnormal rollback history data, the first classification data including middleware types, plug-in types and database types;
[0179] Calculate first classification version selection probabilities corresponding to the middleware types, the plug-in types and the database types respectively, the first classification version selection probabilities being determined based on a total number of abnormal rollback history data alarms of the Pod, a false alarm number of the abnormal rollback history data alarms of the Pod, and an alarm number corresponding to each first classification data in the total number of abnormal rollback history data alarms of the Pod;
[0180] Train the first classification sub-model based on the middleware types and the first classification version selection probabilities corresponding to the middleware types, the plug-in types and the first classification version selection probabilities corresponding to the plug-in types, and the database types and the first classification version selection probabilities corresponding to the database types, to obtain a trained first classification sub-model;
[0181] Determine second classification data in the abnormal rollback history data, the second classification data including middleware sub-types corresponding to the middleware types, plug-in sub-types corresponding to the plug-in types and database sub-types corresponding to the database types;
[0182] Calculate second classification version selection probabilities corresponding to the middleware sub-types, the plug-in sub-types and the database sub-types respectively, the second classification version selection probabilities being determined based on a total number of second classification data alarms in the abnormal rollback history data of the Pod, a false alarm number of the second classification data alarms in the abnormal rollback history data of the Pod, and an alarm number corresponding to each second classification data in the total number of abnormal rollback history data alarms of the Pod;
[0183] The secondary classification sub-model is trained based on the middleware sub-type and the secondary classification version selection probability corresponding to the middleware sub-type, the plugin sub-type and the secondary classification version selection probability corresponding to the plugin sub-type, and the database sub-type and the secondary classification version selection probability corresponding to the database sub-type, to obtain the trained secondary classification sub-model.
[0184] Optionally, the apparatus further comprises:
[0185] The data acquisition module is configured to acquire image database data corresponding to each Pod by running an anomaly detection program, the image database data including file information of each version of each Pod.
[0186] The anomaly source determination module is configured to determine an anomaly source causing the Pod code of the current version to be mismatched with the Pod code of the previous version based on the image database data corresponding to each Pod, wherein the anomaly source includes at least one of a middleware type, a database type and a plugin type.
[0187] Optionally, the apparatus further comprises:
[0188] The sub-anomaly source determination module is configured to determine a sub-anomaly source corresponding to the anomaly source, wherein the sub-anomaly source includes at least one of a middleware sub-type, a database sub-type and a plugin sub-type.
[0189] The historical function library searching module is configured to search for a target historical function library corresponding to the sub-anomaly source in a pre-stored historical function library.
[0190] The code comparison module is configured to compare the Pod code of the target rollback version with the Pod code of the current version by executing the target historical function library to obtain target Pod code, wherein the target Pod code is the Pod code that is mismatched between the current version and the target version.
[0191] The code repair module is configured to correct the target Pod code to obtain corrected Pod code.
[0192] The code testing module is configured to test the corrected Pod code in a current Pod environment, and upload the corrected Pod code to the Pod after the test is passed.
[0193] Optionally, the version selection probability determination module is specifically configured to:
[0194] For each version, the primary classification version selection probability and the secondary classification version selection probability corresponding to the version are weighted and summed to obtain the version selection probability of the version.
[0195] Correspondingly, the rollback version determination module is specifically configured to:
[0196] The versions are sorted based on the version selection probability of each version, and a version with a sorting serial number less than a preset serial number is determined as the target rollback version corresponding to the current version.
[0197] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts refer to the part of the method embodiment.
[0198] In a third aspect, the embodiments of the present application provide an electronic device, such as Figure 6 As shown in the figure, the electronic device includes a memory 610, a processor 620, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the Pod rollback version determination method of the first aspect when executing the program.
[0199] The technical scheme provided by the embodiments of the present application inputs the file information of the current version of the Pod in the image database into the version selection model pre-trained when the Pod code of the current version does not match the Pod code of the last version; the version selection model includes a first-level classification sub-model and a second-level classification sub-model; through the first-level classification sub-model, the first-level classification version selection probability corresponding to the current version is obtained, and through the second-level classification sub-model, the second-level classification version selection probability corresponding to the current version is obtained; based on the first-level classification version selection probability and the second-level classification version selection probability, the version selection probability of each version corresponding to the current version is determined; and based on the determined version selection probability of each version, the target rollback version corresponding to the current version is determined.
[0200] As can be seen, by using the version selection model to replace the manual method of selecting the rollback version, the efficiency of determining the rollback version can be improved more intelligently, and by dividing the version selection model into two parts, i.e., the first-level classification sub-model and the second-level classification sub-model, the first-level classification sub-model realizes the coarse classification of the rollback version selection, the second-level classification sub-model realizes the fine classification of the rollback version selection, and through the first-level classification version selection probability and the second-level classification version selection probability, the version selection probability of each version corresponding to the current version is determined, which can make the rollback version determined by the version selection model more accurate and closer to the truth.
[0201] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the Pod rollback version determination method of the first aspect.
[0202] The technical scheme provided in the embodiments of the present application is that when the current version of the Pod code does not match the previous version of the Pod code, the file information of the current version of the Pod in the image database is input into the version selection model pre-trained; the version selection model includes a first classification sub-model and a second classification sub-model; through the first classification sub-model, the first classification version selection probability corresponding to the current version is obtained, and through the second classification sub-model, the second classification version selection probability corresponding to the current version is obtained; based on the first classification version selection probability and the second classification version selection probability, the version selection probability of each version corresponding to the current version is determined; and based on the determined version selection probability of each version, the target rollback version corresponding to the current version is determined.
[0203] It can be seen that, by using the technical scheme provided in the embodiments of the present application, the version selection model is used to replace the manual method of selecting a rollback version, which can more intelligently improve the efficiency of determining the rollback version, and the version selection model is divided into two parts, namely the first classification sub-model and the second classification sub-model, the first classification sub-model realizes coarse classification of the rollback version selection, the second classification sub-model realizes fine classification of the rollback version selection, and through the first classification version selection probability and the second classification version selection probability, the version selection probability of each version corresponding to the current version is determined, which can make the rollback version determined by the version selection model more accurate and closer to the truth.
[0204] Each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts of each embodiment can be referred to each other.
[0205] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, or computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer usable program code.
[0206] The present application is described with reference to flowcharts and / or block diagrams according to the method, terminal device (system), and computer program product of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be realized by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device realize the functions in the flows and / or blocks.Figure 1 apparatuses that perform the functions recited in block Figure 1
[0207] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 apparatuses that perform the functions recited in block Figure 1
[0208] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the Figure 1 apparatuses that perform the functions recited in block Figure 1
[0209] While the preferred embodiments of the application have been described, additional variations and modifications can be made to these embodiments by those skilled in the art once they learn of the basic inventive concepts. Therefore, the appended claims are intended to cover all such variations and modifications as fall within the scope of the application.
[0210] Finally, it should be noted that the terms "comprises", "comprising", or other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0211] The above describes in detail the Pod version rollback determination method, device, electronic equipment and storage medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples. The above example description is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range will be changed. In conclusion, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A method for determining the rollback version of a Pod, characterized in that, The method includes: When the current version of the Pod code does not match the previous version of the Pod code, the file information of the current version of the Pod in the image database is input into a pre-trained version selection model. The version selection model includes a primary classification sub-model and a secondary classification sub-model. The primary classification sub-model is trained based on the primary classification data and primary classification version selection probability in the historical data of abnormal rollback of Pods of historical versions. The secondary classification sub-model is trained based on the secondary classification data and secondary classification version selection probability in the historical data of abnormal rollback of Pods of historical versions. The secondary classification data is a sub-data of the primary classification data. The first-level classification sub-model is used to obtain the first-level classification version selection probability corresponding to the current version, and the second-level classification sub-model is used to obtain the second-level classification version selection probability corresponding to the current version. Based on the version selection probability of the first-level category and the version selection probability of the second-level category, determine the version selection probability of each version corresponding to the current version; Based on the determined version selection probabilities of each version, the target rollback version corresponding to the current version is determined.
2. The method according to claim 1, characterized in that, The process of training the version selection model includes: Retrieve historical data on abnormal rollbacks of Pod versions; Determine primary category data from the abnormal rollback historical data, the primary category data including middleware type, plug-in type and database type; Calculate the first-level category version selection probability corresponding to the middleware type, plugin type and database type respectively. The first-level category version selection probability is determined based on the total number of alarms in the Pod's abnormal rollback historical data, the number of false alarms in the Pod's abnormal rollback historical data, and the number of alarms corresponding to each first-level category data in the total number of alarms in the Pod's abnormal rollback historical data. Based on the middleware type and the corresponding first-level category version selection probability, the plugin type and the corresponding first-level category version selection probability, and the database type and the corresponding first-level category version selection probability, the first-level category sub-model is trained to obtain the trained first-level category sub-model. In the abnormal rollback historical data, secondary category data is determined, which includes middleware subtypes corresponding to middleware types, plugin subtypes corresponding to plugin types, and database subtypes corresponding to database types. Calculate the secondary category version selection probability corresponding to the middleware subtype, plugin subtype and database subtype respectively. The secondary category version selection probability is determined based on the total number of alarms of secondary category data in the Pod's abnormal rollback history data, the number of false alarms of secondary category data in the Pod's abnormal rollback history data, and the number of alarms corresponding to each type of secondary category data in the total number of alarms in the Pod's abnormal rollback history data. Based on the middleware subtype and the corresponding secondary classification version selection probability, the plugin subtype and the corresponding secondary classification version selection probability, and the database subtype and the corresponding secondary classification version selection probability, the secondary classification sub-model is trained to obtain the trained secondary classification sub-model.
3. The method according to claim 1, characterized in that, The method further includes: By running an anomaly detection program, the image database data corresponding to each Pod is obtained. The image database data includes file information for each version of each Pod. Based on the image database data corresponding to each Pod, the source of the exception that causes the current version of the Pod code to be incompatible with the previous version of the Pod code is determined. The source of the exception includes at least one of middleware type, database type and plugin type.
4. The method according to claim 3, characterized in that, Also includes: Determine the sub-anomaly source corresponding to the anomaly source, wherein the sub-anomaly source includes at least one of middleware subtype, database subtype and plug-in subtype; Search for the target historical function library corresponding to the sub-anomaly source in the pre-stored historical function library; By executing the target historical function library, the Pod code of the target rollback version is compared with the Pod code of the current version to obtain the target Pod code. The target Pod code is the Pod code of the current version that has a version mismatch with the target rollback version. The target Pod code is corrected to obtain the corrected Pod code; The corrected Pod code is tested in the current Pod environment, and after the test is passed, the corrected Pod code is uploaded to the Pod.
5. The method according to any one of claims 1 to 4, characterized in that, The process of determining the version selection probability of each version corresponding to the current version based on the version selection probability of the primary category and the version selection probability of the secondary category includes: For each version, the version selection probability of the first-level category and the version selection probability of the second-level category corresponding to the version are weighted and summed to obtain the version selection probability of that version; Accordingly, determining the target rollback version corresponding to the current version based on the determined version selection probabilities of each version includes: All versions are sorted based on the version selection probability of each version, and the version with the sort number less than the preset number is determined as the target rollback version corresponding to the current version.
6. A Pod rollback version determination device, characterized in that, The device includes: The information input module is used to input the file information of the current version of the Pod from the image database into a pre-trained version selection model when the current version of the Pod code does not match the previous version of the Pod code. The version selection model includes a primary classification sub-model and a secondary classification sub-model. The primary classification sub-model is trained based on the primary classification data and primary classification version selection probability in the historical data of abnormal rollback of Pods of historical versions. The secondary classification sub-model is trained based on the secondary classification data and secondary classification version selection probability in the historical data of abnormal rollback of Pods of historical versions. The secondary classification data is a sub-data of the primary classification data. The version selection probability acquisition module is used to obtain the first-level category version selection probability corresponding to the current version through the first-level classification sub-model, and to obtain the second-level category version selection probability corresponding to the current version through the second-level classification sub-model. The version selection probability determination module is used to determine the version selection probability of each version corresponding to the current version based on the version selection probability of the first-level category and the version selection probability of the second-level category. The rollback version determination module is used to determine the target rollback version corresponding to the current version based on the determined version selection probabilities of each version.
7. The apparatus according to claim 6, characterized in that, It also includes a version selection model training module; the version selection model training module is used for: Retrieve historical data on abnormal rollbacks of Pod versions; Determine primary category data from the abnormal rollback historical data, the primary category data including middleware type, plug-in type and database type; Calculate the first-level category version selection probability corresponding to the middleware type, plugin type and database type respectively. The first-level category version selection probability is determined based on the total number of alarms in the Pod's abnormal rollback historical data, the number of false alarms in the Pod's abnormal rollback historical data, and the number of alarms corresponding to each first-level category data in the total number of alarms in the Pod's abnormal rollback historical data. Based on the middleware type and the corresponding first-level category version selection probability, the plugin type and the corresponding first-level category version selection probability, and the database type and the corresponding first-level category version selection probability, the first-level category sub-model is trained to obtain the trained first-level category sub-model. In the abnormal rollback historical data, secondary category data is determined, which includes middleware subtypes corresponding to middleware types, plugin subtypes corresponding to plugin types, and database subtypes corresponding to database types. Calculate the secondary category version selection probability corresponding to the middleware subtype, plugin subtype and database subtype respectively. The secondary category version selection probability is determined based on the total number of alarms of secondary category data in the Pod's abnormal rollback history data, the number of false alarms of secondary category data in the Pod's abnormal rollback history data, and the number of alarms corresponding to each type of secondary category data in the total number of alarms in the Pod's abnormal rollback history data. Based on the middleware subtype and the corresponding secondary classification version selection probability, the plugin subtype and the corresponding secondary classification version selection probability, and the database subtype and the corresponding secondary classification version selection probability, the secondary classification sub-model is trained to obtain the trained secondary classification sub-model.
8. The apparatus according to claim 6, characterized in that, The device further includes: The data acquisition module is used to acquire the image database data corresponding to each Pod by running an anomaly detection program. The image database data includes file information for each version of each Pod. The exception source determination module is used to determine the exception source that causes the current version of the Pod code to be incompatible with the previous version of the Pod code based on the image database data corresponding to each Pod. The exception source includes at least one of middleware type, database type and plugin type.
9. The apparatus according to claim 8, characterized in that, Also includes: The sub-anomaly source determination module is used to determine the sub-anomaly source corresponding to the anomaly source, wherein the sub-anomaly source includes at least one of middleware subtype, database subtype and plug-in subtype; The historical function library lookup module is used to search for the target historical function library corresponding to the sub-anomaly source in the pre-stored historical function library; The code comparison module is used to compare the Pod code of the target rollback version with the Pod code of the current version by executing the target historical function library to obtain the target Pod code. The target Pod code is the Pod code of the current version that has a version mismatch with the target rollback version. The code repair module is used to correct the target Pod code to obtain the corrected Pod code; The code testing module is used to test the corrected Pod code in the current Pod environment, and upload the corrected Pod code to the Pod after the test is passed.
10. The apparatus according to any one of claims 6 to 9, characterized in that, The version selection probability determination module is specifically used for: For each version, the version selection probability of the first-level category and the version selection probability of the second-level category corresponding to the version are weighted and summed to obtain the version selection probability of that version; Accordingly, the rollback version determination module is specifically used for: All versions are sorted based on the version selection probability of each version, and the version with the sort number less than the preset number is determined as the target rollback version corresponding to the current version.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the Pod rollback version determination method as described in any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the Pod rollback version determination method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Pod replacement method and device, electronic equipment and computer readable storage medium
CN111666088A
Deep learning large model and large data set version management method based on Docker containerization
CN114116684A