Hard disk information synchronization method and device, equipment, storage medium and product
By reading the hard disk port information in the CPLD register of the server backplane and reordering the hard disk asset information, the problem of inconsistent hard disk serial numbers under BMC, BIOS and operating systems is solved, the synchronization and consistency of hard disk information is achieved, and the operation and maintenance operations are simplified .
Patent Information
- Application Number
- CN202411517039.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-18
AI Technical Summary
The hard disk serial numbers in the list of hard disk information arranged under BMC, BIOS and operating systems are inconsistent, resulting in troubles in the hard disk maintenance operations of operation and maintenance personnel.
By reading hard disk port information from the CPLD register in the server backplane and reordering the hard disk asset information pushed by the BIOS based on this information, a hard disk information list is constructed to achieve synchronization of hard disk information.
Ensure that the hard disk serial numbers of the hard disk information list in BMC, BIOS and operating systems are consistent, simplifying the operation and maintenance personnel's operations in hard disk maintenance operations and improving maintenance efficiency.
Smart Images

Figure CN119473411A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to hard disk information synchronization methods, devices, equipment, storage media and products. Background Art
[0002] The Baseboard Management Controller (BMC) is an important module in server hardware. As the core of server management, it provides support for hardware monitoring, remote management, fault diagnosis, etc. The BMC module is usually integrated directly into the server motherboard as an independent chip or integrated circuit.
[0003] However, the BMC cannot obtain the port (CPU Port) information of the hard disk relative to the central processing unit (Central Processing Unit) by itself, and it is inconsistent with the CPU Port information and hard disk serial number obtained by the Basic Input Output System (BIOS). Each obtains it in its own polling method. This results in different hard disk serial numbers in the hard disk information lists arranged under the BMC, BIOS, and operating system (Operating System, OS). If the operation and maintenance personnel use or maintain the hard disk device under the OS, it will be different from the actual hard disk position, or the hard disk position displayed in the BMC interface. The inconsistency of the hard disk serial number will bring a lot of trouble to the operation and maintenance, which is a major pain point faced by the operation and maintenance personnel in hard disk maintenance operations. Summary of the invention
[0004] The main purpose of the present application is to provide a hard disk information synchronization method, device, equipment, storage medium and product, aiming to solve the technical problem of the hard disk serial number being out of sync in the hard disk information list arranged by the BMC, BIOS and OS.
[0005] To achieve the above-mentioned purpose, the present application proposes a hard disk information synchronization method, which is applied to a baseboard controller in a server;
[0006] The method comprises:
[0007] Reading hard disk port information from a register of a CPLD in a server backplane, wherein the CPLD stores the hard disk port information sent by a central processing unit through a system management bus in the register;
[0008] reordering the hard disk asset information pushed by the BIOS based on the hard disk port information;
[0009] The hard disk monitoring information is assembled with the reordered hard disk asset information to construct a hard disk information list, so that the BIOS and the operating system in the server synchronize the hard disk information according to the hard disk information list.
[0010] Optionally, an intelligent detection model is provided in the substrate controller;
[0011] After assembling the hard disk monitoring information and the re-ordered hard disk asset information to construct the hard disk information list, the method further includes:
[0012] Performing hard disk status prediction based on the hard disk information list by using the intelligent detection model to generate a hard disk status prediction result;
[0013] Determining whether a hard disk in the server is abnormal according to the hard disk status prediction result;
[0014] When an abnormality occurs, hard disk alarm information is generated, and an alarm prompt is given based on the hard disk alarm information.
[0015] Optionally, the performing hard disk status prediction based on the hard disk information list by the intelligent detection model and generating a hard disk status prediction result further includes:
[0016] Splitting the hard disk information data set into a training sample set and a verification sample set, wherein the hard disk information sample set includes a plurality of hard disk information samples, and the hard disk information samples include hard disk detailed information and sample labels, and the format of the hard disk detailed information is consistent with the format of the information in the hard disk information list;
[0017] Perform cross-validation based on the training sample set and the validation sample set to determine the target number of decision trees;
[0018] Building an initial detection model based on the target number of decision trees, wherein the initial detection model includes decision trees whose number is consistent with the target number of decision trees;
[0019] The initial detection model is trained according to the hard disk information data set to obtain an intelligent detection model.
[0020] Optionally, performing cross-validation based on the training sample set and the validation sample set to determine the target number of decision trees includes:
[0021] Traverse the preset number of candidates to be selected to obtain the current number of candidates to be selected;
[0022] Training a multiple decision tree model based on the training sample set, wherein the multiple decision tree model includes decision trees whose number is consistent with the current number to be selected;
[0023] Perform multi-fold cross validation on the multiple decision tree model based on the validation sample set to obtain a model performance score corresponding to each fold;
[0024] Construct the overall performance score of the model corresponding to the current number of candidates based on the model performance scores corresponding to each fold;
[0025] At the end of the traversal, the overall performance score of the model corresponding to each candidate quantity in the preset candidate quantity set is obtained;
[0026] According to the overall performance score of the model corresponding to each candidate quantity, the target number of decision trees is selected from each candidate quantity.
[0027] Optionally, performing multi-fold cross validation on the multiple decision tree model based on the validation sample set to obtain a model performance score corresponding to each fold includes:
[0028] Splitting the validation sample set into multiple sample subsets according to the number of folds of multi-fold cross validation, and numbering the multiple sample subsets;
[0029] Loop based on the fold and obtain the current fold;
[0030] Using a sample subset whose number is consistent with the current fold number among the multiple sample subsets as a validation subset, and using other subsets among the multiple sample subsets except the validation subset as training subsets;
[0031] Further training the multiple decision tree model according to the training subset;
[0032] Verifying the further trained multiple decision tree model based on the verification subset, and generating a model performance score corresponding to the current fold;
[0033] At the end of the cycle, the model performance scores corresponding to each fold are obtained.
[0034] Optionally, selecting the target number of decision trees from each candidate number according to the overall performance score of the model corresponding to each candidate number includes:
[0035] Obtaining an evaluation rule for the overall performance score of the model;
[0036] Determine a sorting rule based on the merit evaluation rule;
[0037] Based on the sorting rules and the overall performance scores of the models corresponding to the quantities to be selected, sorting the quantities to be selected;
[0038] The number of candidates ranked first in the sorting results is selected as the target number of decision trees.
[0039] In addition, to achieve the above purpose, the present application also proposes a hard disk information synchronization device, the device comprising:
[0040] A reading module is used to read hard disk port information from a register of a CPLD in a server backplane, wherein the CPLD stores the hard disk port information sent by the central processing unit through a system management bus into the register;
[0041] A sorting module, used for re-sorting the hard disk asset information pushed by the BIOS based on the hard disk port information;
[0042] The construction module is used to assemble the hard disk monitoring information and the re-ordered hard disk asset information to construct a hard disk information list so that the BIOS and the operating system in the server synchronize the hard disk information according to the hard disk information list.
[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a hard disk information synchronization device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the hard disk information synchronization method as described above.
[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the hard disk information synchronization method as described above are implemented.
[0045] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the hard disk information synchronization method described above are implemented.
[0046] One or more technical solutions proposed in this application have at least the following technical effects:
[0047] Through the transformation, the BMC can use the register of the CPLD to obtain the hard disk port information, and re-arrange and integrate the hard disk information based on the hard disk port information to build a hard disk information list, ensuring that both the BIOS and the operating system can use the hard disk information list to synchronize the hard disk information and ensure that the hard disk ordering among the three is consistent. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0050] Figure 1 A flowchart of the first embodiment of the hard disk information synchronization method of the present application is provided;
[0051] Figure 2 A schematic diagram of a server including functional modules according to an embodiment of the present application;
[0052] Figure 3 A flowchart of the second embodiment of the hard disk information synchronization method of the present application is provided;
[0053] Figure 4 This is a schematic diagram of the module structure of the hard disk information synchronization device according to an embodiment of the present application;
[0054] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the hard disk information synchronization method in the embodiment of the present application.
[0055] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0056] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0057] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0058] Based on this, the embodiment of the present application provides a hard disk information synchronization method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the hard disk information synchronization method of the present application.
[0059] In this embodiment, the hard disk information synchronization method includes steps S10 to S30:
[0060] Step S10: Read the hard disk port information from the register of the CPLD in the server backplane.
[0061] It should be noted that the executor of this embodiment can be the server itself or a hard disk information synchronization device arranged in the server. The hard disk information synchronization device can be a baseboard controller (BMC) in the server. In this embodiment and the following embodiments, the hard disk information synchronization method of the present invention is described by taking BMC as an example.
[0062] It should be noted that since the BMC and hard disk hardware link are not directly connected, it is impossible to directly obtain the CPU Port information of the hard disk, and can only rely on other systems or components to obtain this information. However, the BMC and the complex logic element (Complex Programmable Logic Device, CPLD, also known as complex programmable logic device) of the backplane terminal are connected by I2C (Inter-Integrated Circuit) hardware link, and there is a hardware path between the central processing unit (CPU) and the backplane CPLD, so the CPLD can serve as a bridge for the BMC to obtain hard disk information.
[0063] In actual use, the administrator of the hard disk information synchronization device can adjust the central processing unit and complex logic element (CPLD, also known as complex programmable logic device) in the server. After the adjustment, the CPU can transmit the port information of each hard disk in the server to the backplane CPLD firmware through the system management bus (Serial General Purpose Input / Output, SGPIO) signal;
[0064] When the backplane CPLD receives this information, it will store it in the CPLD register in order (for example, the hard disk serial number is from 0 to 11). Taking 0x22 as an example, the register length is 5 bytes, divided into 4 bytes to store port information, and 1 byte for checksum. Each bit can store a port information, such as bit 0 of byte 1 stores CPU0_port0A information, bit 1 stores CPU0_port0B information, and so on.
[0065] Afterwards, the baseboard management controller (BMC) can access the registers in the backplane CPLD as the slave end through the I2C channel as the master end, read the hard disk CPU Port information through the I2C standard interface, and store it in the database in the BMC.
[0066] Step S20: reordering the hard disk asset information pushed by the BIOS based on the hard disk port information.
[0067] It should be noted that the hard disk asset information may include the CPU Port information of the hard disk and the description information of the hard disk, such as capacity, format, SMART status and other information.
[0068] In actual use, when hard disks are mixed, after booting, BIOS sends the hard disk asset information including CPU Port information through the LPC (Low Pin Count) bus or ESPI (Enhanced System Power Interface) standard hardware channel through device polling, and writes the specific asset information data from the I / O port of the KCS (Keyboard Controller Style) module. When data is written, the underlying hardware interrupt takes effect, notifying the BMC to read data from the I / O port of the KCS module, and then pushes it to the BMC upper application through interface functions such as copy_to_user(), thereby pushing the hard disk asset information to the BMC. After receiving the hard disk asset information pushed by BIOS, BMC can match the detailed hard disk asset information of BIOS one by one according to the CPU Port information previously obtained from the backplane CPLD and re-sort it to ensure that the sorted hard disk asset information is in the same order as the CPU Port information.
[0069] Among them, KCS is a communication method in the IPMI (Intelligent Platform Management Interface) protocol, and the KCS module is a functional module for communication built in the server using the KCS protocol.
[0070] Step S30: Assemble the hard disk monitoring information and the reordered hard disk asset information to construct a hard disk information list, so that the BIOS and the operating system in the server synchronize the hard disk information according to the hard disk information list.
[0071] It should be noted that the hard disk monitoring information may include hard disk monitoring status, in-place information and other information. The hard disk monitoring status is used to indicate whether the hard disk is operating normally, such as temperature, voltage status information, etc. The in-place information is used to indicate whether the hard disk is currently correctly installed in the server and whether it is in a normal working state.
[0072] In actual use, the hard disk monitoring information is obtained by the BMC accessing the backplane CPLD register through the I2C channel. The sorting order is consistent with the sorting order of the CPU Port information read from the backplane CPLD register. Therefore, the hard disk asset information re-sorted according to the CPUPort information is actually consistent with the sorting order of the hard disk monitoring information. At this time, they can be assembled according to the sorting order, that is, the hard disk asset information and the hard disk monitoring information at the same sorting position are assembled, and then a hard disk information list can be obtained. The hard disk information list can include the hard disk detailed information of each hard disk, and the sorting of the hard disk information list is consistent with the sorting of the CPU Port information.
[0073] In actual application, BMC can assemble and summarize the hard disk asset information, hard disk monitoring status, in-place information, etc., and generate a sorted hard disk information data structure hard disk information list (unitTable list, list fields can include CPU Port serial number, hard disk monitoring status, etc.). Later, in order to facilitate BIOS and operating system to synchronize hard disk information according to the hard disk information list, BMC can use its own memory space to create a redis database based on the memory data structure, and connect to the redis database for access through the interface function redisConnectUnix(). First, the data is verified and checked. After the check passes, the memory space of the same size is applied according to the size of the hard disk's unitTable list, and the interface function redisBufferWrite() is used to write the key-value pairs into the corresponding memory area applied for redis for storage.
[0074] In actual use, the BIOS can read the hard disk information list periodically (such as every hour) or in a triggered manner (such as monitoring the changes in the hard disk information list in the BMC, and triggering when there is an update). Of course, the BMC can also actively prompt the BIOS to read the hard disk information list, for example: when the hard disk information list is built, a prompt message is sent to the BIOS to prompt it to read the hard disk information list.
[0075] In actual application, BIOS can read the unitTable list in the redis database from BMC through the bottom interface function ReceiveBmcDataFromPort() according to the netfn and cmd id in the IPMI specification. After receiving the IPMI command data, BIOS can store the read unitTable list in the bios memory area, align the hard disk sequence number polled by itself with the BMC (that is, ensure that the hard disk sorting sequence number read by BIOS itself is consistent with the hard disk sorting sequence number in the unitTable list), and then write the IPMI command data into the unitTable table of the corresponding type in BIOS through smbios. The unitTable table in BIOS is accessible to OS. When OS polls this table, it will update the hard disk detailed information under OS according to the order of this table, so that the hard disk information and sequence number queried under OS are also synchronized with BMC, so that operation and maintenance personnel can accurately locate the hard disk from BIOS, BMC or OS to avoid misoperation.
[0076] Of course, after the hard disk information list is built, the BMC can also actively send the hard disk information list to the BIOS. At this time, the BIOS will perform subsequent actions and build the unitTable table to facilitate OS synchronization.
[0077] For ease of understanding, now combined Figure 2 This is for illustration only, but not for limitation. Figure 2 The server of this embodiment includes a schematic diagram of functional modules.
[0078] like Figure 2 As shown, the server may include a BMC module, a BIOS module, a backplane CPLD module, an I / O port module of the KCS, an OS module, a CPU, etc., wherein the functions of each functional module are as follows:
[0079] BMC module: The BMC module implements the consistency synchronization of the three-party data and the centralized storage data structure unitTable and the hard disk intelligent detection module Detect;
[0080] BIOS module: The BIOS module stores hard disk asset information;
[0081] Backplane CPLD module: serves as a bridge for BMC to obtain hard disk information;
[0082] KCS I / O port module: responsible for the transmission of hard disk asset information;
[0083] OS module: stores the synchronized hard disk information for use in hard disk maintenance operations.
[0084] This embodiment provides a hard disk information synchronization method. Through modification, the BMC can use the register of the CPLD to obtain the hard disk port information, and re-arrange and integrate the hard disk information based on the hard disk port information to build a hard disk information list, so as to ensure that both the BIOS and the operating system can use the hard disk information list to synchronize the hard disk information and ensure that the hard disk ordering among the three is consistent.
[0085] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 3 , an intelligent detection model is provided in the baseboard controller. After step S30, the hard disk information synchronization method further includes steps S40 to S60:
[0086] Step S40: predicting the hard disk status based on the hard disk information list by using the intelligent detection model to generate a hard disk status prediction result.
[0087] It should be noted that in order to provide strong support for server hard disk troubleshooting and achieve high-quality and stable operation of the server, artificial intelligence machine learning data mining technology can be used to perform multi-dimensional analysis and mining of the hard disk information data in the hard disk information list table. Based on this, an intelligent detection model can be set in the BMC to gain an in-depth understanding of the server hard disk performance, monitor the health status, and quickly discover potential problems.
[0088] In actual use, the intelligent detection model can predict the hard disk status of each hard disk based on the hard disk detailed information in the hard disk information list, predict whether the hard disk can operate normally, and thus generate a hard disk status prediction result.
[0089] The intelligent detection model may be a multiple decision tree model, such as a random forest model or other similar models, and the intelligent detection model may be set in the BMC as a separate functional module, such as being set in the BMC as an intelligent detection module. The hard disk status prediction result may include the status prediction result corresponding to each hard disk, and the status prediction result may include stable operation, possible abnormality, etc. Of course, it may be further divided, such as divided into stable operation, critical operation, small probability abnormality, high probability abnormality, etc.
[0090] Step S50: determining whether the hard disk in the server is abnormal according to the hard disk status prediction result.
[0091] In actual use, the hard disk status prediction results can be analyzed to obtain the status prediction results corresponding to each hard disk, and based on the status prediction results, it can be determined whether an abnormality may occur if the hard disk continues to run.
[0092] It is understandable that based on the hard disk status prediction results, faulty, damaged, and non-working faulty disks can be quickly discovered. Through this process, not only can the advanced perception of the hard disk monitoring status and advance insight into its potential risks be achieved, but also rapid response can be achieved when the first signs of failure appear, effectively avoiding server performance bottlenecks and even business interruptions caused by hard disk failures, and realizing the transition from passive response to failures to active prevention of failures, thereby achieving rapid and accurate detection of hard disk quality and achieving high-quality server operation.
[0093] Step S60: when an abnormality occurs, hard disk alarm information is generated, and an alarm prompt is given based on the hard disk alarm information.
[0094] In actual use, if an abnormality occurs in the hard disk, it is necessary to prompt the corresponding management personnel to quickly respond accordingly. In order to facilitate the management personnel to confirm the abnormality, a hard disk alarm information can be generated, and an alarm prompt can be issued based on the hard disk alarm information. For example: the hard disk alarm information is pushed to the alarm platform to notify the relevant management personnel. Of course, message push via email, text message, etc. can also be used to notify the relevant management personnel.
[0095] In a specific implementation, in order to ensure the detection effect of the intelligent detection model, before step S40 in this embodiment, the following may also be included:
[0096] Splitting the hard disk information data set into a training sample set and a verification sample set;
[0097] Perform cross-validation based on the training sample set and the validation sample set to determine the target number of decision trees;
[0098] Building an initial detection model based on the target number of decision trees;
[0099] The initial detection model is trained according to the hard disk information data set to obtain an intelligent detection model.
[0100] It should be noted that the hard disk information sample set contains multiple hard disk information samples, and the hard disk information samples include hard disk detailed information and sample labels. The format and content of the hard disk detailed information can be consistent with the format and content of the information in the hard disk information list, so as to ensure that the input data used in model training and analysis are consistent. The initial detection model contains decision trees with the same number as the target decision tree. The target decision tree number can be the optimal decision tree number, that is, when this number of decision trees is used, the model performance of the trained intelligent detection model can be guaranteed to be optimal.
[0101] The training of the initial detection model can be performed in the BMC, that is, in the BMC, the initial detection model is trained with corresponding data until the training is completed and used as the intelligent detection model. If necessary, due to the limited computing power of the BMC, the speed and effect of its training model may not be ideal. At this time, the initial detection model can also be pre-trained in other devices or systems (such as in the corresponding server or computing center), and then the intelligent detection model obtained after the training is completed is set in the BMC.
[0102] In actual use, the hard disk information data set can be split into a training sample set and a verification sample set using a preset ratio. The preset ratio can be set in advance by the administrator of the hard disk information synchronization device, for example, the preset ratio is set to 7:3.
[0103] For example: define the hard disk information data set D disk , D diskIt includes multiple hard disk information samples, and each hard disk information sample includes input features (detailed hard disk information) and target labels; for example: input feature X = {CPU Port, serial number, hard disk monitoring status}, target label Y = {hardware monitoring status}, where the hard disk monitoring status (5 represents healthy, 4 represents sub-healthy, 3 represents potential risk, 2 represents failure, 1 represents invalid failure).
[0104] In actual use, when training the initial detection model, not all data in the hard disk information dataset needs to be used as training samples, and at the same time, not all features necessarily need to be used.
[0105] For example: randomly select m samples from the dataset D that contains a total of N samples disk by sampling with replacement to obtain a training set D that contains m samples; similarly, n features can be randomly selected from the feature set F that contains a total of d features (the feature set F can include all selectable input features), where n < d, so as to obtain a feature set that contains n features; and for the decision tree in the initial detection model, the following steps can be repeatedly executed: train a decision tree T with the selected D and F i and at each node, select the best splitting feature from the n features and split the node according to this feature.
[0106] In a specific implementation, in order to ensure a reasonable determination of the number of target decision trees, the steps of performing cross-validation based on the training sample set and the validation sample set to determine the number of target decision trees may include:
[0107] Traverse the preset set of candidate numbers to obtain the current candidate number;
[0108] Train a multi-decision tree model based on the training sample set, the;
[0109] Perform multi-fold cross-validation on the multi-decision tree model based on the validation sample set to obtain the model performance scores corresponding to each fold;
[0110] Construct the overall model performance score corresponding to the current candidate number according to the model performance scores corresponding to each fold;
[0111] At the end of the traversal, obtain the overall model performance scores corresponding to each candidate number in the preset set of candidate numbers;
[0112] Select the number of target decision trees from each candidate number according to the overall model performance scores corresponding to each candidate number.
[0113] It should be noted that the preset candidate quantity set may include multiple candidate quantities, and the preset candidate quantity set may be pre-set by the administrator of the hard disk information synchronization device. For example, the administrator of the hard disk information synchronization device determines based on experience that the available candidate quantities are 5, 10, 20, 30, etc., then the preset candidate quantity set may be {5, 10, 20, 30}. The multiple decision tree model may be a random forest model, or a similar model, and the multiple decision tree model may include decision trees whose number is consistent with the current candidate quantity, and this embodiment does not limit this. Multi-fold cross validation may be a method of splitting the sample set into multiple subsets and performing multi-level validation.
[0114] In actual use, constructing the overall performance score of the model corresponding to the current number of candidates according to the model performance scores corresponding to each fold can be to obtain the average value of the model performance scores corresponding to each fold, and use the obtained average value as the overall performance score of the model corresponding to the current number of candidates.
[0115] In a specific implementation, each candidate quantity may be sorted based on the overall performance score of the model corresponding to each candidate quantity, and a target decision tree quantity of seats may be selected from each candidate quantity based on the sorting result.
[0116] In a possible implementation of this embodiment, in order to ensure that the model performance score corresponding to each fold can be reasonably determined, the step of performing multi-fold cross-validation on the multi-decision tree model based on the validation sample set to obtain the model performance score corresponding to each fold in this embodiment may include:
[0117] Splitting the validation sample set into multiple sample subsets according to the number of folds of multi-fold cross validation, and numbering the multiple sample subsets;
[0118] Loop based on the fold and obtain the current fold;
[0119] Using a sample subset whose number is consistent with the current fold number among the multiple sample subsets as a validation subset, and using other subsets among the multiple sample subsets except the validation subset as training subsets;
[0120] Further training the multiple decision tree model according to the training subset;
[0121] Verifying the further trained multiple decision tree model based on the verification subset, and generating a model performance score corresponding to the current fold;
[0122] At the end of the cycle, the model performance scores corresponding to each fold are obtained.
[0123] It should be noted that the number of folds of multi-fold cross validation can be pre-set by the administrator of the hard disk information synchronization device, for example: setting the number of folds of multi-fold cross validation to a fixed value, such as 5; or setting the number of folds of multi-fold cross validation to be consistent with the current number of candidates.
[0124] In actual use, the validation sample set is evenly split into multiple sample subsets with the same number of folds as the multi-fold cross-validation folds, and the multiple sample subsets are numbered according to the order of the sample subsets in the validation sample set. The model performance score can be calculated based on the root mean square error (RMSE) formula and / or the coefficient of determination (R2) calculation formula.
[0125] Among them, the RMSE calculation formula can be:
[0126]
[0127] Where n is the number of samples in the validation sample set, y i is the true value of the i-th sample, y i △ is the predicted value. The closer the RMSE is to 0, the better the performance evaluation.
[0128] The R2 calculation formula can be:
[0129]
[0130] Where n is the number of samples in the validation sample set, y i is the true value of the i-th sample, y i △ is the predicted value, y i - is the average value, and the value of R2 ranges from 0 to 1, with values closer to 1 indicating better performance evaluation.
[0131] For ease of understanding, an example is given below, but this solution is not limited to the following:
[0132] Select j-fold cross-validation (for example, j=5), then the number of folds of multi-fold cross-validation is j. At this time, the verification sample set can be divided into j sample subsets. At this time, based on j, a loop can be performed starting with s=1, s is the number of loops, and s is increased by one each time until s equals j, then the loop is stopped. In the loop, the sample subset numbered s can be used as the verification subset, and the remaining j-1 sample subsets can be merged into the training subset. After that, the multi-decision tree model is further trained with the training subset. After that, the verification set is predicted using the further trained model to obtain the predicted value, and the error between the predicted value and the true value is calculated. The model performance score is calculated using the above-mentioned RMSE formula and / or R2 formula to obtain the model performance score corresponding to the sth fold. At the end of the loop, the model performance score corresponding to each fold can be obtained.
[0133] In a possible implementation of this embodiment, in order to ensure that the target number of decision trees is reasonably selected, the step of selecting the target number of decision trees from each candidate number according to the overall performance score of the model corresponding to each candidate number in this embodiment may include:
[0134] Obtaining an evaluation rule for the overall performance score of the model;
[0135] Determine a sorting rule based on the merit evaluation rule;
[0136] Based on the sorting rules and the overall performance scores of the models corresponding to the quantities to be selected, sorting the quantities to be selected;
[0137] The number of candidates ranked first in the sorting results is selected as the target number of decision trees.
[0138] It should be noted that the evaluation rule can be an evaluation method for determining the quality of model performance based on the overall performance score of the model. For example: the larger the overall performance score of the model, the better the model performance; the smaller the overall performance score of the model, the better the model performance; or the closer the overall performance score of the model is to a specific threshold, the better the model performance, etc.
[0139] The sorting rule may be a method of sorting based on the overall performance score of the model, for example: sorting from large to small, sorting from small to large, calculating the absolute value of the difference between the overall performance score of the model and a specific threshold, and sorting from large to small (or small to large) according to the absolute value of the difference.
[0140] In actual use, there may be multiple overall performance scores of the model. For example, the overall performance score of the model is calculated according to the RMSE formula and the R2 formula respectively. At this time, sorting rules can be constructed according to the overall performance scores of each model, and each candidate quantity is sorted based on each sorting rule and the overall performance score of the model corresponding to each candidate quantity to obtain multiple sorting results, and a corresponding sorting score is assigned to the sorting sequence number in each sorting result. The score is calculated according to the sorting of the candidate quantity in each sorting result, and then the multiple sorting scores corresponding to the same candidate quantity are added to obtain the total sorting score corresponding to each candidate quantity, and the candidate quantity with the largest corresponding total sorting score is selected as the target decision tree quantity.
[0141] It is understandable that the combined RMSE and R2 performance evaluation can provide complementary information to help fully understand the performance of the model. The model is required to have both a low RMSE (such as <0.002) and a high R2 (such as >0.979) to ensure that the model has both good prediction accuracy and can fit the data well, so as to obtain the optimal model as much as possible.
[0142] This embodiment provides a hard disk information synchronization method, which predicts the hard disk status based on the hard disk information list through an intelligent detection model, ensuring that a damaged, failed, or inoperable hard disk can be quickly discovered based on the hard disk status prediction result. This process not only achieves advanced perception of the hard disk monitoring status and advance insight into its potential risks, but also enables rapid response when the signs of failure first appear, effectively avoiding server performance bottlenecks and even business interruptions caused by hard disk failures, and realizing a shift from passive response to failures to active prevention of failures, thereby achieving rapid and accurate detection of hard disk quality and achieving high-quality server operation.
[0143] This application also provides a hard disk information synchronization device, please refer to Figure 4 , the hard disk information synchronization device comprises:
[0144] The reading module 10 is used to read the hard disk port information from the register of the CPLD in the server backplane, and the CPLD stores the hard disk port information sent by the central processing unit through the system management bus into the register;
[0145] A sorting module 20, configured to re-sort the hard disk asset information pushed by the BIOS based on the hard disk port information;
[0146] The construction module 30 is used to assemble the hard disk monitoring information and the re-ordered hard disk asset information to construct a hard disk information list, and the BIOS and operating system in the server synchronize the hard disk information according to the hard disk information list.
[0147] The hard disk information synchronization device provided by the present application adopts the hard disk information synchronization method in the above embodiment, which can solve the technical problem that the hard disk serial numbers in the hard disk information list arranged by the BMC, BIOS, and OS are not synchronized. Compared with the prior art, the beneficial effects of the hard disk information synchronization device provided by the present application are the same as the beneficial effects of the hard disk information synchronization method provided by the above embodiment, and the other technical features in the hard disk information synchronization device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0148] The present application provides a hard disk information synchronization device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the hard disk information synchronization method in the above-mentioned embodiment one.
[0149] Reference below Figure 5 , which shows a schematic diagram of the structure of a hard disk information synchronization device suitable for implementing the embodiment of the present application. The hard disk information synchronization device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The hard disk information synchronization device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0150] like Figure 5As shown, the hard disk information synchronization device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the hard disk information synchronization device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the hard disk information synchronization device to communicate with other devices wirelessly or by wire to exchange data. Although the hard disk information synchronization device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0151] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0152] The hard disk information synchronization device provided by the present application adopts the hard disk information synchronization method in the above embodiment, which can solve the technical problem that the hard disk serial numbers in the hard disk information list arranged by the BMC, BIOS, and OS are not synchronized. Compared with the prior art, the beneficial effects of the hard disk information synchronization device provided by the present application are the same as the beneficial effects of the hard disk information synchronization method provided by the above embodiment, and the other technical features in the hard disk information synchronization device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0153] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0154] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0155] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the hard disk information synchronization method in the above-mentioned embodiment.
[0156] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0157] The computer-readable storage medium may be included in the hard disk information synchronization device; or may exist independently without being assembled into the hard disk information synchronization device.
[0158] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the hard disk information synchronization device, the hard disk information synchronization device: reads the hard disk port information from the register of the CPLD in the server backplane, and the CPLD stores the hard disk port information sent by the central processing unit through the system management bus in the register; reorders the hard disk asset information pushed by the BIOS based on the hard disk port information; assembles the hard disk monitoring information and the reordered hard disk asset information to construct a hard disk information list, and the BIOS and operating system in the server synchronize the hard disk information according to the hard disk information list.
[0159] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0160] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0161] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0162] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned hard disk information synchronization method, and can solve the technical problem that the hard disk serial numbers in the hard disk information lists arranged by the BMC, BIOS, and OS are not synchronized. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the hard disk information synchronization method provided by the above-mentioned embodiment, and will not be repeated here.
[0163] The present application also provides a computer program product, including a computer program, which implements the steps of the hard disk information synchronization method as described above when executed by a processor.
[0164] The computer program product provided by the present application can solve the technical problem that the hard disk serial numbers in the hard disk information lists arranged by the BMC, BIOS, and OS are not synchronized. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the hard disk information synchronization method provided by the above embodiment, which will not be repeated here.
[0165] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A hard disk information synchronization method, characterized in that: Baseboard controller used in servers; The method comprises: Reading hard disk port information from a register of a CPLD in a server backplane, wherein the CPLD stores the hard disk port information sent by a central processing unit through a system management bus in the register; reordering the hard disk asset information pushed by the BIOS based on the hard disk port information; The hard disk monitoring information is assembled with the reordered hard disk asset information to construct a hard disk information list, so that the BIOS and the operating system in the server synchronize the hard disk information according to the hard disk information list.
2. The hard disk information synchronization method according to claim 1, characterized in that: The substrate controller is provided with an intelligent detection model; After assembling the hard disk monitoring information and the re-ordered hard disk asset information to construct the hard disk information list, the method further includes: Performing hard disk status prediction based on the hard disk information list by using the intelligent detection model to generate a hard disk status prediction result; Determining whether a hard disk in the server is abnormal according to the hard disk status prediction result; When an abnormality occurs, hard disk alarm information is generated, and an alarm prompt is given based on the hard disk alarm information.
3. The hard disk information synchronization method according to claim 2, characterized in that: Before the hard disk status prediction is performed based on the hard disk information list by the intelligent detection model to generate a hard disk status prediction result, the method further includes: Splitting the hard disk information data set into a training sample set and a verification sample set, wherein the hard disk information sample set includes multiple hard disk information samples, and the hard disk information samples include hard disk detailed information and sample labels, and the format of the hard disk detailed information is consistent with the format of the information in the hard disk information list; Perform cross-validation based on the training sample set and the validation sample set to determine the target number of decision trees; Building an initial detection model based on the target number of decision trees, wherein the initial detection model includes decision trees whose number is consistent with the target number of decision trees; The initial detection model is trained according to the hard disk information data set to obtain an intelligent detection model.
4. The hard disk information synchronization method according to claim 3, characterized in that: The performing cross validation based on the training sample set and the validation sample set to determine the target number of decision trees includes: Traverse the preset number of candidates to be selected to obtain the current number of candidates to be selected; Training a multiple decision tree model based on the training sample set, wherein the multiple decision tree model includes decision trees whose number is consistent with the current number to be selected; Perform multi-fold cross validation on the multiple decision tree model based on the validation sample set to obtain a model performance score corresponding to each fold; Construct the overall performance score of the model corresponding to the current number of candidates based on the model performance scores corresponding to each fold; At the end of the traversal, the overall performance score of the model corresponding to each candidate quantity in the preset candidate quantity set is obtained; According to the overall performance score of the model corresponding to each candidate quantity, the target number of decision trees is selected from each candidate quantity.
5. The hard disk information synchronization method according to claim 4, characterized in that: The performing multi-fold cross validation on the multiple decision tree model based on the validation sample set to obtain a model performance score corresponding to each fold includes: Splitting the validation sample set into multiple sample subsets according to the number of folds of multi-fold cross validation, and numbering the multiple sample subsets; Loop based on the fold and obtain the current fold; Using a sample subset whose number is consistent with the current fold number among the multiple sample subsets as a validation subset, and using other subsets among the multiple sample subsets except the validation subset as training subsets; Further training the multiple decision tree model according to the training subset; Verifying the further trained multiple decision tree model based on the verification subset, and generating a model performance score corresponding to the current fold; At the end of the cycle, the model performance scores corresponding to each fold are obtained.
6. The hard disk information synchronization method according to claim 4, characterized in that: The step of selecting the target number of decision trees from each candidate number according to the overall performance score of the model corresponding to each candidate number includes: Obtaining an evaluation rule for the overall performance score of the model; Determine a sorting rule based on the merit evaluation rule; Based on the sorting rules and the overall performance scores of the models corresponding to the quantities to be selected, sorting the quantities to be selected; The number of candidates ranked first in the sorting results is selected as the target number of decision trees.
7. A hard disk information synchronization device, characterized in that: The device comprises: A reading module is used to read hard disk port information from a register of a CPLD in a server backplane, wherein the CPLD stores the hard disk port information sent by the central processing unit through a system management bus into the register; A sorting module, used for re-sorting the hard disk asset information pushed by the BIOS based on the hard disk port information; The construction module is used to assemble the hard disk monitoring information and the re-ordered hard disk asset information to construct a hard disk information list so that the BIOS and the operating system in the server synchronize the hard disk information according to the hard disk information list.
8. A hard disk information synchronization device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the hard disk information synchronization method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the hard disk information synchronization method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the hard disk information synchronization method according to any one of claims 1 to 6 are implemented.