Configuration anomaly prediction method, computer equipment, storage medium and program product
By encapsulating configuration prediction options in the BIOS of the switch device and using the target classifier for risk prediction, the exception handling problem caused by user error modification of configuration items is solved, and the security and stability of the switch device are improved.
Patent Information
- Application Number
- CN202411149573.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-21
AI Technical Summary
In the prior art, the BIOS configuration exception handling of switch equipment has high time and labor costs, and users cannot handle it in time after mistakenly modifying the configuration items, resulting in low device security.
Provide a configuration exception prediction method. By encapsulating configuration prediction options in the basic input and output system, obtaining the target characteristics of the current configuration, and inputting the target classifier to predict risks. If there is a serious abnormal risk for prediction, the current configuration will be refused to be executed to reduce abnormalities. Process costs and improve equipment safety.
By predicting abnormalities that may be caused by changes in BIOS configuration, users can conduct risk assessments before the change configuration takes effect, avoid potential instability factors, improve the overall stability and security of switch equipment, and reduce the incidence of failures.
Smart Images

Figure CN118672665B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a configuration anomaly prediction method, a computer device, a storage medium and a program product. Background Art
[0002] The Basic Input Output System (BIOS) is a startup program embedded in the motherboard's Read Only Memory (ROM) chip. It is used to control the basic program of the switch device after startup, including the hard disk, serial port, memory and other hardware configurations.
[0003] In the related technology, there is a clear warning in the BIOS configuration menu (SETUP) of the switch product, and it is not recommended to change the configuration items in the configuration menu. If the user mistakenly modifies the configuration items in the configuration menu and causes abnormalities in the switch device, minor abnormalities can be solved by restarting the switch device or restoring the BIOS factory configuration. Severe abnormalities require external means to re-burn the BIOS image to restore the default configuration.
[0004] However, the remedy for abnormalities of switch devices caused by configuration item modification often requires BIOS-related professional knowledge. Users do not have a deep understanding of BIOS. When users mistakenly modify configuration items in the configuration menu and cause abnormalities of switch devices, they need to seek help from professional technicians, which takes a lot of time and manpower costs. Serious abnormalities caused by configuration item modification cannot be handled in time, and the security of switch devices is low. Summary of the invention
[0005] In view of this, the present invention provides a configuration anomaly prediction method, a computer device, a storage medium and a program product to solve the problem in the related art that serious anomalies caused by configuration item modification cannot be processed in time and the switch device has low security.
[0006] In a first aspect, the present invention provides a configuration anomaly prediction method, which is applied to a basic input and output system, and the method comprises:
[0007] Get the switch status of the configuration prediction option;
[0008] When the switch state of the configuration prediction option is turned on, in response to a configuration modification and saving operation by a user, determining a current configuration, and acquiring a target configuration corresponding to a target feature in the current configuration, wherein the target feature is a feature variable corresponding to a split point in a target classifier;
[0009] Inputting the target configuration into a target classifier to obtain a risk prediction result of executing the current configuration;
[0010] If the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, the current configuration is refused to be executed.
[0011] The configuration anomaly prediction method provided in this embodiment encapsulates the configuration prediction option in the basic input and output system. When the switch state of the configuration prediction option is on, if the user makes a configuration modification, when the user saves the configuration modification, the target configuration in the current configuration is obtained, and the risk prediction result of executing the current configuration is determined by inputting the target configuration into the target classifier. When the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, the current configuration is refused to be executed. When the user makes a configuration modification and saves, a risk prediction is performed on the configuration modified and saved by the user, and whether to execute the configuration modified and saved by the user is determined based on the risk prediction result. If it is predicted that the switch device has a serious abnormal risk after executing the current configuration, the current configuration is refused to be executed. The time cost and labor cost of exception handling are reduced, and the security of the switch device is improved.
[0012] In an optional implementation, before inputting the target configuration into the target classifier, the method further includes:
[0013] Get the training set;
[0014] Based on the training set, determining a feature variable for classification and a target variable for classification, wherein the training set includes a plurality of training samples, and the target variable is a risk result corresponding to executing a configuration in the training sample;
[0015] Based on the training set and the feature variables, determining the information gain of each feature variable;
[0016] Based on the information gain of each of the feature variables, the feature variable with the largest information gain is selected as a split point;
[0017] Divide the training set based on the split point to obtain several training subsets;
[0018] For any training subset, determine whether the values of the target variables of the training samples in the training subset are the same;
[0019] When the values of the target variables of the training samples in any training subset are the same, stop dividing the training set and obtain the target classifier.
[0020] The configuration anomaly prediction method provided in this embodiment automatically selects the most important feature variables as split points by calculating information gain, which reduces the need for manual feature selection and ensures the efficiency and accuracy of the model. Through automated feature selection and efficient model building process, a powerful and easy-to-understand classification method is provided.
[0021] In an optional embodiment, the method further includes:
[0022] When there are different values of the target variable of the training samples in any training subset, obtain the information gain of other feature variables except the feature variable corresponding to the split point;
[0023] Based on the information gain of other feature variables except the feature variable corresponding to the split point, the feature variable with the largest information gain is selected from the other feature variables as the next split point;
[0024] Continue to divide the training set based on the next split point to obtain a plurality of training subsets;
[0025] Return to execute the step of determining, for any training subset, whether the values of the target variables of the training samples in the training subset are the same.
[0026] The configuration anomaly prediction method provided in this embodiment determines that the splitting has not been completed when the values of the target variables of the training samples in any training subset are different, continues to obtain the next best splitting point, and continues to divide the training set, thereby increasing the classification accuracy, reducing category confusion, and ensuring the classification accuracy of the target classifier.
[0027] In an optional implementation, determining the information gain of each feature variable based on the training set and the feature variable includes:
[0028] For any characteristic variable, obtaining a first information entropy of the target variable in the training set without using the characteristic variable as a split point;
[0029] Acquire a second information entropy of the target variable in the training set when the feature variable is used as a split point;
[0030] Based on the first information entropy and the second information entropy, an information gain of the feature variable is determined.
[0031] The configuration anomaly prediction method provided in this embodiment can quantify the contribution of each feature to the classification task by calculating information gain. Features with large information gain are considered to be more valuable in the classification process because they can effectively reduce the uncertainty of the target variable (i.e., information entropy). This helps the algorithm automatically select the features that are most helpful for classification decisions, reducing the subjectivity and potential errors of manually selecting features.
[0032] In an optional implementation, the obtaining, when the feature variable is used as a split point, a second information entropy of the target variable in the training set includes:
[0033] When the feature variable is used as a split point, obtaining the probability of the target variable in the training set corresponding to different values;
[0034] Based on the probabilities that the target variable in the training set corresponds to different values, a second information entropy of the target variable in the training set is determined.
[0035] The configuration anomaly prediction method provided in this embodiment can directly measure the reduction degree of target variable uncertainty after introducing the split point by calculating the second information entropy based on feature splitting. This step is the core of information gain calculation and ensures the rationality of splitting, that is, selecting features that can minimize classification confusion.
[0036] In an optional implementation, before determining the feature variables and the target variables for classification based on the training set, the method further includes:
[0037] The numerical data in the training set is discretized to obtain the nominal data required for building a decision tree.
[0038] The configuration anomaly prediction method provided in this embodiment discretizes the numerical data in the training set, making the constructed decision tree model simpler, easier to understand and implement. Discretization can also reduce sensitivity and improve the stability of the model and its robustness in the face of noisy data.
[0039] In an optional embodiment, the method further includes:
[0040] When the risk prediction result indicates that after the current configuration is executed, the switch device has no abnormal risk or has a second abnormal risk, the current configuration is executed, wherein the risk level of the second abnormal risk is lower than the risk level of the first abnormal risk.
[0041] The configuration anomaly prediction method provided in this embodiment avoids the conservative strategy of terminating configuration execution under all abnormal risks by distinguishing different levels of abnormal risks. After the risk prediction result indicates that the switch device has no abnormal risk or has a second abnormal risk, that is, a lower abnormal risk, the current configuration can be executed, thereby reducing unnecessary pauses and manual intervention, optimizing resource utilization, and improving configuration efficiency and automation level.
[0042] In an optional embodiment, the method further includes:
[0043] When the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, a first alarm message is generated and pushed to the corresponding serial port, so that the user determines that the current configuration has a first abnormal risk based on the first alarm message.
[0044] The configuration anomaly prediction method provided in this embodiment can ensure that the user is aware of the high risks that may be caused by the configuration operation at the first time by immediately generating an alarm message when it is predicted that the switch device has a first abnormality risk after executing the current configuration, thereby providing the possibility for taking timely measures.
[0045] In an optional embodiment, the method further includes:
[0046] When the risk prediction result indicates that the switch device has a second abnormal risk after executing the current configuration, a second alarm message is generated and pushed to the corresponding serial port, so that the user determines that the current configuration has a second abnormal risk based on the second alarm message.
[0047] The configuration anomaly prediction method provided in this embodiment can ensure that the user is aware of the lower risks that may be caused by the configuration operation at the first time by immediately generating an alarm message when it is predicted that the switch device has a second abnormality risk after executing the current configuration, thereby providing the possibility for taking timely measures.
[0048] In an optional embodiment, the method further includes:
[0049] If the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, generating first abnormal information, and combining the first abnormal information and the current configuration into a first configuration file;
[0050] Saving the first configuration file to a first preset directory of the baseboard management controller;
[0051] If the risk prediction result indicates that the switch device has a second abnormal risk after executing the current configuration, generating second abnormal information, and combining the second abnormal information and the current configuration into a second configuration file;
[0052] The second configuration file is saved in a second preset directory of the baseboard management controller.
[0053] The configuration anomaly prediction method provided in this embodiment provides detailed and structured data support for subsequent analysis and troubleshooting by generating a first configuration file including first anomaly information and the current configuration and a second configuration file including second anomaly information and the current configuration, and saving the first configuration file and the second configuration file to a directory corresponding to the baseboard management controller, and can also serve as a reference for future positioning analysis and continuous learning optimization.
[0054] In an optional embodiment, the method further includes:
[0055] When the switch state of the configuration prediction option is off, in response to the user's configuration modification and saving operation, the current configuration is executed.
[0056] The configuration anomaly prediction method provided in this embodiment allows the user to directly perform configuration modification and save when the configuration prediction option is turned off, giving the user higher control and flexibility. The user can choose whether to enable the configuration prediction option according to actual conditions and needs, avoiding the forced intervention of the configuration prediction system and improving the user experience.
[0057] In a second aspect, the present invention provides a switch device, including: a basic input-output system, wherein the basic input-output system performs configuration anomaly prediction based on the configuration anomaly prediction method as described in the first aspect or any corresponding embodiment thereof.
[0058] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the configuration anomaly prediction method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0059] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the configuration anomaly prediction method of the first aspect or any corresponding embodiment thereof.
[0060] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the configuration anomaly prediction method of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0062] Figure 1 is a flow chart of a configuration anomaly prediction method according to an embodiment of the present invention;
[0063] Figure 2 is a flow chart of another configuration abnormality prediction method according to an embodiment of the present invention;
[0064] Figure 3 is a flowchart of another configuration abnormality prediction method according to an embodiment of the present invention;
[0065] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0067] The Basic Input and Output System is a startup program that cannot be tampered with and is engraved on the motherboard ROM chip. BIOS is used to guide the operating system to load the kernel after the device starts up, and is responsible for calculating the system self-test program (Power On Self Test, referred to as: POST) and the system self-startup program. Due to the tamper-proof nature of BIOS, the program is stored in the ROM chip, and the original settings can still be maintained after power failure.
[0068] The main function of BIOS is to control the basic programs after the switch device is started, including hard disk drive, serial port output settings, memory options and other device configurations.
[0069] In the related art, there are generally two types of BIOS anomalies involving switch devices: 1. Bugs (errors) in the BIOS code cause switch device anomalies, which include not only downtime problems but also unavailability or failure to enable certain functions. 2. Users actively adjust certain configuration items in the BIOS SETUP (configuration menu), such as turning off the hard disk port switch, adjusting the serial port baud rate configuration, etc., which can cause switch device anomalies.
[0070] Since switch users have different understandings of the functions of various configuration items under SETUP and the consequences of adjusting configuration items, there is a probability that the switch will malfunction due to incorrect operation or modification of configuration items.
[0071] It should be noted that there are clear warnings in the BIOS SETUP menu of the switch product. It is not recommended to change the configuration items in the menu unless necessary, otherwise serious consequences may occur. There is no known method to predict BIOS configuration anomalies for current switch system products. If the user mistakenly modifies the function item configuration under BIOS SETUP and causes anomalies in the switch device, in the case of minor anomalies, it can be solved by restarting the switch device, entering the BIOS SETUP menu to restore the modified function items, or restoring the BIOS factory configuration through the restore default settings option. In the case of serious anomalies, such as abnormal display of serial port push, garbled screen printing, system freeze and downtime, etc., the configuration cannot be restored by conventional methods. It is necessary to re-burn the BIOS image through the baseboard management controller (Baseboard Management Controller, referred to as: BMC) interface or external burning to achieve the purpose of restoring the default configuration.
[0072] In summary, when a user modifies the configuration of a SETUP function item and causes an exception, depending on the severity of the exception, the device can be restarted to enter the SETUP menu for configuration recovery, or external means can be used to refresh the BIOS image to restore the default configuration. However, if the user does not have a deep understanding of the BIOS, when the user mistakenly modifies the configuration items in the configuration menu and causes an abnormality in the switch device, it is necessary to seek assistance from professional technical support personnel, which requires high time and labor costs, seriously affecting the user experience, and failing to promptly handle serious abnormalities caused by the modification of configuration items, resulting in low switch device security.
[0073] Furthermore, when a user mistakenly operates a configuration item in a configuration menu and causes a minor abnormality of the switch device, it is difficult for the user to perceive the abnormality and cannot locate and repair the abnormality in time.
[0074] An embodiment of the present invention provides a configuration anomaly prediction method, which encapsulates a configuration prediction option in a basic input / output system. When the switch state of the configuration prediction option is on, if a user modifies and saves the configuration, a risk prediction is performed on the configuration modified and saved by the user. Based on the risk prediction result, it is determined whether to execute the configuration modified and saved by the user. If it is predicted that the switch has a serious abnormality risk after executing the current configuration, the current configuration is refused to be executed to achieve the effect of improving the security of the switch device.
[0075] According to an embodiment of the present invention, an embodiment of a configuration anomaly prediction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0076] In this embodiment, a configuration abnormality prediction method is provided, which can be used in a basic input and output system in a switch device. Figure 1 is a flowchart of a configuration anomaly prediction method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0077] Step S101, obtaining the switch status of the configuration prediction option.
[0078] The configuration prediction option is encapsulated in the basic input and output system. By default, the switch state of the configuration prediction option is turned on.
[0079] It should be noted that the configuration prediction option is encapsulated as a BIOS function option and added to the SETUP menu. Users can freely choose whether to enable the configuration prediction function.
[0080] Step S102, when the switch state of the configuration prediction option is turned on, in response to the user's configuration modification and saving operation, determine the current configuration, and obtain the target configuration corresponding to the target feature in the current configuration, wherein the target feature is the feature variable corresponding to the splitting point in the target classifier.
[0081] Among them, the switch status of the configuration prediction option is on, indicating that configuration prediction protection is required, that is, when the user performs a configuration modification and save operation, it is necessary to predict the configuration modified and saved by the user to determine the abnormal risk of the configuration modified and saved by the user, and then determine whether to execute the configuration modified and saved by the user based on the degree of abnormal risk, thereby realizing configuration prediction protection.
[0082] It should be noted that when performing risk prediction on the current configuration, the target feature is determined according to the feature variable corresponding to the split point in the target classifier, the target configuration corresponding to the target feature in the current configuration is obtained, and risk prediction is performed according to the target configuration.
[0083] Step S103, input the target configuration into the target classifier to obtain the risk prediction result of executing the current configuration.
[0084] After the target configuration is obtained, the target configuration is input into the target classifier to obtain the risk prediction result of executing the current configuration output by the target classifier.
[0085] Step S104: when the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, refuse to execute the current configuration.
[0086] Among them, the first abnormal risk is a potential serious abnormal risk.
[0087] If the risk prediction result indicates that the switch device has a potential serious abnormal risk after executing the current configuration, the current configuration is refused to be executed, that is, the BIOS forcibly executes the discard change to restore the configuration, that is, restore the configuration to the configuration before the user made the modification and saved it, to ensure the safe operation of the switch device.
[0088] The configuration anomaly prediction method provided in this embodiment encapsulates the configuration prediction option in the basic input and output system. When the switch state of the configuration prediction option is on, if the user makes a configuration modification, when the user saves the configuration modification, the target configuration in the current configuration is obtained, and the risk prediction result of executing the current configuration is determined by inputting the target configuration into the target classifier. When the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, the current configuration is refused to be executed. When the user makes a configuration modification and saves, a risk prediction is performed on the configuration modified and saved by the user, and whether to execute the configuration modified and saved by the user is determined based on the risk prediction result. If it is predicted that the switch device has a serious abnormal risk after executing the current configuration, the current configuration is refused to be executed. The time cost and labor cost of exception handling are reduced, and the security of the switch device is improved.
[0089] The configuration anomaly prediction method provided in this embodiment predicts the anomalies that may be caused by BIOS configuration changes. Users can perform risk assessment before the configuration changes take effect, avoid potential unstable factors, thereby improving the overall stability of the switch device and reducing the failure rate.
[0090] When a system fails, the system can quickly identify potential problems that may be related to the BIOS configuration, narrow the scope of investigation, reduce the difficulty and time cost of investigation, and reduce the troubleshooting time. Based on the prediction results, operation and maintenance personnel can formulate a more reasonable maintenance plan, prevent potential problems in advance, and reduce unnecessary downtime and maintenance costs.
[0091] In this embodiment, a configuration abnormality prediction method is provided, which can be used in a basic input and output system in a switch device. Figure 2 is a flowchart of a configuration anomaly prediction method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0092] Step S201, obtain the switch status of the configuration prediction option. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0093] Step S202: when the switch state of the configuration prediction option is turned on, in response to the user's configuration modification and saving operation, determine the current configuration, and obtain the target configuration corresponding to the target feature in the current configuration, wherein the target feature is the feature variable corresponding to the split point in the target classifier. For details, please refer to Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0094] Step S203: Input the target configuration into the target classifier to obtain the risk prediction result of executing the current configuration. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0095] Step S204: If the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, the current configuration is refused to be executed. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0096] Step S205 , when the risk prediction result indicates that after executing the current configuration, the switch device has no abnormal risk or has a second abnormal risk, the current configuration is executed, wherein the risk level of the second abnormal risk is lower than the risk level of the first abnormal risk.
[0097] Among them, the second abnormal risk is a potential minor abnormal risk.
[0098] The risk prediction result indicates that after executing the current configuration, the switch device has no abnormal risk or has a potential slight abnormal risk, indicating that executing the current configuration will not cause serious consequences. In this case, the current configuration modified and saved by the user is executed.
[0099] The configuration anomaly prediction method provided in this embodiment avoids the conservative strategy of terminating configuration execution under all abnormal risks by distinguishing different levels of abnormal risks. After the risk prediction result indicates that the switch device has no abnormal risk or has a second abnormal risk, that is, a lower abnormal risk, the current configuration can be executed, thereby reducing unnecessary pauses and manual intervention, optimizing resource utilization, and improving configuration efficiency and automation level.
[0100] In some optional implementations, before inputting the target configuration into the target classifier, the configuration anomaly prediction method further includes:
[0101] Step a1: obtain the training set.
[0102] In this embodiment, historical configuration data is obtained, and the historical configuration data is quantitative data with labels. The historical configuration data is used as a training set, and the training set includes historical configuration data with labels, that is, switch device status is normal, severe abnormal, and slight abnormal.
[0103] For example, in this embodiment, 100 pieces of historical configuration data are used as a training set to train the target classifier. Some of the historical configuration data may be shown in Table 1.
[0104] Table 1
[0105] Sample / Features CPU Memory harddisk Serial Port model network USB Final state 1 Max performance 2133 open 115200 UEFI open open No abnormality 2 max efficiency 1600 close 115200 UEFI close open Severe abnormalities 3 max performance 1600 open 9600 UEFI close open Severe abnormalities 4 max performance 1600 open 115200 UEFI open close Slight abnormality 5 max efficiency 2133 close 115200 Legacy open close Severe abnormalities
[0106] Step a2: determining the characteristic variables and the target variables for classification based on the training set, wherein the training set includes a plurality of training samples, and the target variable is the risk result corresponding to the configuration in the execution training sample.
[0107] Exemplarily, as shown in Table 1, the training set includes 7 feature variables and 1 target variable. The feature variables are CPU mode configuration (corresponding to CPU in Table 1), memory frequency configuration (corresponding to memory in Table 1), hard disk port switch (corresponding to hard disk in Table 1), serial port configuration option (corresponding to serial port in Table 1), boot mode type (corresponding to mode in Table 1), network configuration switch (corresponding to network in Table 1), and USB configuration switch (corresponding to USB in Table 1).
[0108] The target variable is the risk result corresponding to the configuration in the training sample, that is, the configuration in the training sample is executed, and the switch device status (corresponding to the final status in Table 1).
[0109] The target variable can be no abnormal risk, potential slight abnormal risk, or potential severe abnormal risk.
[0110] The CPU mode configuration may include max performance and max efficiency as shown in Table 1, ie, maximum power consumption mode and maximum efficiency mode.
[0111] The memory frequency configuration may include multiple memory frequencies. For example, as shown in Table 1, two types of memory frequencies may be included: 2133 and 1633.
[0112] The serial port configuration options may include multiple baud rates. For example, as shown in Table 1, the baud rates may be 115200 and 9600.
[0113] The boot mode type may include multiple boot types. For example, as shown in Table 1, it may include two boot types: BIOS UEFI and Legacy.
[0114] The hard disk port switch, network configuration switch and USB configuration switch all have two states: on and off.
[0115] Step a3: Determine the information gain of each feature variable based on the training set and the feature variables.
[0116] Among them, this embodiment generates a target classifier through a decision tree algorithm. Decision tree is a common classification model, which is widely used in many industries such as financial risk control and medical auxiliary diagnosis. The core idea of decision tree is to divide data based on tree structure. Due to the nonlinear relationship between independent variables and dependent variables in the decision tree model and the simple calculation method of decision tree, it has become the most widely used base model in ensemble learning.
[0117] The decision tree algorithm is a commonly used machine learning algorithm, which belongs to the classification and regression algorithm in supervised learning. It is mainly used to deal with classification problems. It divides the data set into different categories through a series of questions (i.e. nodes in the tree) and corresponding answers (i.e. branches of the nodes). When a new data point enters the model, the model will traverse along the nodes and branches in the tree and finally reach a leaf node. The category represented by the leaf node is the model's prediction result for the new data point.
[0118] It should be noted that information gain is an important indicator for feature selection in the decision tree algorithm. It measures the degree of reduction in the entropy of the training set before and after the training set is split. In the decision tree, entropy is a key concept used to measure the degree of chaos or uncertainty in the data set, that is, the degree of chaos in each category in the data set. When all the data in the data set belongs to the same category, the entropy is 0, indicating that the data set is completely ordered and there is no uncertainty. The entropy value range is between 0 and 1. The larger the value, the higher the degree of chaos in the data set. Features correspond to the aforementioned feature variables.
[0119] In other words, information gain indicates the degree to which the uncertainty of the training set is reduced due to the addition of a certain feature.
[0120] After obtaining the training set and multiple feature variables, the information gain of each feature variable is determined according to the training set and the feature variables.
[0121] Step a4: Based on the information gain of each feature variable, select the feature variable with the largest information gain as the split point.
[0122] After obtaining the information gain of each feature variable, the feature variable with the largest information gain is screened out, and the feature variable with the largest information gain is used as the split point.
[0123] Step a5: divide the training set based on the splitting points to obtain several training subsets.
[0124] Among them, after screening out the feature variable with the largest information gain, the feature variable with the largest information gain is used as a split point to divide the training set to obtain several training subsets.
[0125] Step a6: for any training subset, determine whether the values of the target variables of the training samples in the training subset are the same.
[0126] For any training subset, it is determined whether the values of the target variables of the training samples in the training subset are the same, that is, whether each training sample in the current training subset belongs to the same category.
[0127] Step a7: when the values of the target variables of the training samples in any training subset are the same, stop dividing the training set and obtain the target classifier.
[0128] When the values of the target variables of the training samples in any training subset are the same, it is determined that the training samples in each current training subset belong to the same category, and there is no need to continue dividing the training set. The decision tree obtained at this time is used as the target classifier.
[0129] The configuration anomaly prediction method provided in this embodiment uses the BIOS configuration combination as the feature variable and the final state of the device as the target variable to collect information as the training set to train the model, and automatically selects the most important feature variables as split points by calculating the information gain, thereby reducing the need for manual feature selection and ensuring the efficiency and accuracy of the model. Through automated feature selection and efficient model building process, a powerful and easy-to-understand classification method is provided.
[0130] The artificial intelligence algorithm is used to collect historical configuration data and configuration information when anomalies occur as a training set to establish a decision tree model, which links the configuration under SETUP with potential abnormalities. That is, the model determines the current configuration and throws out prompt information that may cause device abnormalities, which is pushed to the serial port in the form of DEBUG information. In the case that the configuration may cause potential serious abnormalities, the configuration item is frozen so that it cannot take effect, and the user is promptly reminded of the current abnormalities and possible consequences.
[0131] Predictions based on historical configuration data can help identify configuration combinations that are prone to failure, thereby avoiding the use of these configurations and reducing the probability of failure.
[0132] In some optional implementations, the configuration anomaly prediction method further includes:
[0133] Step b1, when there are different values of the target variable of the training samples in any training subset, obtain the information gain of other feature variables except the feature variable corresponding to the split point.
[0134] Among them, if there are different values of the target variables of the training samples in any of the multiple divided training subsets, it means that there is a certain uncertainty in the current training set. In this case, the feature variables that have been used for splitting, that is, the feature variables corresponding to the splitting point, are excluded to obtain other feature variables except the feature variables corresponding to the splitting point.
[0135] For any characteristic variable among the other characteristic variables, the information gain of the characteristic variable is determined. It can be understood that the information gain calculated at this time is calculated based on the currently generated decision tree.
[0136] Step b2: Based on the information gain of other feature variables except the feature variable corresponding to the split point, the feature variable with the largest information gain is selected from other feature variables as the next split point.
[0137] Among them, after obtaining the information gain of each feature variable among other feature variables, the feature variable with the largest information gain is selected from other feature variables as the next split point.
[0138] Step b3: continue to divide the training set based on the next split point to obtain several training subsets.
[0139] The next split point is used to further divide the training set based on the previously obtained decision tree to obtain several training subsets.
[0140] Step b4, returning to the step of executing, for any training subset, determining whether the values of the target variables of the training samples in the training subset are the same.
[0141] After obtaining several training subsets, the process returns to execute the step of determining whether the values of the target variables of the training samples in any training subset are the same, and the steps after this step until the training samples in each training subset belong to the same category.
[0142] It should be noted that if all the feature variables used for classification are used as splitting points, and the training samples in each training subset still do not belong to the same category, then for any training subset, the number of occurrences of different target variable values corresponding to the training samples in the training subset is counted, and the value of the target variable with the largest number of occurrences is used as the category corresponding to the training subset.
[0143] The configuration anomaly prediction method provided in this embodiment determines that the splitting has not been completed when the values of the target variables of the training samples in any training subset are different, continues to obtain the next best splitting point, and continues to divide the training set, thereby increasing the classification accuracy, reducing category confusion, and ensuring the classification accuracy of the target classifier.
[0144] In some optional implementations, the above step a3 includes:
[0145] Step a31, for any feature variable, obtain the first information entropy of the target variable in the training set when the feature variable is not used as a split point.
[0146] The above entropy is information entropy, also called Shannon entropy.
[0147] The information gain of the feature variable is determined by calculating the information entropy of the target variable in the training set before and after taking the feature variable as the split point.
[0148] First, the first information entropy of the target variable in the training set is obtained without using the feature variable as the splitting point.
[0149] Step a32, obtaining the second information entropy of the target variable in the training set when the feature variable is used as the splitting point.
[0150] The second information entropy of the target variable in the training set is obtained when the feature variable is used as the splitting point.
[0151] It can be understood that when calculating the information gain of the feature variable, the feature variable is not actually split as the splitting point, but it is just assumed that the feature variable is used as the splitting point to calculate the information gain of the feature variable.
[0152] Step a33: determining the information gain of the feature variable based on the first information entropy and the second information entropy.
[0153] After obtaining the first information entropy and the second information entropy, the difference obtained by subtracting the second information entropy from the first information entropy is the information gain of the feature variable.
[0154] The configuration anomaly prediction method provided in this embodiment can quantify the contribution of each feature to the classification task by calculating information gain. Features with large information gain are considered to be more valuable in the classification process because they can effectively reduce the uncertainty of the target variable (i.e., information entropy). This helps the algorithm automatically select the features that are most helpful for classification decisions, reducing the subjectivity and potential errors of manually selecting features.
[0155] In some optional implementations, the above step a32 includes:
[0156] Step a321, when the feature variable is used as the splitting point, obtain the probability of the target variable in the training set corresponding to different values.
[0157] In which, when the feature variable is used as the splitting point, the probability of each value of the target variable corresponding to different values in the training set is obtained.
[0158] Step a322, determining a second information entropy of the target variable in the training set based on the probabilities of the target variable in the training set corresponding to different values.
[0159] After obtaining the probability that the target variable in the training set corresponds to each of the different values when the feature variable is used as the splitting point, the second information entropy of the target variable in the training set is determined based on the probability that the target variable in the training set corresponds to the different values.
[0160] It can be understood that when the feature variable is not used as the splitting point, the method for obtaining the first information entropy of the target variable in the training set is similar to the method for obtaining the second information entropy of the target variable in the training set when the feature variable is used as the splitting point, and will not be repeated here.
[0161] Specifically, the Shannon entropy can be determined by the following procedure:
[0162] def calcShannonEnt(dataSet):
[0163] # Find the length of the list, indicating the amount of data involved in the training
[0164] numEntries = len(dataSet)
[0165] # Count the number of times the target variable appears
[0166] labelCounts = {}
[0167] # the number of unique elements and their occurrence
[0168] for featVec in dataSet:
[0169] # Store the label of the current instance, that is, the last data in each row of data represents the label
[0170] currentLabel = featVec[-1]
[0171] # Create dictionaries for all possible categories. If the current key value does not exist, expand the dictionary and add the current key value to the dictionary. Each key value records the number of times the current category appears.
[0172] if currentLabel not in labelCounts.keys():
[0173] labelCounts[currentLabel] = 0
[0174] labelCounts[currentLabel] += 1
[0175] # For the proportion of label tags, find the Shannon entropy of the target variable label
[0176] shannonEnt = 0.0
[0177] for key in labelCounts:
[0178] # Calculate the probability of category occurrence using the frequency of occurrence of all class labels.
[0179] prob = float(labelCounts[key]) / numEntries
[0180] # Calculate Shannon entropy and find the logarithm with base 2
[0181] shannonEnt -= prob×log(prob, 2)
[0182] return shannonEnt
[0183] The program calculates entropy based on the data in Table 1, and passes the entropy value into the decision tree algorithm program.
[0184] The decision tree algorithm program logic is as follows:
[0185] If each sample in the current dataset belongs to the same class:
[0186] Return to this category and the program ends
[0187] Otherwise, if all features are used:
[0188] Returns the category with the largest number of samples in the data set, and the program ends
[0189] otherwise:
[0190] Choose the next feature to split the dataset into (based on the amount of entropy reduction)
[0191] Divide the dataset and create branches
[0192] For each partitioned subset
[0193] Call this function again
[0194] Add the results to the branch
[0195] Return to the current branch and the program ends
[0196] The configuration anomaly prediction method provided in this embodiment uses Shannon entropy as a measurement standard to construct a decision tree and uses a decision tree algorithm to predict the final state of the device for each BIOS configuration combination.
[0197] By calculating the second information entropy based on feature splitting, we can directly measure the reduction in uncertainty of the target variable after the introduction of the split point. This step is the core of information gain calculation and ensures the rationality of the split, that is, selecting features that can minimize classification confusion.
[0198] In some optional implementations, before determining the feature variables and the target variables for classification based on the training set, configuring the anomaly prediction method further includes:
[0199] Step c1, discretize the numerical data in the training set to obtain the nominal data required for building a decision tree.
[0200] Among them, since the tree construction algorithm is only applicable to nominal data, the numerical data must be discretized. That is, after obtaining the training set, the numerical data in the training set is discretized to obtain nominal data.
[0201] The numerical data in the training set are discretized, that is, each characteristic variable in Table 1 is configured with 0, 1, 2, etc. as the nominal. For example, the numerical data corresponding to the characteristic variables in Table 1 are discretized to obtain the nominal data as shown below:
[0202] def create_dataset():
[0203] dataset = [[0, 0, 0, 0, 0, 0, 0],
[0204] [1, 1, 1, 0, 0, 1,0],
[0205] [0, 1, 0, 1, 0, 1,0],
[0206] [0, 1, 0, 0, 0, 0,1],
[0207] [1, 1, 1, 0, 1, 0,1]]
[0208] features = ['noabnormalities ', 'serious abnormality', 'seriousabnormality', 'minor abnormalities', 'serious abnormality']
[0209] return dataset,features
[0210] The configuration anomaly prediction method provided in this embodiment discretizes the numerical data in the training set, making the constructed decision tree model simpler, easier to understand and implement. Discretization can also reduce sensitivity and improve the stability of the model and its robustness in the face of noisy data.
[0211] In some optional implementations, the configuration anomaly prediction method further includes:
[0212] Step d1, when the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, a first alarm message is generated and pushed to the corresponding serial port, so that the user determines that the current configuration has a first abnormal risk based on the first alarm message.
[0213] Wherein, when the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, the BIOS will push the first alarm information in the form of debug info to the corresponding serial port through the serial port redirection device. The first alarm information may be "The current configuration may cause severe abnormalities in the device" so that the user can determine that the current configuration has a first abnormal risk based on the first alarm information.
[0214] It is understandable that when the risk prediction result indicates that the switch device has the first abnormal risk after executing the current configuration, the BIOS forcibly executes the discard change to restore the configuration while printing debug info to ensure the safe operation of the device.
[0215] The configuration anomaly prediction method provided in this embodiment can ensure that the user is aware of the high risks that may be caused by the configuration operation at the first time by immediately generating an alarm message when it is predicted that the switch device has a first abnormality risk after executing the current configuration, thereby providing the possibility for taking timely measures.
[0216] In some optional implementations, the configuration anomaly prediction method further includes:
[0217] Step e1, when the risk prediction result indicates that the switch device has a second abnormal risk after executing the current configuration, generate second alarm information and push the second alarm information to the corresponding serial port, so that the user determines that the current configuration has a second abnormal risk based on the second alarm information.
[0218] Among them, when the risk prediction result indicates that the switch device has a second abnormal risk after executing the current configuration, the BIOS will push the second alarm information to the corresponding serial port in the form of debug info through the serial port redirection device. The first alarm information can be "The current configuration may cause slight abnormalities in the device", so that the user can determine that the current configuration has a second abnormal risk based on the second alarm information.
[0219] The configuration anomaly prediction method provided in this embodiment can ensure that the user is aware of the lower risks that may be caused by the configuration operation at the first time by immediately generating an alarm message when it is predicted that the switch device has a second abnormality risk after executing the current configuration, thereby providing the possibility for taking timely measures.
[0220] In some optional implementations, the configuration anomaly prediction method further includes:
[0221] Step f1: when the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, first abnormal information is generated, and the first abnormal information and the current configuration are combined into a first configuration file.
[0222] Wherein, when the risk prediction result indicates that after executing the current configuration, the switch device has a first abnormal risk, it is determined that the abnormal risk is identified. The BIOS combines the first abnormal information and the current configuration into a first configuration file, the first abnormal information is that after executing the current configuration, the switch device has a first abnormal risk, and the current configuration is a configuration modified and saved by the current user.
[0223] Step f2: save the first configuration file to a first preset directory of the baseboard management controller.
[0224] The BIOS communicates with the BMC through the internal network of the switch and transfers the first configuration file to the directory specified by the BMC for storage. The first preset directory is set by a technician or a user. The first configuration file is saved in the first preset directory of the baseboard management controller for reference in future location analysis and continuous learning optimization.
[0225] Step f3: when the risk prediction result indicates that the switch device has a second abnormal risk after executing the current configuration, second abnormal information is generated, and the second abnormal information and the current configuration are combined into a second configuration file.
[0226] Wherein, when the risk prediction result indicates that the switch device has a second abnormal risk after executing the current configuration, it is determined that the abnormal risk is identified. The BIOS combines the second abnormal information and the current configuration into a second configuration file, wherein the second abnormal information indicates that the switch device has a second abnormal risk after executing the current configuration, and the current configuration is a configuration modified and saved by the current user.
[0227] Step f4, saving the second configuration file to a second preset directory of the baseboard management controller.
[0228] The BIOS communicates with the BMC through the switch internal network and transfers the second configuration file to the BMC specified directory for storage. The second preset directory is set by the technician or user. The second configuration file is saved to the second preset directory of the baseboard management controller for reference in future location analysis and continuous learning optimization.
[0229] The configuration anomaly prediction method provided in this embodiment provides detailed and structured data support for subsequent analysis and troubleshooting by generating a first configuration file including first anomaly information and the current configuration and a second configuration file including second anomaly information and the current configuration, and saving the first configuration file and the second configuration file to a directory corresponding to the baseboard management controller, and can also serve as a reference for future positioning analysis and continuous learning optimization.
[0230] The configuration anomaly prediction method provided in this embodiment can make full use of the historical data of BIOS configuration, convert it into valuable prediction information, and maximize the value of data. As data continues to accumulate, the system can continue to learn and optimize the prediction model to improve prediction accuracy and reliability.
[0231] In some optional implementations, the configuration anomaly prediction method further includes:
[0232] Step g1, when the switch state of the configuration prediction option is off, in response to the user's configuration modification and saving operation, execute the current configuration.
[0233] Among them, the switch status of the configuration prediction option is off, which means that configuration prediction protection is not required. That is, when the user performs a configuration modification and save operation, there is no need to perform abnormal risk prediction on the configuration modified and saved by the user, and the configuration modified and saved by the user can be directly executed.
[0234] Understandably, turning off the configuration prediction option is suitable for scenarios where the user is confident that the configuration modification is correct or a configuration change is urgently needed.
[0235] It should be noted that the specific implementation method of adding the configuration prediction option, i.e., the configuration prediction protection menu function option, to the BIOS is as follows:
[0236] oneofvarid = SETUP_DATA.ConfigPredictProtect,
[0237] questionid = AUTO_ID(ConfigPredictProtect_CONTROL_KEY),
[0238] prompt = STRING_TOKEN(STR_ConfigPredictProtect_PROMPT),
[0239] help = STRING_TOKEN(STR_ConfigPredictProtect_MODE_HELP),
[0240] option text = STRING_TOKEN(STR_DISABLED), value = 0, flags =INTERACTIVE | RESET_REQUIRED | MANUFACTURING | DEFAULT;
[0241] option text = STRING_TOKEN(STR_ENABLED), value = 1, flags =INTERACTIVE | RESET_REQUIRED;
[0242] endoneof;
[0243] By default, the switch state of the configuration prediction option is turned on, that is, the promptstring token is set to 1 by default. If the user chooses to turn off the function, that is, the switch state of the configuration prediction option is turned off, the relevant token will be set to 0.
[0244] It should be noted that when the function is turned on, that is, when the switch state of the configuration prediction option is turned on, when the user modifies any configuration and executes save&reset (save and restart) or save&exit (save and exit), the value of the prompt token corresponding to the target configuration in the current configuration is read, and the decision tree algorithm is executed to predict which state the device state will be after this configuration combination takes effect: no abnormal risk, potential minor abnormal risk, or potential severe abnormal risk. Corresponding to the aforementioned steps S202 and S203, the detailed description is not repeated here.
[0245] The configuration anomaly prediction method provided in this embodiment allows the user to directly perform configuration modification and save when the configuration prediction option is turned off, giving the user higher control and flexibility. The user can choose whether to enable the configuration prediction option according to actual conditions and needs, avoiding the forced intervention of the configuration prediction system and improving the user experience.
[0246] In some optional implementations, after obtaining the training set, the configuration anomaly prediction method further includes:
[0247] Step h1: clean the training set data.
[0248] Specifically, it is detected whether there are repeated training samples in the training set. If there are repeated training samples in the training set, for the repeated training samples, one repeated training sample is retained and the redundant training samples are deleted.
[0249] Check whether there is noise data in the training set. If there is noise data in the training set, delete or correct the noise data.
[0250] Among them, noise data refers to data that is obviously different from other data or does not meet expectations.
[0251] Step h2: Process missing values in the training set.
[0252] Specifically, for any training sample, if the training sample has missing values, the training sample is deleted.
[0253] It should be noted that this method is often applicable to situations where the proportion of training samples with missing values is small.
[0254] or,
[0255] For any training sample, if the training sample has missing values, the missing values of the training sample are filled using the preset values.
[0256] It should be noted that the preset value is determined by technical personnel based on past experience.
[0257] The configuration anomaly prediction method provided in this embodiment ensures the quality and reliability of the training set by performing data cleaning and missing value processing on the training set, reduces the impact of noise on the model, and thus improves the performance and accuracy of the model.
[0258] The embodiment of the present invention also provides a configuration abnormality prediction method, which can be used in a basic input and output system in a switch device. Figure 3 is a flowchart of a configuration anomaly prediction method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0259] The first step is to upload the training set and perform sample training.
[0260] The second step is to generate a classifier using the decision tree algorithm.
[0261] Corresponding to the aforementioned steps a1 to a7, for detailed description, please refer to the description of the aforementioned steps a1 to a7, which will not be repeated here.
[0262] The third step is to integrate the classifier into the BIOS version, that is, to encapsulate the target classifier and configuration prediction options in the BIOS.
[0263] The fourth step is to determine whether to enable configuration prediction protection, that is, to determine whether the switch status of the configuration prediction option is enabled.
[0264] When the configuration prediction protection is turned on, that is, when the switch state of the configuration prediction option is turned on, if the user modifies the configuration, the classifier is used to identify whether the current configuration is an abnormal configuration. That is, in response to the user's configuration modification and save operation, the current configuration is determined, the target configuration corresponding to the target feature in the current configuration is obtained, the target configuration is input into the target classifier, and the risk prediction result of executing the current configuration is obtained.
[0265] When configuration prediction protection is not enabled, that is, when the switch state of the configuration prediction option is off, if the user modifies the configuration, the user's modified configuration is saved and the configuration takes effect. That is, when the switch state of the configuration prediction option is off, in response to the user's configuration modification and save operation, the current configuration is executed.
[0266] In the fifth step, when the classifier identifies that the current configuration is an abnormal configuration, it pushes a message and freezes the configuration, and the configuration does not take effect.
[0267] Corresponding to the above, when the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, the current configuration is refused to be executed. When the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, a first alarm message is generated and the first alarm message is pushed to the corresponding serial port, so that the user determines that the current configuration has a first abnormal risk based on the first alarm message. For a detailed description, please refer to the above, which will not be repeated here.
[0268] When the classifier identifies the current configuration as a non-abnormal configuration, the configuration takes effect.
[0269] Corresponding to the above, when the risk prediction result indicates that the current configuration is executed and the switch device has no abnormal risk or has a second abnormal risk, the current configuration is executed. Detailed description is referred to above and will not be repeated here.
[0270] The configuration anomaly prediction method provided in this embodiment predicts the risk of the configuration modified and saved by the user when the user modifies and saves the configuration, and determines whether to execute the configuration modified and saved by the user based on the risk prediction result. If it is predicted that the switch has a serious abnormality risk after executing the current configuration, the current configuration is refused to be executed. The time cost and labor cost of exception handling are reduced, and the security of the switch equipment is improved.
[0271] It should be noted that the configuration anomaly prediction method provided in this embodiment is not only applicable to the switch BIOS end, but any device that uses BIOS to boot the operating system can use the configuration anomaly prediction method to predict configuration anomalies.
[0272] An embodiment of the present invention further provides a switch device, which includes a basic input and output system. The basic input and output system performs configuration abnormality prediction based on the method shown in the above embodiment.
[0273] The embodiment of the present invention also provides a computer device, see Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4As shown, the computer device includes: one or more processors 401, memory 402, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component utilizes different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as required. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 401 is taken as an example.
[0274] The processor 401 may be a central processing unit, a network processor or a combination thereof. The processor 401 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0275] The memory 402 stores instructions executable by at least one processor 401 , so that the at least one processor 401 executes the method shown in the above embodiment.
[0276] The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0277] The memory 402 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 402 may also include a combination of the above types of memory.
[0278] The computer device also includes a communication interface 403, which is used for the computer device to communicate with other devices or a communication network.
[0279] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0280] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0281] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A configuration anomaly prediction method, characterized in that: Applied to a basic input and output system, the method comprises: Get the switch status of the configuration prediction option; When the switch state of the configuration prediction option is turned on, in response to a configuration modification and saving operation by a user, determining a current configuration, and acquiring a target configuration corresponding to a target feature in the current configuration, wherein the target feature is a feature variable corresponding to a split point in a target classifier; Inputting the target configuration into a target classifier to obtain a risk prediction result of executing the current configuration; If the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, the current configuration is refused to be executed.
2. The method according to claim 1, characterized in that Before inputting the target configuration into a target classifier, the method further comprises: Get the training set; Based on the training set, determining a feature variable for classification and a target variable for classification, wherein the training set includes a plurality of training samples, and the target variable is a risk result corresponding to executing a configuration in the training sample; Based on the training set and the feature variables, determining the information gain of each feature variable; Based on the information gain of each of the feature variables, the feature variable with the largest information gain is selected as a split point; Divide the training set based on the split point to obtain several training subsets; For any training subset, determine whether the values of the target variables of the training samples in the training subset are the same; When the values of the target variables of the training samples in any training subset are the same, stop dividing the training set and obtain the target classifier.
3. The method according to claim 2, characterized in that The method further comprises: When there are different values of the target variable of the training samples in any training subset, obtain the information gain of other feature variables except the feature variable corresponding to the split point; Based on the information gain of other feature variables except the feature variable corresponding to the split point, the feature variable with the largest information gain is selected from the other feature variables as the next split point; Continue to divide the training set based on the next split point to obtain a plurality of training subsets; Return to execute the step of determining, for any training subset, whether the values of the target variables of the training samples in the training subset are the same.
4. The method according to claim 2, characterized in that: The determining, based on the training set and the feature variables, the information gain of each feature variable comprises: For any characteristic variable, obtaining a first information entropy of the target variable in the training set without using the characteristic variable as a split point; Acquire a second information entropy of the target variable in the training set when the feature variable is used as a split point; Based on the first information entropy and the second information entropy, an information gain of the feature variable is determined.
5. The method according to claim 4, characterized in that The obtaining, when the feature variable is used as a split point, a second information entropy of the target variable in the training set includes: When the feature variable is used as a split point, obtaining the probability of the target variable in the training set corresponding to different values; Based on the probabilities that the target variable in the training set corresponds to different values, a second information entropy of the target variable in the training set is determined.
6. The method according to claim 2, characterized in that Before determining the feature variables and the target variables for classification based on the training set, the method further includes: The numerical data in the training set is discretized to obtain the nominal data required for building a decision tree.
7. The method according to claim 1, characterized in that The method further comprises: When the risk prediction result indicates that after the current configuration is executed, the switch device has no abnormal risk or has a second abnormal risk, the current configuration is executed, wherein the risk level of the second abnormal risk is lower than the risk level of the first abnormal risk.
8. The method according to claim 1, characterized in that The method further comprises: When the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, a first alarm message is generated and pushed to the corresponding serial port, so that the user determines that the current configuration has a first abnormal risk based on the first alarm message.
9. The method according to claim 1, characterized in that: The method further comprises: When the risk prediction result indicates that the switch device has a second abnormal risk after executing the current configuration, a second alarm message is generated and pushed to the corresponding serial port, so that the user determines that the current configuration has a second abnormal risk based on the second alarm message.
10. The method according to claim 1, characterized in that The method further comprises: If the risk prediction result indicates that the switch device has a first abnormal risk after executing the current configuration, generating first abnormal information, and combining the first abnormal information and the current configuration into a first configuration file; Saving the first configuration file to a first preset directory of the baseboard management controller; If the risk prediction result indicates that the switch device has a second abnormal risk after executing the current configuration, generating second abnormal information, and combining the second abnormal information and the current configuration into a second configuration file; The second configuration file is saved in a second preset directory of the baseboard management controller.
11. The method according to claim 1, characterized in that: The method further comprises: When the switch state of the configuration prediction option is off, in response to the user's configuration modification and saving operation, the current configuration is executed.
12. A switch device, characterized in that: include: A basic input-output system, wherein the basic input-output system performs configuration anomaly prediction based on the method according to any one of claims 1 to 11.
13. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the configuration anomaly prediction method according to any one of claims 1 to 11 by executing the computer instructions.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the configuration abnormality prediction method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the configuration abnormality prediction method according to any one of claims 1 to 11.
