CN114691052B - Method and device for replacing magnetic disk, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN114691052B
CN114691052B CN202210607028.6A CN202210607028A CN114691052B CN 114691052 B CN114691052 B CN 114691052B CN 202210607028 A CN202210607028 A CN 202210607028A CN 114691052 B CN114691052 B CN 114691052B
Authority
CN
China
Prior art keywords
disk
target
preset
slot
list
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.)
Active
Application number
CN202210607028.6A
Other languages
Chinese (zh)
Other versions
CN114691052A (en
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
Priority to CN202210607028.6A priority patent/CN114691052B/en
Publication of CN114691052A publication Critical patent/CN114691052A/en
Application granted granted Critical
Publication of CN114691052B publication Critical patent/CN114691052B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention relates to the technical field of disk replacement, in particular to a disk replacement method, a disk replacement device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a target disk slot ID list according to the 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 symbol corresponding to the target disk slot ID according to the target disk information; and performing target disk replacement processing on the target disk of the target disk slot ID according to the target disk drive letter, wherein whether the target disk is a newly inserted disk is determined according to the comparison between the target disk drive letter and a preset disk drive letter, and then executing a disk replacement program to process the newly inserted disk so as to realize automatic disk replacement, avoid low efficiency and high error rate caused by the conventional manual processing of the disk, and improve the disk replacement efficiency and accuracy.

Description

Method and device for replacing magnetic disk, computer equipment and storage medium
Technical Field
The present invention relates to the field of disk replacement technologies, and in particular, to a disk replacement method and apparatus, 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. Particularly, mass data can be stored in a magnetic disk of the equipment, and when the magnetic disk has an abnormal condition, the magnetic disk needs to be replaced, so that the equipment abnormality caused by the damage of the magnetic disk is avoided.
In the prior art, after a new disk is recognized, the disk is manually processed, for example, the processes such as partitioning and mounting are carried out, so that the efficiency is low and the error rate is high.
Therefore, how to effectively solve the problem of automatic disk replacement is a technical problem that needs to be solved urgently by those skilled in the art at present.
Disclosure of Invention
In view of the above technical problems, the present invention provides a method for replacing a magnetic disk, the method including:
acquiring a target disk slot ID list according to the 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 symbol corresponding to the target disk slot ID according to the target disk information;
and performing target disk changing processing on the target disk of the target disk slot ID according to the target disk drive letter.
The invention also protects a disk replacing device, which comprises:
the first acquisition module is used for acquiring a target disk slot ID list according to the 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 drive letter generation module is used for generating a target disk drive letter corresponding to the target disk slot ID according to the target disk information;
and the disc changing processing module is used for performing target disc changing processing on the target disc of the target disc slot ID according to the target disc identifier.
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 executes the computer program to realize the disk replacement method.
The present invention protects a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method of replacing a magnetic disk.
Compared with the prior art, the invention has obvious advantages and beneficial effects. By means of the technical scheme, the disk replacing method, the disk replacing device, the computer equipment and the storage medium can achieve considerable technical progress and practicability, have wide industrial utilization value and at least have the following advantages:
the invention discloses a method and a device for replacing a magnetic disk, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a target disk slot ID list according to the 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 letter corresponding to the target disk slot ID according to the target disk information; and performing target disk changing processing on the target disk of the target disk slot ID according to the target disk drive letter, wherein whether the target disk is a newly inserted disk is determined according to comparison between the target disk drive letter and a preset disk drive letter, and then executing a disk changing program to process the newly inserted disk so as to realize automatic disk changing, avoid low efficiency and high error rate caused by the conventional manual processing of the disk, and improve the disk changing efficiency and accuracy.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Drawings
Fig. 1 is a flowchart of a method for replacing a disk according to an embodiment of the present invention;
fig. 2 is a flowchart of a step S600 according to an embodiment of the present invention;
fig. 3 is a flowchart of step S700 according to an embodiment of the present invention;
fig. 4 is a flowchart of another step S700 provided in the first embodiment of the present invention;
fig. 5 is a flowchart for determining whether the target disk identifier is consistent with the preset disk identifier according to an embodiment of the present invention;
fig. 6 is a flowchart of step S705 according to an embodiment of the present invention;
fig. 7 is a flowchart of step S709 according to an embodiment of the invention;
FIG. 8 is a schematic structural diagram of a disk changer 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 a second embodiment of the present invention;
fig. 12 is a schematic structural diagram of a determining module according to an 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
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description will be given with reference to the accompanying drawings and preferred embodiments of a data processing system for acquiring a target position and its effects.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or 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, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
As shown in fig. 1, a first embodiment provides a method for replacing a magnetic disk, the method including the steps of:
s100, acquiring a target disk slot ID list according to the disk insertion request.
Specifically, the disk insertion request is determined by monitoring the disk slot through a daemon process preset in the system, and a method for monitoring the disk slot by the daemon process is known by those skilled in the art and is not described herein again.
Further, the preset daemon process is a daemon process of udev.
Specifically, the target disk slot ID list is a data list constructed based on a target disk slot ID, and the target disk slot ID is a unique device identifier of the target disk slot, where the target disk slot is a preset disk slot into which a disk is reinserted.
Further, the preset disk slots refer to all the disk slots which can be monitored by a preset daemon process in the system.
S300, 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.
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 identifier corresponding to the target disk slot ID according to the target disk information; those skilled in the art know that any method for generating the disk identifier according to the disk information belongs to the protection scope of the present invention, and will not be described herein again.
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 S600 step further includes the steps of:
s601, obtaining 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 prompt information and stopping target disk changing processing on the target disk;
and S605, when the storage space of the target disk is not less than that of the initial disk, executing the step S700.
In the above embodiment, whether the disc replacement processing is performed is determined by comparing the space of the target disc with the space of the initial disc, which avoids the problem that the disc replacement processing cannot be performed due to a small space of a newly inserted disc, and further improves the disc replacement efficiency and accuracy.
S700, according to the target disk drive letter, carrying out target disk changing processing on the target disk of the target disk slot ID.
As shown in fig. 3, the step S700 further includes the following steps:
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 symbol.
Specifically, the preset disk slot ID list is a data list constructed based on a preset disk slot ID, where the preset disk slot ID is a unique identity of a preset disk slot.
S703, acquiring a preset disk identifier corresponding to a 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 identifier 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 drive letter is consistent with the preset disk drive letter, performing first disk changing processing on a target disk corresponding to the target disk drive letter;
and S707, when the target disk drive symbol is inconsistent with the preset disk drive symbol, performing second disk changing processing on the target disk corresponding to the target disk drive symbol based on the disk information corresponding to the preset disk.
Specifically, the target disc swap processing includes a first disc swap processing and a second disc swap processing, where the first disc swap processing is a mounting processing of a magnetic disc, and the second disc swap processing includes: initialization processing of a disk, partition processing of the disk, and mount processing of the disk.
As shown in fig. 4, the method further includes the following steps of determining whether the target disk identifier is consistent with the preset disk identifier:
s1, acquiring a target editing distance between the target disk drive symbol and the preset disk drive symbol;
s3, when the target editing distance is not larger than a preset distance threshold, determining that the target disk drive symbol is consistent with the preset disk drive symbol;
and S5, when the target editing distance is larger than a preset distance threshold, determining that the target disk drive symbol is inconsistent with the preset disk drive symbol.
Preferably, the distance threshold is 0, and it can be accurately determined whether the target disk identifier is consistent with the preset disk identifier.
As shown in fig. 5, in another specific embodiment, the step S700 further includes the following steps:
s701, acquiring a preset disk slot ID list.
S703, acquiring a preset disk drive symbol list corresponding to a preset disk slot ID according to the target disk slot ID, wherein the preset disk drive symbol list comprises at least two preset disk drive symbols; it can be understood that: the corresponding of any preset disk slot ID is not only a single preset disk letter, and the information of all disks inserted into any preset disk slot can be reserved, so that the subsequent improvement of the disk changing efficiency and accuracy is facilitated.
S705, traversing the preset disk drive list and obtaining the key disk drive from the preset disk drive list.
As shown in fig. 6, the step S705 further includes the following steps:
s7051, obtaining the target time of the target disk drive symbol 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.
S7053, obtaining a preset time interval list corresponding to the preset disk drive symbol list according to the target time point and the preset disk drive symbol list, where a 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 symbol in the preset disk drive symbol list.
Specifically, the preset time refers to a corresponding time point when each preset disk is inserted into the disk slot.
S7055, traversing the preset time interval list and obtaining a preset disk identifier corresponding to a minimum preset time interval in the preset time interval list as a key disk identifier.
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 the adjacent disk drives corresponding to the same disk slot can be compared, and whether the currently inserted disk is a new disk is determined.
And S707, when the target disk drive letter is consistent with the key disk drive letter, performing first disk changing processing on the target disk corresponding to the target disk drive letter.
And S709, when the target disk drive letter is not consistent with the key disk drive letter, performing second disk changing processing on the target disk corresponding to the target disk drive letter based on the disk information corresponding to the key disk drive letter.
Specifically, the method for determining whether the target disk drive letter is consistent with the key disk drive letter may refer to the method for determining whether the target disk drive letter is consistent with the preset disk drive letter in the foregoing embodiment, and details are not repeated here.
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 drive list based on a preset disk drive corresponding to the preset time interval;
s7095, traversing the intermediate disk drive symbol list, and when all the intermediate disk drive symbols are inconsistent with the target disk drive symbols, performing second disk changing processing on the target disk corresponding to the target disk drive symbols based on the disk information corresponding to the key disk drive symbols;
and S7097, when the intermediate disk drive letter is consistent with the target disk drive letter, performing first disk changing processing on the target disk corresponding to the target disk drive letter.
Further, the intermediate disk drive symbol refers to a preset disk drive symbol corresponding to the preset time interval when the preset time interval is smaller than a preset time interval threshold.
In the embodiment, according to the time interval, when the disk is pulled out for a short time, the process of disk changing processing can be reduced, and when the disk is inserted into the slot again, only mounting processing needs to be carried out, so that the flow is simplified, and the disk changing efficiency and accuracy are improved.
Preferably, in step S700, when the target disk drive letter is subjected to the target disk replacement processing, the target disk drive letter is replaced by the preset disk drive letter or the target disk drive letter is inserted into the preset disk drive letter 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 second disk changing processing needs to be executed or not can be accurately and effectively determined, and further the disk changing efficiency and accuracy are improved.
The embodiment provides a method for replacing a magnetic disk, which comprises the following steps: acquiring a target disk slot ID list according to the 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 symbol corresponding to the target disk slot ID according to the target disk information; and performing target disk replacement processing on the target disk of the target disk slot ID according to the target disk drive letter, wherein whether the target disk is a newly inserted disk is determined according to the comparison between the target disk drive letter and a preset disk drive letter, and then executing a disk replacement program to process the newly inserted disk so as to realize automatic disk replacement, avoid low efficiency and high error rate caused by the conventional manual processing of the disk, and improve the disk replacement efficiency and accuracy.
As shown in fig. 8, the first embodiment provides a disk replacement apparatus, including:
a first obtaining module 10, 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 through a daemon process preset in the system, and a method for monitoring the disk slot by the daemon process is known by those skilled in the art and is not described herein again.
Further, the preset daemon process is a daemon process of udev.
Specifically, the target disk slot ID list is a data list constructed based on a target disk slot ID, and the target disk slot ID is a unique device identifier of the target disk slot, where the target disk slot is a preset disk slot into which a disk is reinserted.
Further, the preset disk slots refer to all disk slots that can be monitored by a preset daemon process 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 one 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.
A drive letter generation module 50, configured to generate a target disk drive letter corresponding to the target disk slot ID according to the target disk information; those skilled in the art know that any method for generating the disk identifier according to the disk information belongs to the protection scope of the present invention, and will not be described herein again.
Specifically, before the disc replacement processing module 70, the method further includes:
and a determining module 60, configured to determine to execute the disc swap 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 that is inserted into a disk slot for the first time;
a third executing module 63, configured to send a prompt message and stop performing target disk replacement processing on the target disk when the storage space of the target disk is smaller than the storage space of the initial disk;
a fourth executing module 65, configured to execute the disc swap processing module 70 when the storage space of the target disc is not less than the storage space of the initial disc.
In the above embodiment, whether to perform the disc replacement processing is determined by comparing the space of the target disc with the space of the initial disc, which avoids the situation that the disc replacement processing cannot be performed due to a small space of a newly inserted disc, and further improves the disc replacement efficiency and accuracy.
And a disc swap processing module 70, configured to perform target disc swap processing on the target disc of the target disc slot ID according to the target disc identifier.
As shown in fig. 10, the disc changer 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 only corresponds to a single preset disk identifier.
Specifically, the preset disk slot ID list is a data list constructed based on a preset disk slot ID, where the preset disk slot ID is a unique identity of a preset disk slot.
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 identifier 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 executing module 75, configured to perform a first disk swap processing on a target disk corresponding to the target disk identifier when the target disk identifier is consistent with the preset disk identifier;
a second executing module 77, configured to, when the target disk identifier is inconsistent with the preset disk identifier, perform a second disk swap processing on the target disk corresponding to the target disk identifier based on the disk information corresponding to the preset disk.
Specifically, the target disc swap processing includes a first disc swap processing and a second disc swap processing, where the first disc swap processing is a mounting processing of a magnetic disc, and the second disc swap processing includes: initialization processing of a disk, partition processing of the disk, and mount processing of the disk.
Further, the apparatus further comprises:
and the determining module is used for determining whether the target disk drive symbol is consistent with the preset disk drive symbol or not.
As shown in fig. 11, the determination module includes:
the editing distance obtaining module 1 is configured to obtain a target editing distance between the target disk identifier and the preset disk identifier;
the first determining module 3 is configured to determine that the target disk drive letter is consistent with the preset disk drive letter when the target editing distance is not greater than a preset distance threshold;
and a second determining module 5, configured to determine that the target disk drive symbol is inconsistent with the preset disk drive symbol when the target editing distance is greater than a preset distance threshold.
Preferably, the distance threshold is 0, so that whether the target disk identifier is consistent with the preset disk identifier 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, according to the target disk slot ID, a preset disk drive letter list corresponding to a preset disk slot ID, where the preset disk drive letter list includes at least two preset disk drive letters; it can be understood that: the ID of any preset disk slot corresponds to more than one preset disk identifier, so that the information of all disks inserted into any preset disk slot can be reserved, and the subsequent improvement of the disk replacement efficiency and accuracy is facilitated.
The second drive letter obtaining module 75 is configured to traverse the preset disk drive letter list and obtain a key disk drive letter from the preset disk drive letter list.
Specifically, the second drive letter acquiring module 75 further includes, as shown in fig. 13:
the time obtaining module 751 is configured to obtain a target time of the target disk identifier 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.
A time interval obtaining module 753, configured to obtain a preset time interval list corresponding to the preset disk identifier list according to the target time point and the preset disk identifier list, where a preset time interval in the preset time interval list refers to a time interval between the target time and a preset time corresponding to each preset disk identifier in the preset disk identifier list.
Specifically, the preset time refers to a corresponding time point when each preset disk is inserted into a disk slot.
The drive letter determining module 755 is configured to traverse the preset time interval list and obtain a preset drive letter corresponding to a minimum preset time interval in the preset time interval list as a key drive letter.
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 the adjacent disk drives corresponding to the same disk slot can be compared, and whether the currently inserted disk is a new disk is determined.
A first executing module 77, configured to perform a first disk changing process on the target disk corresponding to the target disk identifier when the target disk identifier is consistent with the key disk identifier.
And a second executing module 79, configured to, when the target disk identifier is inconsistent with the key disk identifier, 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.
Specifically, the method for determining whether the target disk identifier is consistent with the key disk identifier may refer to the method for determining whether the target disk identifier is consistent with the preset disk identifier in the foregoing embodiment, and details are not repeated here.
Specifically, the second execution module 79 further includes, as shown in fig. 14:
a time interval list obtaining module 791, configured to obtain the preset time interval list;
an intermediate disk drive symbol list generating module 793, configured to generate an intermediate disk drive symbol list based on a preset disk drive symbol corresponding to a preset time interval when the preset time interval is smaller than a preset time interval threshold;
a fifth executing module 795, configured to traverse the intermediate disk drive letter list, and when all the intermediate disk drive letters are inconsistent with the target disk drive letter, perform second disk replacement processing on the target disk corresponding to the target disk drive letter based on the disk information corresponding to the key disk drive letter;
a sixth executing module 797, configured to perform the first disk replacement processing on the target disk corresponding to the target disk drive letter when the intermediate disk drive letter is identical to the target disk drive letter.
Further, the intermediate disk drive symbol refers to a preset disk drive symbol corresponding to the preset time interval when the preset time interval is smaller than a preset time interval threshold.
In the embodiment, according to the time interval, when the disk is pulled out for a short time, the process of disk changing processing can be reduced, and when the disk is inserted into the slot again, only mounting processing needs to be carried out, so that the flow is simplified, and the disk changing efficiency and accuracy are improved.
Preferably, in the disc swap processing module 70, when the target disc identifier is subjected to the target disc swap processing, the target disc identifier is replaced by the preset disc identifier or the target disc identifier is inserted into the preset disc identifier 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 second disk changing processing 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 following steps when executing the computer program:
acquiring a target disk slot ID list according to the 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 symbol corresponding to the target disk slot ID according to the target disk information;
and performing target disk replacement processing on the target disk of the target disk slot ID according to the target disk drive 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:
acquiring a target disk slot ID list according to the 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 symbol corresponding to the target disk slot ID according to the target disk information;
and performing target disk replacement processing on the target disk of the target disk slot ID according to the target disk drive identifier.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile 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), rambus (Rambus) direct RAM (RDRAM), direct Rambus Dynamic RAM (DRDRAM), and Rambus 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-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. A method of replacing a disk, the method comprising:
acquiring a target disk slot ID list according to the 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 symbol corresponding to the target disk slot ID according to the target disk information;
according to the target disk drive letter, carrying out target disk swap processing on the target disk of the target disk slot ID, wherein the step of carrying out the target disk swap processing on the target disk of the target disk slot ID according to the target disk drive letter comprises the following steps:
acquiring a preset disk slot ID list, wherein each preset disk slot ID in the preset disk slot ID list corresponds to a preset disk identifier;
acquiring a preset disk identifier corresponding to a preset disk slot ID from the preset disk slot ID list according to the target disk slot ID;
when the target disk drive letter is consistent with the preset disk drive letter, performing first disk changing processing on a target disk corresponding to the target disk drive letter, wherein the first disk changing processing is mounting processing of the disk;
when the target disk drive letter is inconsistent with the preset disk drive letter, performing second disk changing processing on the target disk corresponding to the target disk drive letter based on the disk information corresponding to the preset disk drive letter, wherein the second disk changing processing comprises: initialization processing of a disk, partition processing of the disk, and mount processing of the disk.
2. A method of replacing a magnetic disk, the method comprising:
acquiring a target disk slot ID list according to the 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 symbol corresponding to the target disk slot ID according to the target disk information;
according to the target disk drive letter, carrying out target disk swap processing on the target disk of the target disk slot ID, wherein the step of carrying out the target disk swap processing on the target disk of the target disk slot ID according to the target disk drive letter further comprises the following steps:
acquiring a preset disk slot ID list;
acquiring a preset disk drive symbol list corresponding to a preset disk slot ID according to the target disk slot ID, wherein the preset disk drive symbol list comprises at least two preset disk drive symbols;
traversing the preset disk drive character list and acquiring a key disk drive character from the preset disk drive character list;
when the target disk drive letter is consistent with the key disk drive letter, performing first disk changing processing on a target disk corresponding to the target disk drive letter, wherein the first disk changing processing is mounting processing of the disk;
when the target disk drive letter is inconsistent with the key disk drive letter, performing second disk changing processing on a target disk corresponding to the target disk drive letter based on disk information corresponding to the key disk drive letter, wherein the second disk changing processing comprises: initialization processing of a disk, partition processing of the disk and mounting processing of the disk.
3. The method for replacing a disk according to claim 2, wherein the step of traversing the preset disk letter list and obtaining the key disk letter from the preset disk letter list further comprises the steps of:
acquiring a target time point of the target disk identifier according to the target disk information;
acquiring a preset time interval list corresponding to the preset disk drive symbol list according to the target time point and the preset disk drive symbol list, wherein the preset time interval in the preset time interval list refers to a time interval between the target time point and preset time corresponding to each preset disk drive symbol in the preset disk drive symbol list;
and traversing the preset time interval list and acquiring a preset disk drive symbol corresponding to the minimum preset time interval in the preset time interval list as a key disk drive symbol.
4. An apparatus for replacing a magnetic disk, comprising:
the first acquisition module is used for acquiring a target disk slot ID list according to the 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 drive letter generation module is used for generating a target disk drive letter corresponding to the target disk slot ID according to the target disk information;
a disc swap processing module, configured to perform target disc swap processing on a target disc of a target disc slot ID according to a target disc identifier, where the disc swap processing module includes:
the second acquisition module is used for acquiring a preset disk slot ID list, wherein each preset disk slot ID in the preset disk slot ID list corresponds to a preset disk drive letter;
a first disk identifier obtaining module, 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;
the first execution module is used for performing first disk changing processing on a target disk corresponding to the target disk identifier when the target disk identifier is consistent with the preset disk identifier, wherein the first disk changing processing is mounting processing of a disk;
a second execution module, configured to, when the target disk drive letter is inconsistent with the preset disk drive letter, perform a second disk swap processing on a target disk corresponding to the target disk drive letter based on disk information corresponding to the preset disk drive letter, where the second disk swap processing includes: initialization processing of a disk, partition processing of the disk, and mount processing of the disk.
5. An apparatus for replacing a magnetic disk, comprising:
the first acquisition module is used for acquiring a target disk slot ID list according to the 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 drive letter generation module is used for generating a target disk drive letter corresponding to the target disk slot ID according to the target disk information;
a disc-changing processing module, configured to perform target disc-changing processing on a target disc of a target disc slot ID according to a target disc identifier, where the disc-changing processing module includes:
the second acquisition module is used for acquiring a preset disk slot ID list;
a third obtaining module, configured to obtain, according to the target disk slot ID, a preset disk identifier list corresponding to a preset disk slot ID, where the preset disk identifier list includes at least two preset disk identifiers;
the second drive letter acquisition module is used for traversing the preset disk drive letter list and acquiring a key disk drive letter from the preset disk drive letter list;
the first execution module is used for performing first disk changing processing on a target disk corresponding to the target disk drive letter when the target disk drive letter is consistent with the key disk drive letter;
and the second execution module is used for performing second disk changing processing on the target disk corresponding to the target disk drive symbol based on the disk information corresponding to the key disk drive symbol when the target disk drive symbol is inconsistent with the key disk drive symbol.
6. The apparatus for replacing a magnetic disk according to claim 5, wherein the drive letter acquisition module comprises:
the time acquisition module is used for acquiring a target time point of the target disk identifier according to the target disk information;
a time interval obtaining module, configured to obtain a preset time interval list corresponding to the preset disk identifier list according to the target time point and the preset disk identifier list, where a preset time interval in the preset time interval list is a time interval between the target time point and a preset time corresponding to each preset disk identifier in the preset disk identifier list;
and the drive letter determining module is used for traversing the preset time interval list and acquiring a preset drive letter corresponding to the minimum preset time interval in the preset time interval list as a key drive letter.
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 the method of replacing 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 is executed by a processor to implement the method for replacing a magnetic disk according to any one of claims 1 to 3.
CN202210607028.6A 2022-05-31 2022-05-31 Method and device for replacing magnetic disk, computer equipment and storage medium Active CN114691052B (en)

Priority Applications (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

Applications Claiming Priority (1)

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

Related Child Applications (1)

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

Publications (2)

Publication Number Publication Date
CN114691052A CN114691052A (en) 2022-07-01
CN114691052B true CN114691052B (en) 2022-10-14

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 Before (1)

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

Country Status (1)

Country Link
CN (2) CN116521058A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442307A (en) * 2019-06-29 2019-11-12 苏州浪潮智能科技有限公司 Binding method, equipment and the storage medium of disk in a kind of linux system

Family Cites Families (11)

* 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
CN113687797B (en) * 2021-10-25 2022-02-22 苏州浪潮智能科技有限公司 Disk management method, system, storage medium and equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442307A (en) * 2019-06-29 2019-11-12 苏州浪潮智能科技有限公司 Binding method, equipment and the storage medium of disk in a kind of linux system

Also Published As

Publication number Publication date
CN116521058A (en) 2023-08-01
CN114691052A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
CN111475517B (en) Data updating method, device, computer equipment and storage medium
CN109669844B (en) Equipment fault processing method, device, equipment and storage medium
CN114995771A (en) Formatting scheduling method, device, equipment and medium for redundant array of independent disks
CN110727698A (en) Database access method and device, computer equipment and storage medium
CN112256492A (en) Block device backup method, device and storage medium
US11199997B2 (en) Storage device operations using a die translation table
CN114691052B (en) Method and device for replacing magnetic disk, computer equipment and storage medium
CN111831639B (en) Global unique ID generation method and device and vehicle management system
CN111427943A (en) Task management method and device in ET L system
CN108958665B (en) Method and device for storing historical record information
CN105243011A (en) Memory leak positioning method and apparatus
CN109753384B (en) Cloud host snapshot backup method and device, computer equipment and storage medium
CN116775406A (en) Disk state monitoring method and device for distributed storage system
CN111209138A (en) Operation and maintenance method and device of data storage system
CN112800123B (en) Data processing method, device, computer equipment and storage medium
CN112732640B (en) Method and device for detecting leakage of file descriptor
CN113886342A (en) File format conversion method and device, storage medium and processor
CN113312309B (en) Snapshot chain management method, device and storage medium
CN114500249A (en) Root cause positioning method and device
CN114221863A (en) Intelligent node election method for distributed cluster
CN108959604B (en) Method, apparatus and computer readable storage medium for maintaining database cluster
CN110717131B (en) Page revising monitoring method and related system
CN113392088B (en) Data synchronization method, device, terminal and storage medium
CN112882866B (en) Backup method suitable for mass files
CN112306551B (en) Historical configuration information acquisition method, system and device

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
GR01 Patent grant
GR01 Patent grant