METHOD, ELECTRONIC DEVICE, AND COMPUTER PROGRAM PRODUCT FOR TRAINING MODEL

Embodiments of the present disclosure relate to a method, an electronic device, and a computer program product for training a model. The method includes: acquiring a test set and a training set for training models, the test set and the training set each including workload data associated with normal storage devices and workload data associated with exceptional storage devices; training a device detection model using the training set, the device detection model being used to classify storage devices as normal storage devices or exceptional storage devices according to a threshold degree, with the threshold degree being within a range; determining a test result by applying the test set to the device detection model; and updating the range of the threshold degree if it is determined that the test result indicates that the performance of the device detection model does not reach a threshold performance. With this method, storage devices can be accurately detected by the trained model.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field of data management, and more particularly, to a method, an electronic device, and a computer program product for training a model.

BACKGROUND

With the development of information technology, more and more data is generated. This increase in data volume poses a great challenge for data management, especially data storage. The detection of exceptional storage devices is a crucial aspect in the field of data storage, which makes it possible to detect an exceptional storage device in time and prevent that exceptional device from affecting the storage system. However, there exist many problems in the process of detecting exceptional devices; for example, the accuracy of detection needs to be improved.

SUMMARY OF THE INVENTION

Embodiments of the present disclosure provide a method, an electronic device, and a computer program product for training a model.

According to a first aspect of the present disclosure, a method for training a model is provided. The method includes: acquiring a test set and a training set for training models, the test set and the training set each including workload data associated with normal storage devices and workload data associated with exceptional storage devices; training a device detection model using the training set, the device detection model being used to classify storage devices as normal storage devices or exceptional storage devices according to a threshold degree, with the threshold degree being within a range; determining a test result by applying the test set to the device detection model; and updating the range of the threshold degree if it is determined that the test result indicates that the performance of the device detection model does not reach a threshold performance.

According to a second aspect of the present disclosure, a method for processing data is provided. The method includes: acquiring workload data associated with a storage device, the workload data including at least one of a data access mode and data access performance; and determining a detection result for the workload data using a device detection model trained by the method according to the first aspect, the detection result indicating whether the storage device is an exceptional storage device.

According to a third aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor; and a memory coupled to the at least one processor and having instructions stored thereon, wherein the instructions, when executed by the at least one processor, cause the device to perform actions including: acquiring a test set and a training set for training models, the test set and the training set each including workload data associated with normal storage devices and workload data associated with exceptional storage devices; training a device detection model using the training set, the device detection model being used to classify storage devices as normal storage devices or exceptional storage devices according to a threshold degree, with the threshold degree being within a range; determining a test result by applying the test set to the device detection model; and updating the range of the threshold degree if it is determined that the test result indicates that the performance of the device detection model does not reach a threshold performance.

According to a fourth aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor; and a memory coupled to the at least one processor and having instructions stored thereon, wherein the instructions, when executed by the at least one processor, cause the device to perform actions including: acquiring workload data associated with a storage device, the workload data including at least one of a data access mode and data access performance; and determining a detection result for the workload data using a device detection model trained by the method according to the first aspect, the detection result indicating whether the storage device is an exceptional storage device.

According to a fifth aspect of the present disclosure, a computer program product is provided, which is tangibly stored on a non-volatile computer-readable medium and includes machine-executable instructions, wherein the machine-executable instructions, when executed, cause a machine to perform the steps of the method in the first aspect of the present disclosure.

According to a sixth aspect of the present disclosure, a computer program product is provided, which is tangibly stored on a non-volatile computer-readable medium and includes machine-executable instructions, wherein the machine-executable instructions, when executed, cause a machine to perform the steps of the method in the second aspect of the present disclosure.

The same or corresponding reference numerals in the various drawings represent the same or corresponding portions.

DETAILED DESCRIPTION

The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are illustrated in the accompanying drawings, it should be understood that the present disclosure may be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the accompanying drawings and embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of protection of the present disclosure.

In the description of embodiments of the present disclosure, the term “include” and similar terms thereof should be understood as open-ended inclusion, i.e., “including but not limited to.” The term “based on” should be understood as “based at least in part on.” The term “an embodiment” or “the embodiment” should be construed as “at least one embodiment.” The terms “first,” “second,” and the like may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

In the embodiments of the present disclosure, the term “model” is capable of processing inputs and providing corresponding outputs. A neural network model, for example, typically includes an input layer, an output layer, and one or more hidden layers between the input layer and the output layer. Models used in deep learning applications (also referred to as “deep learning models”) typically include many hidden layers, thereby extending the depth of the network. The layers of the neural network model are sequentially connected so that the output of the previous layer is used as input to the next layer, where the input layer receives the input to the neural network model and the output of the output layer is used as the final output of the neural network model. Each layer of the neural network model includes one or more nodes (also called processing nodes or neurons), each of which processes the input from the previous layer. Herein, the terms “neural network”, “model”, “network”, and “neural network model” can be used interchangeably.

The principles of the present disclosure will be described below with reference to several example embodiments shown in the accompanying drawings. Although preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that these embodiments are described only to enable those skilled in the art to better understand and then implement the present disclosure, and are not intended to impose any limitation to the scope of the present disclosure.

In conventional exceptional storage detection, detection is usually only possible in cases where each storage device in a redundant array of independent risks (RAID) has the same workload mode in the training model or backup. However, since even in the same RAID, the workload modes of the storage devices may be different. In addition, in other storage scenarios, the workload modes of storage devices are often different as well. Therefore, conventional exceptional storage detection methods are often unable to detect exceptional storage devices in various storage scenarios.

In order to solve the above and other potential problems, the present disclosure provides a method for training a model. In this method, a test set and a training set for training models are first acquired, the test set and the training set each including workload data associated with normal storage devices and exceptional storage devices. Then, a device detection model is trained using the training set, wherein the device detection model can be used to classify storage devices as normal storage devices or exceptional storage devices according to a threshold degree, the threshold degree being within a range. Next, a test result is determined by applying the test set to the device detection model. And finally, the performance of the model is tested according to this test result, and if the performance does not reach a threshold performance, the range of the threshold degree is updated. With this method, the model can be trained accurately according to the workload data. Further, the performance of the trained model can be further improved by using the test set to adjust the threshold degree used by the model to determine exceptional devices.

FIG. 1illustrates a schematic diagram of an example of data processing environment100in which some embodiments of the present disclosure can be implemented. As shown inFIG. 1A, data processing environment100includes computing device110. Computing device110can be any device with computing power, such as a personal computer, a tablet computer, a wearable device, a cloud server, a mainframe, or a distributed computing system, for example.

Computing device110acquires input120. For example, input120can be an image, video, audio, text, and/or multimedia file, etc. Computing device110can apply input120to network model130to generate processing result140corresponding to input120using network model130. Network model130can be implemented using any suitable network structures, including but not limited to support vector machine (SVM) models, Bayesian models, random forest models, various deep learning/neural network models such as convolutional neural networks (CNN), recurrent neural networks (RNN), deep neural networks (DNN), deep Q networks (DQN), etc. The scope of the present disclosure is not limited in this regard.

Environment100may also include a training data acquisition apparatus, a model training apparatus, and a model application apparatus (not shown). In some embodiments, the above multiple apparatuses can be separately implemented in different physical computing devices. Alternatively, at least some of the above multiple apparatuses can be implemented in the same computing device. For example, the training data acquisition apparatus and the model training apparatus can be implemented in the same computing device, while the model application apparatus can be implemented in another computing device.

In some embodiments, during the model training phase, the training data acquisition apparatus can acquire input120and provide it to the model. Input120can be a test set and network model130can be the to-be-trained model. The model training apparatus can train network model130based on the input. Processing result140can be tailored to different constraints on this model, and computing device110can adjust the training parameters (e.g., such as weights and biases) of network model130by the different constraints so that the error of the model on the training samples is reduced.

Alternatively, in some embodiments, in the final phase of model training, the input can be the training set and processing result140can be a characterization of the performance metric (e.g., accuracy) of trained network model130.

Model training environment200will be described in detail below with reference toFIG. 2. Environment200may include training set122and test set124as input120, and although one training set and test set are illustrated, there may also be multiple training sets and test sets, and the present disclosure is not limited herein.

Computing device110can train, using training set122, the to-be-trained model so as to obtain device detection model132. In some embodiments, the to-be-trained model can be an isolated forest model in which exceptional samples can be isolated by a smaller number of random feature segmentations compared to normal samples. It is also possible to use any suitable algorithm or model to be trained to obtain device detection model132, and the present disclosure is not limited herein.

Computing device110can test the trained device detection model132using test set122and further adjust degree threshold134of device detection model132according to the test result.

Referring back toFIG. 1, the trained network model can be provided to the model application apparatus. The model application apparatus can acquire the trained model and input120, and determine processing result140for input120. In the model application phase, input120can be input data to be processed (e.g., workload data), network model130can be a trained model (e.g., device detection model132), and processing result140can be a prediction result (e.g., whether the device is a normal storage device or an exceptional storage device) corresponding to input120(e.g., the workload data).

It should be understood that environment100shown inFIG. 1and environment200shown inFIG. 2are only one example in which embodiments of the present disclosure can be implemented and are not intended to limit the scope of the present disclosure. The embodiments of the present disclosure are equally applicable to other systems or architectures.

The process of training a model is further described in detail below in conjunction withFIG. 3.FIG. 3illustrates a flow chart of example method300for training a model according to embodiments of the present disclosure. Example method300can be implemented by computing device110as shown inFIG. 1. For ease of description, example method300will be described below with reference toFIGS. 1 and 2.

At block310ofFIG. 3, computing device110acquires test set122and training set124for training models, test set122and training set124each including workload data associated with normal storage devices and workload data associated with exceptional storage devices. For example, computing device110can acquire workload data of storage devices in different storage scenarios as test set122and training set124.

In some embodiments, the workload data indicates at least one of a data access mode and data access performance. For example, computing device110can acquire workload data of storage devices within a predetermined period of time (e.g., within 3 seconds).

For the data access mode, computing device110can acquire different data access mode data, for example, it can acquire at least one of the following: the number of read requests, the number of write requests, the average data volume of read requests, the average data volume of write requests, the random access ratio, and the number of non-accesses. For example, computing device110can acquire the number of read requests, the number of write requests, the average data volume of read requests, and the average data volume of write requests over a 3-second period. The random access ratio can represent the ratio of the number of random accesses to the total number of accesses. Here, a random access can refer to a situation where the distance between the start address of the current access and the start address of the previous access exceeds a threshold distance (e.g.,2K of storage space). The number of non-accesses refers to the number of operations other than data reads and writes. Since these other operations may also have an impact on the read/write requests in the storage device, it is beneficial to collect this number of non-accesses as training and test data for model training.

For the data access performance, computing device110can acquire different access performance data, for example, it can acquire at least one of the following: the average time for requests, the average time for write requests, the maximum time for read requests, the maximum time for write requests, the number of read requests greater than a threshold time, and the number of write requests greater than a threshold time. For example, computing device110can acquire the average time for requests, the average time for write requests, the maximum time for read requests, the maximum time for write requests, the number of read requests greater than a threshold time (e.g., 100 ms), and the number of write requests greater than a threshold time (e.g., 100 ms) over a 3-second period. If the read/write request is greater than the threshold time, it indicates that the storage device associated with that read/write request may be exceptional.

Alternatively, in some embodiments, computing device110can acquire workload data for scenarios other than storage scenarios (e.g., file cleaning, verification, etc.). By acquiring workload data in various scenarios, i.e., the above access mode data and access performance data, the accuracy and generalization of the model trained using this data can be improved, and thus exceptional storage devices in various different scenarios can be detected.

At block320ofFIG. 3, computing device110trains device detection model132using training set122, device detection model132being used to classify storage devices as normal storage devices or exceptional storage devices according to threshold degree134, with threshold degree134being within a range. For example, computing device110can train a model according to training set122acquired above to obtain device detection model132.

In some embodiments, computing device110can train an isolated forest (iForest) model according to various data acquired as described above to obtain device detection model132. The isolated forest (iForest) model is a model suitable for exception detection of continuous data. This model defines exceptions as “outliers that are easily isolated”, i.e., exceptional points are points that are sparsely distributed and far from the dense population. A region with sparse distribution indicates that the probability of data occurring in this region is very low, and thus data falling in this region can be considered as exceptional. It can be understood that with the workload data collected in the various scenarios described above and using the characteristics of the isolated forest (iForest) model, trained device detection model132can accurately determine exceptional storage devices. The above model is only an example, and any suitable model can also be used as an algorithm to obtain the device detection model. The present disclosure is not limited herein.

Obtained device detection model132can classify storage devices as normal storage devices or exceptional storage devices according to threshold degree134associated with the device exception degree, and this threshold degree134is within a predetermined range. The following will describe how this range is determined to make the performance of device detection model132stable (i.e., greater than the threshold performance).

At block330ofFIG. 3, computing device110determines a test result by applying test set124to device detection model132. For example, computing device110can apply the test data to device detection model132obtained through the above training, so as to determine the test result of device detection model132with regard to this test set124.

In some embodiments, computing device110determines, if determining that a first device exception degree determined by device detection model132based on a first workload data is greater than threshold degree134, that a storage device associated with the first workload data is an exceptional storage device; and determines, if a second device exception degree determined by the device detection model based on a second workload data is less than the threshold degree, that the storage device associated with the second workload data is a normal storage device. For example, device detection model132can determine the exception degree of the workload data in input test set124and compare that exception degree to threshold degree134.

It can be understood that threshold degree134can be dynamic, and high threshold degree134may allow more exceptional devices to be detected (a higher true positive rate), but at the same time, it may also cause too many normal devices to be incorrectly detected as exceptional devices (a higher false positive rate); while lower threshold degree134may result in a lower false detection rate (lower false positive rate), at the same time, it may also result in a lower correct detection rate (lower true positive rate). The following will describe how to determine the range of this threshold degree to make the performance of the model stable.

At block340ofFIG. 3, computing device110updates the range of threshold degree134if it is determined that the test result indicates that the performance of device detection model132does not reach a threshold performance. This step340will be described in conjunction withFIG. 5.

In some embodiments, the threshold performance includes a first threshold probability associated with correctly detecting an exceptional storage device and a second threshold probability associated with incorrectly detecting an exceptional storage device. That is, the first threshold probability can indicate the true positive rate expected by device detection model132, and the second threshold probability can indicate the false positive rate expected by device detection model132. Computing device110can determine a first probability and a second probability associated with the threshold degree according to the test result, the first probability indicating the probability that an exceptional storage device is determined by the model to be an exceptional storage device, and the second probability indicating the probability that a normal storage device is determined by the model to be an exceptional storage device.

For example, test set124may include 100 storage devices (that are provided with labels of normal storage devices or exceptional storage devices, wherein the labels indicate that there are 10 exceptional devices and 90 normal devices) and the workload data associated with them. For example, based on a threshold degree0, device detection model132detects 9 of the 10 exceptional devices and incorrectly detects 2 of the 90 normal devices as exceptional devices. Then the first probability (true positive rate) is 0.9, and the second probability (false positive rate) is 0.022. If the first threshold probability is 0.8 and the second threshold probability is 0.1, then this threshold degree0satisfies the performance requirements of the model.

Computing device110removes from the range a value corresponding to the threshold degree if it is determined that the first probability is less than the first threshold probability or that the second probability is greater than the second threshold probability. For example, as shown inFIG. 5, each threshold degree in the range between −0.075 and 0.01 is associated with a first probability and a second probability. The computing device can remove, from the range between −0.075 and 0.01, the value corresponding to a threshold degree for which the first probability is less than the first threshold probability or the second probability is greater than the second threshold probability. That is, it can be derived fromFIG. 5that the performance of device detection model132is stable when threshold degree134is in the range between −0.01 and 0.01. Thus, a model with stable performance can be obtained.

Note that the above different values are only examples and different thresholds can be set according to the needs of the model and scenarios, and the present disclosure is not limited herein.

According to embodiments of the present disclosure, with this method, the model can be trained accurately according to the workload data. Further, the performance of the trained model can be further improved by using the test set to adjust the threshold degree used by the model to determine exceptional devices.

The process of training the model has been described above, and the application of the model will be described below.FIG. 4illustrates a flow chart of example method400for processing data according to some embodiments of the present disclosure.

At block410ofFIG. 4, computing device110acquires workload data associated with a storage device, the workload data including at least one of a data access mode and data access performance. Acquiring the workload data has been described in detail above and will not be repeated here.

At block420ofFIG. 4, computing device110determines a detection result for the workload data using device detection model132trained by the method according to the above steps310-340, the detection result indicating whether the storage device is an exceptional storage device.

In some embodiments, computing device110can cause a visual representation of a relationship of threshold degree134to a first probability and a second probability to be presented to a user, the first probability indicating the probability that an exceptional storage device is determined by the trained model to be an exceptional storage device, and the second probability indicating the probability that a normal storage device is determined by the trained model to be an exceptional storage device. For example, computing device110can present relationship500of the threshold degree to the first probability and the second probability to the user through a user interface (e.g., a display). It can be understood that the users are involved in different storage scenarios, and depending on different storage scenarios, some users prefer a higher first probability (true positive rate) and can then set the threshold degree to a higher value (e.g. 0.01), while some other users prefer a lower second probability (false positive rate) and can then set the threshold degree to a lower value (e.g., −0.01). Computing device110can then receive input from the user regarding threshold degree134, and adjust threshold degree134based on the user's input. By accepting the user input to dynamically adjust the threshold degree, exceptional storage devices can be accurately detected in different application scenarios.

In one example, if determining that the prediction result indicates that the storage device is an exceptional storage device, computing device100causes at least one of the following to be executed: issuing an alert and collecting a log, and performing a data access operation through a normal storage device associated with the exceptional storage device. For example, for the identified exceptional storage device, computing device110can enable an alert to be sent to the technical support team, trigger collection of a log associated with the exceptional storage device, or improve data access associated with the exceptional storage device by virtue of the RAID mechanism.

In some embodiments, after computing device110detects the exceptional storage device, computing device110can utilize other normal storage devices in the same RAID group to achieve the recovery of the desired data if it is determined that there is a read request for this exceptional storage device.

Alternatively, in some other embodiments, after computing device110detects the exceptional storage device, computing device110can first update the bitmap associated with the exceptional storage device without writing data to this exceptional storage device if it is determined that there is a write request for this exceptional storage device. When determining that the fault in this exceptional storage device is recovered, it can resynchronize the bitmap in the storage device.

By adopting different strategies after detecting the exceptional device, the impact of the exceptional storage device can be minimized, thereby improving the user experience.

FIG. 6illustrates a schematic block diagram of example device600that can be configured to implement the embodiments of the present disclosure. For example, storage manager130as shown inFIG. 1may be implemented by device600. As shown in the drawing, device600includes central processing unit CPU601that may perform various appropriate actions and processing according to computer program instructions stored in read-only memory ROM602or computer program instructions loaded from storage unit608into random access memory RAM603. In RAM603, various programs and data required for operations of device600may also be stored. CPU601, ROM602, and RAM603are connected to each other through bus604. Input/output (I/O) interface605is also connected to bus604.

Multiple components in device600are connected to I/O interface605, including: input unit606, such as a keyboard and a mouse; output unit607, such as various types of displays and speakers; storage unit608, such as a magnetic disk and an optical disc; and communication unit609, such as a network card, a modem, and a wireless communication transceiver. Communication unit609allows device600to exchange information/data with other devices over a computer network such as an Internet and/or various telecommunication networks.

The various processes and processing described above, for example, methods300and400, can be performed by processing unit601. For example, in some embodiments, methods300and400may be implemented as a computer software program that is tangibly included in a machine-readable medium such as storage unit608. In some embodiments, part or all of the computer program may be loaded and/or installed to device600via ROM602and/or communication unit609. When the computer program is loaded to RAM603and executed by CPU601, one or more actions of methods300and400described above may be executed.

The present disclosure may be a method, an apparatus, a system, and/or a computer program product. The computer program product may include a computer-readable storage medium on which computer-readable program instructions for performing various aspects of the present disclosure are loaded.

The computer-readable storage medium may be a tangible device capable of retaining and storing instructions used by an instruction-executing device. The computer-readable storage medium may be, for example, but is not limited to, an electric storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples, as a non-exhaustive list, of computer-readable storage media include: 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 a flash memory, a static random access memory SRAM, a portable compact disc read-only memory CD-ROM, a digital versatile disc DVD, a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a raised structure in a groove with instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media used herein are not to be interpreted as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or electrical signal transmitted via electrical wires.

Various aspects of the present disclosure are described here with reference to flow charts and/or block diagrams of the method, the apparatus/system, and the computer program product according to the embodiments of the present disclosure. It should be understood that each block in the flow charts and/or block diagrams as well as a combination of blocks in the flow charts and/or block diagrams may be implemented by using the computer-readable program instructions.

Various embodiments of the present disclosure have been described above. The foregoing description is illustrative rather than exhaustive, and is not limited to the disclosed embodiments. Numerous modifications and alterations are apparent to those of ordinary skill in the art without departing from the scope and spirit of the illustrated embodiments. The selection of terms as used herein is intended to best explain the principles and practical applications of the various embodiments or technical improvements to technologies on the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed here.