CN116521058A - Control method and device for replacing magnetic disk, computer equipment and storage medium - Google Patents

Control method and device for replacing magnetic disk, computer equipment and storage medium Download PDF

Info

Publication number
CN116521058A
CN116521058A CN202211138392.9A CN202211138392A CN116521058A CN 116521058 A CN116521058 A CN 116521058A CN 202211138392 A CN202211138392 A CN 202211138392A CN 116521058 A CN116521058 A CN 116521058A
Authority
CN
China
Prior art keywords
disk
target
preset
list
slot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211138392.9A
Other languages
Chinese (zh)
Inventor
李建辉
张文件
陈栋
罗春
李春
魏兴华
吴炎
臧冰凌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Woqu Technology Co ltd
Original Assignee
Hangzhou Woqu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Woqu Technology Co ltd filed Critical Hangzhou Woqu Technology Co ltd
Priority to CN202211138392.9A priority Critical patent/CN116521058A/en
Publication of CN116521058A publication Critical patent/CN116521058A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of disk replacement, in particular to a method and a device for controlling replacement of a disk, computer equipment and a storage medium, wherein the method comprises the following steps: obtaining a target disk slot ID list according to a disk insertion request; acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list; generating a target disk drive corresponding to the target disk slot ID according to the target disk information; and performing target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier, wherein whether the target disc is a newly inserted disc or not is determined according to comparison between the target disc identifier and a preset disc identifier, and then a disc replacement program is executed to process the newly inserted disc so as to realize automatic disc replacement, thereby avoiding low efficiency and higher error rate caused by the traditional manual disc replacement processing and improving disc replacement efficiency and accuracy.

Description

Control method and device for replacing magnetic disk, computer equipment and storage medium
The patent application of the invention enjoys the priority of 'CN 202210607028.6, a disk replacement method, a device, computer equipment and a storage medium';
Technical Field
The present invention relates to the field of disk replacement technologies, and in particular, to a method and apparatus for controlling disk replacement, a computer device, and a storage medium.
Background
With the rapid development of computer technology, distributed storage clusters for mass data storage are widely used in various industries. In particular, mass data can be stored in a disk of the device, and when the disk has abnormal conditions, the disk needs to be replaced, so that the device is prevented from being abnormal due to damage of the disk.
In the prior art, after a new disk is generally identified, the disk is manually processed, for example, partitioned, mounted, etc., which results in low efficiency and high error rate.
Therefore, how to effectively solve the problem of automatic disk replacement is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
Aiming at the technical problems, the invention provides a control method for replacing a magnetic disk, which comprises the following steps:
obtaining a target disk slot ID list according to a disk insertion request;
acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list;
generating a target disk drive corresponding to the target disk slot ID according to the target disk information;
performing target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier, wherein the step of performing target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier further comprises the following steps:
acquiring a preset disk slot ID list;
obtaining a preset disk drive list corresponding to the preset disk slot ID according to the target disk slot ID, wherein the preset disk drive list comprises at least two preset disk drives;
traversing the preset disk drive list and acquiring key disk drive from the preset disk drive list;
when the target disk character is consistent with the key disk character, performing first disk changing processing on a target disk corresponding to the target disk character, wherein the first disk changing processing is disk mounting processing;
and when the target disk drive is inconsistent with the key disk drive, performing second disk changing processing on the target disk corresponding to the target disk drive based on the disk information corresponding to the key disk drive, wherein the second disk changing processing comprises: initialization processing of a disk, partition processing of the disk and mounting processing of the disk.
The invention also provides a control device for replacing a magnetic disk, which comprises:
the first acquisition module is used for acquiring a target disk slot ID list according to a disk insertion request;
the information acquisition module is used for acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list;
the disk symbol generation module is used for generating a target disk symbol corresponding to the target disk slot ID according to the target disk information;
the disc replacement processing module is used for carrying out target disc replacement processing on a target disc of a target disc slot ID according to a target disc drive, and the disc replacement processing module comprises:
the second acquisition module is used for acquiring a preset disk slot ID list;
a third obtaining module, configured to obtain a preset disk drive list corresponding to a preset disk slot ID according to the target disk slot ID, where the preset disk drive list includes at least two preset disk drives;
the second disk character acquisition module is used for traversing the preset disk character list and acquiring key disk characters from the preset disk character list;
the first execution module is used for carrying out first disk changing processing on the target disk corresponding to the target disk identifier when the target disk identifier is consistent with the key disk identifier, wherein the first disk changing processing is disk mounting processing;
the second execution module is configured to perform, when the target disk identifier is inconsistent with the key disk identifier, a second disk replacement process on a target disk corresponding to the target disk identifier based on disk information corresponding to the key disk identifier, where the second disk replacement process includes: initialization processing of a disk, partition processing of the disk and mounting processing of the disk.
The invention protects a computer device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the control method for replacing the magnetic disk when executing the computer program.
The present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method of controlling disk replacement.
Compared with the prior art, the invention has obvious advantages and beneficial effects. By means of the technical scheme, the control method, the device, the computer equipment and the storage medium for replacing the magnetic disk can achieve quite technical progress and practicality, and have wide industrial utilization value, and the control method, the device, the computer equipment and the storage medium have at least the following advantages:
the invention discloses a control method and device for replacing a magnetic disk, computer equipment and a storage medium, wherein the method comprises the following steps: obtaining a target disk slot ID list according to a disk insertion request; acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list; generating a target disk drive corresponding to the target disk slot ID according to the target disk information; and performing target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier, wherein whether the target disc is a newly inserted disc or not is determined according to comparison between the target disc identifier and a preset disc identifier, and then a disc replacement program is executed to process the newly inserted disc so as to realize automatic disc replacement, thereby avoiding low efficiency and higher error rate caused by the traditional manual disc replacement processing and improving disc replacement efficiency and accuracy.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention, as well as the preferred embodiments thereof, together with the following detailed description of the invention, given by way of illustration only, together with the accompanying drawings.
Drawings
FIG. 1 is a flowchart of a method for controlling disc replacement according to an embodiment of the present invention;
FIG. 2 is a flowchart of step S600 provided in accordance with an embodiment of the present invention;
FIG. 3 is a flowchart illustrating the step S700 according to the first embodiment of the present invention;
FIG. 4 is a flowchart illustrating another step S700 according to an embodiment of the present invention;
FIG. 5 is a flowchart of determining whether the target disk drive is consistent with the preset disk drive according to an embodiment of the present invention;
FIG. 6 is a flowchart showing the step S705 provided in the first embodiment of the present invention;
FIG. 7 is a flowchart showing the step S709 provided in the first embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a control device for replacing a magnetic disk according to a second embodiment of the present invention;
fig. 9 is a schematic structural diagram of a module 60 according to a second embodiment of the present invention;
fig. 10 is a schematic structural diagram of a module 70 according to a second embodiment of the present invention;
fig. 11 is a schematic structural diagram of another module 70 according to the second embodiment of the present invention;
fig. 12 is a schematic structural diagram of a determining module according to a first embodiment of the present invention;
fig. 13 is a schematic structural diagram of a module 75 according to a second embodiment of the present invention;
fig. 14 is a schematic structural diagram of a module 79 according to a second embodiment of the present invention.
Detailed Description
In order to further describe the technical means and effects of the present invention for achieving the predetermined object, the following detailed description refers to a specific embodiment of a data processing system for acquiring a target location according to the present invention and its effects, with reference to the accompanying drawings and preferred embodiments.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
As shown in fig. 1, a first embodiment provides a method for controlling disc replacement, which includes the following steps:
s100, acquiring a target disk slot ID list according to a disk insertion request.
Specifically, the disk insertion request is determined by monitoring the disk slot by a daemon preset in the system, and a method for monitoring the disk slot by the daemon is known to those skilled in the art, which is not described herein.
Further, the preset daemon is udev daemon.
Specifically, the target disk slot ID list refers to a data list constructed based on the target disk slot ID, where the target disk slot ID refers to a unique device identifier of the target disk slot, and the target disk slot is a preset disk slot in which a disk is reinserted.
Further, the preset disk slots refer to all disk slots that can be monitored by a preset daemon in the system.
S300, obtaining target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list.
Specifically, the target disk information refers to disk information of a target disk, where the disk information includes a disk type of the disk, a kernel device name corresponding to the disk, and the like, and for example, the kernel device name may be a disk device name in a Linux kernel driver.
Further, the target disk refers to a disk currently inserted into the target disk slot.
S500, generating a target disk drive symbol corresponding to the target disk slot ID according to the target disk information; those skilled in the art will know that any method for generating a disk drive according to disk information belongs to the protection scope of the present invention, and will not be described herein.
Specifically, before step S700, the method further includes:
s600, determining to execute the step S700 according to the storage space of the target disk and the storage space of the initial disk.
As shown in fig. 2, the step S600 further includes the steps of:
s601, acquiring a storage space of a target disk and a storage space of an initial disk, wherein the initial disk is a disk inserted into a disk slot for the first time;
s603, when the storage space of the target disk is smaller than that of the initial disk, sending out prompt information and stopping target disk changing processing on the target disk;
and S605, executing the step S700 when the storage space of the target disk is not smaller than the storage space of the initial disk.
In the above embodiment, by comparing the space of the target disk with the space of the initial disk, it is determined whether to perform the disk replacement processing, thereby avoiding that the disk replacement processing cannot be performed due to the smaller space of the newly inserted disk, and further improving the disk replacement efficiency and accuracy.
S700, performing target disk replacement processing on the target disk of the target disk slot ID according to the target disk drive.
As shown in fig. 3, the step S700 further includes the steps of:
s701, acquiring a preset disk slot ID list, wherein each preset disk slot ID in the preset disk slot ID list only corresponds to a single preset disk drive.
Specifically, the preset disk slot ID list refers to a data list constructed based on preset disk slot IDs, where the preset disk slot IDs refer to unique identities of preset disk slots.
S703, acquiring a preset disk drive symbol corresponding to the preset disk slot ID from the preset disk slot ID list according to the target disk slot ID; it can be understood that: and when the target disk slot ID is consistent with any preset disk slot ID, acquiring a preset disk drive corresponding to the preset disk slot ID.
Specifically, the preset disk identifier refers to a unique identifier of a preset disk, for example, a serial number of the disk.
S705, when the target disk character is consistent with the preset disk character, performing first disk changing processing on a target disk corresponding to the target disk character;
and S707, when the target disk character is inconsistent with the preset disk character, performing second disk changing processing on the target disk corresponding to the target disk character based on the disk information corresponding to the preset disk.
Specifically, the target disc replacement processing includes a first disc replacement processing and a second disc replacement processing, where the first disc replacement processing is a mounting processing of a magnetic disc, and the second disc replacement processing includes: initialization processing of a disk, partition processing of the disk and mounting processing of the disk.
As shown in fig. 4, the method further includes the steps of determining whether the target disk drive is consistent with the preset disk drive:
s1, acquiring a target editing distance between the target disk drive and the preset disk drive;
s3, when the target editing distance is not greater than a preset distance threshold, determining that the target disk drive is consistent with the preset disk drive;
and S5, when the target editing distance is greater than a preset distance threshold, determining that the target disk drive is inconsistent with the preset disk drive.
Preferably, the distance threshold is 0, so that whether the target disk drive is consistent with the preset disk drive can be accurately determined.
In another specific embodiment, as shown in fig. 5, the step S700 further includes the following steps:
s701, acquiring a preset disk slot ID list.
S703, acquiring a preset disk drive list corresponding to a preset disk slot ID according to the target disk slot ID, wherein the preset disk drive list comprises at least two preset disk drives; it can be understood that: any preset disk slot ID corresponds to not only a single preset disk drive symbol, but also can retain the information of all the disks inserted into any preset disk slot, thereby being beneficial to the subsequent improvement of the disk exchange efficiency and accuracy.
S705, traversing the preset disk drive list and acquiring key disk drives from the preset disk drive list.
As shown in fig. 6, the step S705 further includes the steps of:
s7051, obtaining, according to the target disk information, a target time of the target disk identifier.
Specifically, the target time refers to a corresponding time point when the target disk is inserted into the disk slot.
S7053, obtaining a preset time interval list corresponding to the preset disk drive list according to the target time point and the preset disk drive list, wherein the preset time interval in the preset time interval list is a time interval between the target time and preset time corresponding to each preset disk drive in the preset disk drive list.
Specifically, the preset time refers to a corresponding time point when the preset disk is inserted into the disk slot each time.
S7055, traversing the preset time interval list and acquiring a preset disk drive corresponding to the minimum preset time interval in the preset time interval list as a key disk drive.
In the above embodiment, according to the time point of the target disk drive, the preset disk drive closest to the time point of the target disk drive is determined in the preset disk drive list, so that it is possible to implement comparison between adjacent disk drives corresponding to the same disk slot, and determine whether the currently inserted disk is a new disk.
And S707, when the target disk drive is consistent with the key disk drive, performing first disk replacement processing on the target disk corresponding to the target disk drive.
And S709, when the target disk drive is inconsistent with the key disk drive, performing second disk replacement processing on the target disk corresponding to the target disk drive based on the disk information corresponding to the key disk drive.
Specifically, the method for determining whether the target disk drive is consistent with the key disk drive may refer to the method for determining whether the target disk drive is consistent with the preset disk drive in the above embodiment, which is not described herein.
As shown in fig. 7, the step S709 further includes the steps of:
s7091, acquiring the preset time interval list;
s7093, when the preset time interval is smaller than a preset time interval threshold, generating an intermediate disk symbol list based on a preset disk symbol corresponding to the preset time interval;
s7095, traversing the intermediate disk character list, and when all the intermediate disk characters are inconsistent with the target disk characters, performing second disk changing processing on the target disk corresponding to the target disk character based on the disk information corresponding to the key disk character;
s7097, when the intermediate disk drive is identical to the target disk drive, performing the first disk replacement process on the target disk corresponding to the target disk drive.
Further, the intermediate disk drive is a preset disk drive corresponding to the preset time interval when the preset time interval is smaller than a preset time interval threshold.
In the above embodiment, by pulling out the disk only in a short time according to the time interval, the process of disk changing processing can be reduced, and when the disk is inserted into the slot again, only mounting processing is needed, so that the process is simplified, and the disk changing efficiency and accuracy are improved.
Preferably, in step S700, when performing the target disc changer process on the target disc drive, the target disc drive is replaced with the preset disc drive or inserted into the preset disc drive list; the preset disk drive symbol or the preset disk drive symbol list can be updated, so that when a new disk is inserted into the disk slot, whether the second disk changing process needs to be executed or not can be accurately and effectively determined, and further the disk changing efficiency and accuracy are improved.
The first embodiment provides a method for controlling replacement of a magnetic disk, which includes: obtaining a target disk slot ID list according to a disk insertion request; acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list; generating a target disk drive corresponding to the target disk slot ID according to the target disk information; and performing target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier, wherein whether the target disc is a newly inserted disc or not is determined according to comparison between the target disc identifier and a preset disc identifier, and then a disc replacement program is executed to process the newly inserted disc so as to realize automatic disc replacement, thereby avoiding low efficiency and higher error rate caused by the traditional manual disc replacement processing and improving disc replacement efficiency and accuracy.
As shown in fig. 8, a first embodiment provides a control device for replacing a magnetic disk, the device including:
the first obtaining module 10 is configured to obtain a target disk slot ID list according to a disk insertion request.
Specifically, the disk insertion request is determined by monitoring the disk slot by a daemon preset in the system, and a method for monitoring the disk slot by the daemon is known to those skilled in the art, which is not described herein.
Further, the preset daemon is udev daemon.
Specifically, the target disk slot ID list refers to a data list constructed based on the target disk slot ID, where the target disk slot ID refers to a unique device identifier of the target disk slot, and the target disk slot is a preset disk slot in which a disk is reinserted.
Further, the preset disk slots refer to all disk slots that can be monitored by a preset daemon in the system.
The information obtaining module 30 is configured to obtain, according to the target disk slot ID list, target disk information corresponding to any target disk slot ID in the target disk slot ID list.
Specifically, the target disk information refers to disk information of a target disk, where the disk information includes a disk type of the disk, a kernel device name corresponding to the disk, and the like, and for example, the kernel device name may be a disk device name in a Linux kernel driver.
Further, the target disk refers to a disk currently inserted into the target disk slot.
The disk symbol generating module 50 is configured to generate a target disk symbol corresponding to the target disk slot ID according to the target disk information; those skilled in the art will know that any method for generating a disk drive according to disk information belongs to the protection scope of the present invention, and will not be described herein.
Specifically, before the disc replacement processing module 70, it further includes:
the determining module 60 is configured to determine to execute the disc replacement processing module 70 according to the storage space of the target disc and the storage space of the initial disc.
As shown in fig. 9, the determining module 60 further includes:
a storage space obtaining module 61, configured to obtain a storage space of a target disk and a storage space of an initial disk, where the initial disk is a disk inserted into a disk slot for the first time;
a third execution module 63, configured to send out a prompt message and stop performing target disc replacement processing on the target disc when the storage space of the target disc is smaller than the storage space of the initial disc;
the fourth executing module 65 is configured to execute the disc replacement processing module 70 when the storage space of the target disc is not smaller than the storage space of the initial disc.
In the above embodiment, by comparing the space of the target disk with the space of the initial disk, it is determined whether to perform the disk replacement processing, thereby avoiding that the disk replacement processing cannot be performed due to the smaller space of the newly inserted disk, and further improving the disk replacement efficiency and accuracy.
The disc replacement processing module 70 is configured to perform target disc replacement processing on the target disc of the target disc slot ID according to the target disc drive.
As shown in fig. 10, the disc replacement processing module 70 further includes:
the second obtaining module 71 is configured to obtain a preset disk slot ID list, where each preset disk slot ID in the preset disk slot ID list corresponds to only a single preset disk drive.
Specifically, the preset disk slot ID list refers to a data list constructed based on preset disk slot IDs, where the preset disk slot IDs refer to unique identities of preset disk slots.
A first disk identifier obtaining module 73, configured to obtain, according to the target disk slot ID, a preset disk identifier corresponding to a preset disk slot ID from the preset disk slot ID list; it can be understood that: and when the target disk slot ID is consistent with any preset disk slot ID, acquiring a preset disk drive corresponding to the preset disk slot ID.
Specifically, the preset disk identifier refers to a unique identifier of a preset disk, for example, a serial number of the disk.
A first execution module 75, configured to perform a first disc replacement process on a target disc corresponding to the target disc identifier when the target disc identifier is consistent with the preset disc identifier;
and a second executing module 77, configured to perform a second disc replacement process on the target disc corresponding to the target disc identifier based on the disc information corresponding to the preset disc when the target disc identifier is inconsistent with the preset disc identifier.
Specifically, the target disc replacement processing includes a first disc replacement processing and a second disc replacement processing, where the first disc replacement processing is a mounting processing of a magnetic disc, and the second disc replacement processing includes: initialization processing of a disk, partition processing of the disk and mounting processing of the disk.
Further, the apparatus further comprises:
and the determining module is used for determining whether the target disk drive is consistent with the preset disk drive.
As shown in fig. 11, the determining module includes:
the editing distance acquisition module 1 is used for acquiring a target editing distance between the target disk drive and the preset disk drive;
a first determining module 3, configured to determine that the target disk identifier is consistent with the preset disk identifier when the target editing distance is not greater than a preset distance threshold;
and the second determining module 5 is configured to determine that the target disk drive is inconsistent with the preset disk drive when the target editing distance is greater than a preset distance threshold.
Preferably, the distance threshold is 0, so that whether the target disk drive is consistent with the preset disk drive can be accurately determined.
In another specific embodiment, the step S700 further includes the following steps, as shown in fig. 12:
the second obtaining module 71 is configured to obtain a preset disk slot ID list.
A third obtaining module 73, configured to obtain a preset disk drive list corresponding to a preset disk slot ID according to the target disk slot ID, where the preset disk drive list includes at least two preset disk drives; it can be understood that: any preset disk slot ID corresponds to not only a single preset disk drive symbol, but also can retain the information of all the disks inserted into any preset disk slot, thereby being beneficial to the subsequent improvement of the disk exchange efficiency and accuracy.
A second disk drive acquisition module 75, configured to traverse the preset disk drive list and acquire a key disk drive from the preset disk drive list.
Specifically, the second disc symbol acquisition module 75 further includes, as shown in fig. 13:
and a time acquisition module 751, configured to acquire a target time of the target disk drive according to the target disk information.
Specifically, the target time refers to a corresponding time point when the target disk is inserted into the disk slot.
And a time interval obtaining module 753, configured to obtain a preset time interval list corresponding to the preset disk drive list according to the target time point and the preset disk drive list, where the preset time interval in the preset time interval list is a time interval between the target time and a preset time corresponding to each preset disk drive in the preset disk drive list.
Specifically, the preset time refers to a corresponding time point when the preset disk is inserted into the disk slot each time.
The disk symbol determining module 755 is configured to traverse the preset time interval list and obtain, as a key disk symbol, a preset disk symbol corresponding to a minimum preset time interval in the preset time interval list.
In the above embodiment, according to the time point of the target disk drive, the preset disk drive closest to the time point of the target disk drive is determined in the preset disk drive list, so that it is possible to implement comparison between adjacent disk drives corresponding to the same disk slot, and determine whether the currently inserted disk is a new disk.
And the first executing module 77 is configured to perform a first disk replacement process on a target disk corresponding to the target disk identifier when the target disk identifier is consistent with the key disk identifier.
And the second execution module 79 is configured to perform a second disk replacement process on the target disk corresponding to the target disk token based on the disk information corresponding to the key disk token when the target disk token is inconsistent with the key disk token.
Specifically, the method for determining whether the target disk drive is consistent with the key disk drive may refer to the method for determining whether the target disk drive is consistent with the preset disk drive in the above embodiment, which is not described herein.
Specifically, the second execution module 79 further includes, as shown in fig. 14:
a time interval list acquisition module 791, configured to acquire the preset time interval list;
the intermediate disk drive list generating module 793 is configured to generate an intermediate disk drive list based on a preset disk drive corresponding to a preset time interval when the preset time interval is less than a preset time interval threshold;
a fifth execution module 795, configured to traverse the intermediate disk identifier list, and perform a second disk replacement process on the target disk corresponding to the target disk identifier based on the disk information corresponding to the key disk identifier when all the intermediate disk identifiers are inconsistent with the target disk identifier;
the sixth execution module 797 is configured to perform a first disk replacement process on the target disk corresponding to the target disk token when the intermediate disk token matches the target disk token.
Further, the intermediate disk drive is a preset disk drive corresponding to the preset time interval when the preset time interval is smaller than a preset time interval threshold.
In the above embodiment, by pulling out the disk only in a short time according to the time interval, the process of disk changing processing can be reduced, and when the disk is inserted into the slot again, only mounting processing is needed, so that the process is simplified, and the disk changing efficiency and accuracy are improved.
Preferably, in the performing disc replacement processing module 70, when performing target disc replacement processing on the target disc drive, the target disc drive is replaced with a preset disc drive or inserted into a preset disc drive list; the preset disk drive symbol or the preset disk drive symbol list can be updated, so that when a new disk is inserted into the disk slot, whether the second disk changing process needs to be executed or not can be accurately and effectively determined, and further the disk changing efficiency and accuracy are improved.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program:
obtaining a target disk slot ID list according to a disk insertion request;
acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list;
generating a target disk drive corresponding to the target disk slot ID according to the target disk information;
and carrying out target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
obtaining a target disk slot ID list according to a disk insertion request;
acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list;
generating a target disk drive corresponding to the target disk slot ID according to the target disk information;
and carrying out target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The present invention is not limited to the above-mentioned embodiments, but is intended to be limited to the following embodiments, and any modifications, equivalents and modifications can be made to the above-mentioned embodiments without departing from the scope of the invention.

Claims (8)

1. A method of controlling replacement of a disk, the method comprising:
obtaining a target disk slot ID list according to a disk insertion request;
acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list;
generating a target disk drive corresponding to the target disk slot ID according to the target disk information;
performing target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier, wherein the step of performing target disc replacement processing on the target disc of the target disc slot ID according to the target disc identifier further comprises the following steps:
acquiring a preset disk slot ID list;
obtaining a preset disk drive list corresponding to the preset disk slot ID according to the target disk slot ID, wherein the preset disk drive list comprises at least two preset disk drives;
traversing the preset disk drive list and acquiring key disk drive from the preset disk drive list;
when the target disk character is consistent with the key disk character, performing first disk changing processing on a target disk corresponding to the target disk character, wherein the first disk changing processing is disk mounting processing;
and when the target disk drive is inconsistent with the key disk drive, performing second disk changing processing on the target disk corresponding to the target disk drive based on the disk information corresponding to the key disk drive, wherein the second disk changing processing comprises: initialization processing of a disk, partition processing of the disk and mounting processing of the disk.
2. The method according to claim 1, wherein the step of traversing the preset disk drive list and obtaining key disk drives from the preset disk drive list further comprises the steps of:
acquiring a target time point of the target disk character according to the target disk information;
acquiring a preset time interval list corresponding to the preset disk drive list according to the target time point and the preset disk drive list, wherein the preset time interval in the preset time interval list is the time interval between the target time point and preset time corresponding to each preset disk drive in the preset disk drive list;
traversing the preset time interval list and acquiring a preset disk drive corresponding to the minimum preset time interval in the preset time interval list as a key disk drive.
3. The method according to claim 1, wherein when the target disk drive is inconsistent with the key disk drive, performing a second disk replacement process on the target disk corresponding to the target disk drive based on the disk information corresponding to the key disk drive, the second disk replacement process including: the steps of the initialization processing of the disk, the partition processing of the disk and the mounting processing of the disk further comprise the following steps:
acquiring the preset time interval list;
when the preset time interval is smaller than a preset time interval threshold, generating an intermediate disk character list based on a preset disk character corresponding to the preset time interval;
traversing the intermediate disk character list, and performing second disk changing processing on a target disk corresponding to the target disk character based on disk information corresponding to the key disk character when all the intermediate disk characters are inconsistent with the target disk character;
and when the middle disk character is consistent with the target disk character, performing first disk changing processing on the target disk corresponding to the target disk character.
4. A control device for replacing a magnetic disk, the device comprising:
the first acquisition module is used for acquiring a target disk slot ID list according to a disk insertion request;
the information acquisition module is used for acquiring target disk information corresponding to any target disk slot ID in the target disk slot ID list according to the target disk slot ID list;
the disk symbol generation module is used for generating a target disk symbol corresponding to the target disk slot ID according to the target disk information;
the disc replacement processing module is used for carrying out target disc replacement processing on a target disc of a target disc slot ID according to a target disc drive, and the disc replacement processing module comprises:
the second acquisition module is used for acquiring a preset disk slot ID list;
a third obtaining module, configured to obtain a preset disk drive list corresponding to a preset disk slot ID according to the target disk slot ID, where the preset disk drive list includes at least two preset disk drives;
the second disk character acquisition module is used for traversing the preset disk character list and acquiring key disk characters from the preset disk character list;
the first execution module is used for carrying out first disk changing processing on the target disk corresponding to the target disk identifier when the target disk identifier is consistent with the key disk identifier, wherein the first disk changing processing is disk mounting processing;
the second execution module is configured to perform, when the target disk identifier is inconsistent with the key disk identifier, a second disk replacement process on a target disk corresponding to the target disk identifier based on disk information corresponding to the key disk identifier, where the second disk replacement process includes: initialization processing of a disk, partition processing of the disk and mounting processing of the disk.
5. The apparatus according to claim 4, wherein the drive letter acquisition module includes:
the time acquisition module is used for acquiring a target time point of the target disk symbol according to the target disk information;
the time interval acquisition module is used for acquiring a preset time interval list corresponding to the preset disk drive list according to the target time point and the preset disk drive list, wherein the preset time interval in the preset time interval list is the time interval between the target time point and preset time corresponding to each preset disk drive in the preset disk drive list;
the disk symbol determining module is used for traversing the preset time interval list and acquiring a preset disk symbol corresponding to the minimum preset time interval in the preset time interval list as a key disk symbol.
6. The apparatus according to claim 4, further comprising, in the second execution module:
the time interval list acquisition module is used for acquiring the preset time interval list;
the middle disk drive list generation module is used for generating a middle disk drive list based on a preset disk drive corresponding to a preset time interval when the preset time interval is smaller than a preset time interval threshold;
a fifth execution module, configured to traverse the intermediate disk identifier list, and perform a second disk replacement process on a target disk corresponding to the target disk identifier based on disk information corresponding to the key disk identifier when all the intermediate disk identifiers are inconsistent with the target disk identifier;
and the sixth execution module is used for carrying out first disk changing processing on the target disk corresponding to the target disk character when the middle disk character is consistent with the target disk character.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements a method of controlling replacement of a disk according to any one of claims 1 to 3 when executing the computer program.
8. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method for controlling replacement of a disk according to any one of claims 1 to 3.
CN202211138392.9A 2022-05-31 2022-05-31 Control method and device for replacing magnetic disk, computer equipment and storage medium Pending CN116521058A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211138392.9A CN116521058A (en) 2022-05-31 2022-05-31 Control method and device for replacing magnetic disk, computer equipment and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211138392.9A CN116521058A (en) 2022-05-31 2022-05-31 Control method and device for replacing magnetic disk, computer equipment and storage medium
CN202210607028.6A CN114691052B (en) 2022-05-31 2022-05-31 Method and device for replacing magnetic disk, computer equipment and storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202210607028.6A Division CN114691052B (en) 2022-05-31 2022-05-31 Method and device for replacing magnetic disk, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116521058A true CN116521058A (en) 2023-08-01

Family

ID=82130981

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202211138392.9A Pending CN116521058A (en) 2022-05-31 2022-05-31 Control method and device for replacing magnetic disk, computer equipment and storage medium
CN202210607028.6A Active CN114691052B (en) 2022-05-31 2022-05-31 Method and device for replacing magnetic disk, computer equipment and storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210607028.6A Active CN114691052B (en) 2022-05-31 2022-05-31 Method and device for replacing magnetic disk, computer equipment and storage medium

Country Status (1)

Country Link
CN (2) CN116521058A (en)

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2892910B2 (en) * 1993-08-02 1999-05-17 株式会社日立製作所 Disk array system
JP4413518B2 (en) * 2003-04-16 2010-02-10 株式会社日立製作所 Storage device control apparatus and storage device control apparatus control method
US9203876B2 (en) * 2011-03-16 2015-12-01 International Business Machines Corporation Automatic registration of devices
CN103677650B (en) * 2012-09-12 2017-02-08 北京百度网讯科技有限公司 Drive letter drifting preventing and treating method and device
CN108076090B (en) * 2016-11-11 2021-05-18 华为技术有限公司 Data processing method and storage management system
CN106528005B (en) * 2017-01-12 2019-12-31 苏州浪潮智能科技有限公司 Disk adding method and device of distributed storage system
CN108733518B (en) * 2017-04-17 2021-07-09 伊姆西Ip控股有限责任公司 Method, apparatus, and computer-readable medium for managing a storage system
CN107239273B (en) * 2017-05-02 2020-08-28 杭州沃趣科技股份有限公司 Disk drive binding method of server
CN111124253B (en) * 2018-10-30 2023-10-27 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for managing storage devices
CN110096413A (en) * 2019-05-08 2019-08-06 苏州浪潮智能科技有限公司 A kind of disk localization method, system and electronic equipment and storage medium
CN110442307A (en) * 2019-06-29 2019-11-12 苏州浪潮智能科技有限公司 Binding method, equipment and the storage medium of disk in a kind of linux system
CN113687797B (en) * 2021-10-25 2022-02-22 苏州浪潮智能科技有限公司 Disk management method, system, storage medium and equipment

Also Published As

Publication number Publication date
CN114691052B (en) 2022-10-14
CN114691052A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
CN111475517B (en) Data updating method, device, computer equipment and storage medium
CN109189756A (en) Electronic device, the method for Data Migration and storage medium
CN107632943B (en) Solid state disk data protection method and solid state disk
CN112224246B (en) Test report generation method and device based on interface test
CN102243884B (en) Method for storing streaming media data and apparatus thereof
CN114995771A (en) Formatting scheduling method, device, equipment and medium for redundant array of independent disks
CN112558868A (en) Method, device and equipment for storing configuration data
CN111831639B (en) Global unique ID generation method and device and vehicle management system
CN116521058A (en) Control method and device for replacing magnetic disk, computer equipment and storage medium
CN105243003A (en) Memory allocation monitoring method and apparatus
CN113157600A (en) Space allocation method of shingled hard disk, file storage system and server
CN109633331B (en) Data storage method and fault recording device
CN105243011A (en) Memory leak positioning method and apparatus
CN109165305B (en) Characteristic value storage and retrieval method and device
CN112800123B (en) Data processing method, device, computer equipment and storage medium
CN115328851A (en) Data protection method, device, equipment and medium
CN114415956A (en) Classified storage device for electronic information technology data processing and storage method thereof
CN110874182B (en) Processing method, device and equipment for strip index
CN105279103A (en) Data management method and apparatus
CN113868292A (en) Data reading method, data writing method, device and system
CN111090542A (en) Abnormal block identification method and device based on abnormal power failure and computer equipment
CN106484776B (en) Multithreading-based data processing method and device
CN108647125B (en) Method and system for recording thread calling condition
CN114706537B (en) Inactive data processing method and processing system of Internet of things equipment
CN110688391A (en) Massive Internet of things terminal query system, cloud database and side controller

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination