Storage device control method and device, storage medium and electronic device

By introducing identification storage space and controllers into the storage device, data loss caused by multiple storage systems simultaneously managing the same hard disk frame is solved, and efficient storage device control is achieved, ensuring data security and accuracy.

CN119690343AActive Publication Date: 2025-03-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411755745.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-30
Publication Date
2025-03-25
Estimated Expiration
2044-11-30

AI Technical Summary

Technical Problem

In a storage device, when multiple storage systems manage the same hard disk box at the same time, it may lead to a serious risk of data loss because different storage systems do not know whether to connect to and manage the use of the same hard disk box.

Method used

By introducing data storage space, identification storage space and controllers into the extended storage device, the identification storage space is stored in the identification storage space that currently allows access to the data storage space. When other storage systems want to access the data storage space, they will determine whether to allow access by reading the identification in the identification storage space, and when allowed, write the target identification into the identification storage space to realize the use and management of the extended storage device.

Benefits of technology

It realizes that only one storage system allows access to data storage space at the same time, avoiding the risk of data loss caused by simultaneous access of multiple storage systems, and improving the control efficiency of storage devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690343A_ABST
    Figure CN119690343A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a control method and device of a storage device, a storage medium and an electronic device.The method comprises the steps that an access request initiated by a target storage device in multiple storage devices is received; in response to the access request, reading the identifier from the second identifier storage space to obtain a reference identifier; according to the reference identifier and a target identifier of the target storage system, detecting a current target use state of the data storage space; and under the condition that the target use state is used for indicating that the target storage device is allowed to access the data storage space, writing the target identifier into a second identifier storage space, and controlling a second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space. By means of the method and device, the problem that the control efficiency of the storage device is low is solved, and the effect of improving the control efficiency of the storage device is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of storage devices, and more specifically, to a storage device control method and apparatus, a storage medium, and an electronic device. Background Art

[0002] The storage device significantly increases the storage capacity of the storage system by connecting to an expansion storage device, such as a hard disk frame. In the related art, the storage device and the hard disk frame can be connected through a switch, and can perform RoCE connection and IO (InputOutput, i.e. input / output) read and write operations normally. After passing through the switch, the plug-and-play function is normal. When the connection method is through a switch, there may be a scenario where different storage systems are connected to the same hard disk frame. Since different storage systems do not know whether they are connected to and manage the same hard disk frame, when different storage systems use the hard disks of the same hard disk frame to perform business, it will lead to a serious risk of data loss.

[0003] It is understandable that in the related art, there may be multiple storage systems that simultaneously read and write data in the same hard disk frame. In such a case, when storage system 1 writes data 1 to hard disk frame 1, storage system 2 may modify data 1, resulting in a serious risk of data loss. Summary of the invention

[0004] The embodiments of the present application provide a storage device control method and apparatus, a storage medium, and an electronic device to at least solve the problem of low control efficiency of storage devices in related technologies.

[0005] According to an embodiment of the present application, a method for controlling a storage device is provided, wherein a target storage system includes multiple storage devices and a first controller, the first controller is connected to the multiple storage devices, the extended storage device includes a data storage space, a first identification storage space, a second identification storage space, and a second controller, the multiple storage devices are connected to the data storage space, the first controller is connected to the second identification storage space and the second controller, the second controller is connected to the first identification storage space and the second identification storage space, the first identification storage space is used to store an identification of a reference storage system currently allowed to access the data storage space, the second identification storage space is used to store an identification read by the second controller from the first identification storage space, and the method is applied to the first Controller, the method includes: receiving an access request initiated by a target storage device among the multiple storage devices, wherein the access request is used to request access to the data storage space; in response to the access request, reading an identifier from the second identifier storage space to obtain a reference identifier; detecting a current target usage status of the data storage space based on the reference identifier and the target identifier of the target storage system, wherein the target usage status is used to indicate whether the target storage device is allowed to access the data storage space; in the case where the target usage status is used to indicate that the target storage device is allowed to access the data storage space, writing the target identifier into the second identifier storage space, and controlling the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space.

[0006] In an exemplary embodiment, detecting the current target usage status of the data storage space based on the reference identifier and the target identifier of the target storage system includes: comparing a first storage device identifier in the reference identifier with a second storage device identifier in the target identifier to obtain a comparison result, wherein the first storage device identifier is the identifier of the first storage device in the reference storage system, and the second storage device identifier is the identifier of the first storage device in the target storage system; and detecting the target usage status based on the comparison result.

[0007] In an exemplary embodiment, detecting the target usage status based on the comparison result includes: when the comparison result is used to indicate that the first storage device identifier is empty, or when the first storage device identifier is the same as the second storage device identifier, determining that the target usage status is used to indicate that the target storage device is allowed to access the data storage space; when the comparison result is used to indicate that the first storage device identifier is not empty and the first storage device identifier is different from the second storage device identifier, determining that the target usage status is used to indicate that the target storage device is not allowed to access the data storage space.

[0008] In an exemplary embodiment, before reading the identifier from the second identifier storage space to obtain the reference identifier, the method further includes: extracting the second storage device identifier of the first storage device in the target storage system, and extracting the target number of storage systems to which the first storage device added to the target storage system when establishing the target storage system has been added; obtaining a target identifier parameter corresponding to the target number from identifier parameters and quantities having a corresponding relationship; and determining the target identifier based on the second storage device identifier and the target identifier parameter.

[0009] In an exemplary embodiment, determining the target identifier based on the second storage device identifier and the target identifier parameter includes: performing a concatenation operation on the second storage device identifier and the target identifier parameter to obtain a candidate identifier; and performing a mask operation on the target identifier parameter in the candidate identifier to obtain the target identifier.

[0010] In an exemplary embodiment, before reading the identifier from the second identifier storage space to obtain the reference identifier, the method further includes: upon receiving the access request, reading the identifier from the first identifier storage space to obtain the reference identifier, and storing the reference identifier in the second identifier storage space; or, according to the target cycle, reading the identifier from the first identifier storage space to obtain the reference identifier, and storing the reference identifier in the second identifier storage space.

[0011] In an exemplary embodiment, the controlling the second controller to store the target identifier stored in the second identifier storage space to the first identifier storage space includes: generating a target storage request, wherein the target storage request is used to request that the target identifier stored in the second identifier storage space be stored in the first identifier storage space; sending the target storage request to the second controller, wherein the second controller is used to execute the target storage request; the second controller includes a target interface, and the target interface is connected to the first identifier storage space. After sending the target storage request to the second controller, the method also includes: in response to the received target storage request, extracting an identifier from the second identifier storage space to obtain the target identifier; and writing the target identifier to the first identifier storage space through the target interface.

[0012] According to another embodiment of the present application, a control device for a storage device is provided, wherein a target storage system includes multiple storage devices and a first controller, the first controller is connected to the multiple storage devices, the extended storage device includes a data storage space, a first identification storage space, a second identification storage space, and a second controller, the multiple storage devices are connected to the data storage space, the first controller is connected to the second identification storage space and the second controller, the second controller is connected to the first identification storage space and the second identification storage space, the first identification storage space is used to store an identification of a reference storage system currently allowed to access the data storage space, the second identification storage space is used to store an identification read by the second controller from the first identification storage space, the device is applied to the first controller, and the device includes: a receiving module , used to receive an access request initiated by a target storage device among the multiple storage devices, wherein the access request is used to request access to the data storage space; a reading module, used to respond to the access request, read an identifier from the second identifier storage space, and obtain a reference identifier; a detection module, used to detect the current target usage status of the data storage space according to the reference identifier and the target identifier of the target storage system, wherein the target usage status is used to indicate whether the target storage device is allowed to access the data storage space; a first processing module, used to write the target identifier into the second identifier storage space when the target usage status indicates that the target storage device is allowed to access the data storage space, and control the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space.

[0013] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0014] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0016] Through the present application, the extended storage device includes a data storage space, an identification storage space and a controller. The identification storage space stores the identification of the storage system currently allowed to access the data storage space. When other storage systems want to access the data storage space, the controller in the storage system can read the identification of the storage system currently allowed to access the data storage space from the identification storage space, and determine whether to allow the storage system to access the data storage space based on its own identification and the read identification. When it is determined that the storage system is allowed to access the data storage space, the identification of the storage system is written into the identification storage space by the controller in the extended storage device, thereby realizing the use and management of the extended storage device by the storage system. In this way, it is achieved that only one storage system is allowed to access the data storage space in the extended storage device at the same time. Therefore, the problem of low control efficiency of the storage device can be solved, thereby achieving the effect of improving the control efficiency of the storage device. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a hardware structure block diagram of a server device of a storage device control method according to an embodiment of the present application;

[0018] Figure 2 is a flowchart of a method for controlling a storage device according to an embodiment of the present application;

[0019] Figure 3 is a schematic diagram of an optional method of reading an identifier from a second identifier storage space according to an embodiment of the present application;

[0020] Figure 4 is a schematic diagram of an optional method of writing a target identifier into a first identifier storage space according to an embodiment of the present application;

[0021] Figure 5 is a schematic diagram of a control method for a storage device according to an embodiment of the present application;

[0022] Figure 6 It is a structural block diagram of a control device of a storage device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0025] First, the terms involved in the embodiments of the present application are explained as follows:

[0026] BMC: Baseboard Management Controller, baseboard management controller, is a brand of BMC Software Corporation [NYSE: BMC].

[0027] RDMA: Remote Direct Memory Access, remote direct data access.

[0028] RoCE: RDMA over Converged Ethernet, remote direct data access based on aggregated Ethernet.

[0029] IO: Input Output, input and output.

[0030] MCS: Multiple Controller System, multi-controller system.

[0031] IPMI: Intelligent Platform Management Interface.

[0032] NVME-MI: Non-Volatile Memory Express-Management Interface, non-volatile memory fast channel-management interface.

[0033] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a storage device control method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0034] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the control method of the storage device in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0036] In this embodiment, a method for controlling a storage device is provided. Figure 2 is a flow chart of a method for controlling a storage device according to an embodiment of the present application. Figure 2As shown, the target storage system includes multiple storage devices and a first controller, the first controller is connected to the multiple storage devices, the extended storage device includes a data storage space, a first identification storage space, a second identification storage space and a second controller, the multiple storage devices are connected to the data storage space, the first controller is connected to the second identification storage space and the second controller, the second controller is connected to the first identification storage space and the second identification storage space, the first identification storage space is used to store the identification of the reference storage system currently allowed to access the data storage space, the second identification storage space is used to store the identification read by the second controller from the first identification storage space, the method is applied to the first controller, and the process includes the following steps:

[0037] Step S202, receiving an access request initiated by a target storage device among the multiple storage devices, wherein the access request is used to request access to the data storage space;

[0038] Step S204, in response to the access request, reading an identifier from the second identifier storage space to obtain a reference identifier;

[0039] Step S206, detecting a current target usage state of the data storage space according to the reference identifier and the target identifier of the target storage system, wherein the target usage state is used to indicate whether the target storage device is allowed to access the data storage space;

[0040] Step S208, when the target usage status is used to indicate that the target storage device is allowed to access the data storage space, write the target identifier into the second identifier storage space, and control the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space.

[0041] Through the above steps, the extended storage device includes a data storage space, an identification storage space and a controller. The identification storage space stores the identification of the storage system currently allowed to access the data storage space. When other storage systems want to access the data storage space, the controller in the storage system can read the identification of the storage system currently allowed to access the data storage space from the identification storage space, and determine whether to allow the storage system to access the data storage space based on its own identification and the read identification. When it is determined that the storage system is allowed to access the data storage space, the identification of the storage system is written into the identification storage space by the controller in the extended storage device, so as to realize the use and management of the extended storage device by the storage system. In this way, it is achieved that only one storage system is allowed to access the data storage space in the extended storage device at the same time. Therefore, the problem of low control efficiency of the storage device can be solved, thereby achieving the effect of improving the control efficiency of the storage device.

[0042] In the technical solution provided in the above step S202, the storage device may include but is not limited to storage devices of different device types, such as NVME hard disk, USB hard disk, SATA hard disk, etc.

[0043] Optionally, in this embodiment, the target storage device may be, but is not limited to, any one of the multiple storage devices.

[0044] Optionally, in this embodiment, the access request may be, but is not limited to, a request to read and write data in the data storage space. It is understandable that the access request may cause changes in the data in the data storage space, such as adding new data, reducing data, or modifying data.

[0045] Optionally, in this embodiment, the expansion storage device may be but is not limited to being used to expand the storage space of the storage device in the storage system. For example, when the expansion storage device includes a hard disk frame, the hard disk frame may be but is not limited to including a hard disk. In such a case, the first identification storage space may be but is not limited to including memory in the hard disk frame, and the second identification storage space may be but is not limited to including memory on the backplane on the hard disk frame.

[0046] In the technical solution provided in step S204 above, the reference identifier may be, but not limited to, different from the target identifier, or the reference identifier may be, but not limited to, the same as the target identifier. It is understandable that the storage system currently allowed to access the data storage space may be the same as or different from the target storage system.

[0047] In an exemplary embodiment, before the identifier is read from the second identifier storage space to obtain the reference identifier, the following method can be used, but is not limited to: extract the second storage device identifier of the first storage device in the target storage system, and extract the target number of storage systems to which the first storage device added to the target storage system when establishing the target storage system has been added; obtain the target identifier parameter corresponding to the target number from the identifier parameters and quantities having a corresponding relationship; and determine the target identifier based on the second storage device identifier and the target identifier parameter.

[0048] Optionally, in this embodiment, the target number can be but is not limited to being used to indicate the number of times the first storage device in the target storage system has been used to establish the storage system. For example, storage device 1 in storage system 1 is the first storage device added to the target storage system when the target storage system is established, and storage device 1 has previously been added to two storage systems. In this case, the target number is equal to 2.

[0049] Optionally, in this embodiment, the device identification of the storage device may include, but is not limited to, a serial number or a code number of the storage device.

[0050] Optionally, in this embodiment, the target identification parameter can also be but is not limited to being determined based on the time of creating the target storage system. For example, before reading the identification from the second identification storage space to obtain the reference identification, the above method also includes: extracting the second storage device identification of the first storage device in the target storage system, and extracting the target time for establishing the target storage system; obtaining the target identification parameter corresponding to the target time from the identification parameters and time with a corresponding relationship; and determining the target identification based on the second storage device identification and the target identification parameter.

[0051] Through the embodiments of the present application, corresponding identification parameters can be randomly generated according to the time when the storage system is created, thereby avoiding duplication between identifications of different storage systems and ensuring the uniqueness of the identification of the storage system, so that different storage systems can accurately distinguish the storage systems managed by the expanded storage device when using and managing the expanded storage device.

[0052] In an exemplary embodiment, the target identifier can be determined based on the second storage device identifier and the target identifier parameter in the following manner, but is not limited to: performing a concatenation operation on the second storage device identifier and the target identifier parameter to obtain a candidate identifier; and performing a mask operation on the target identifier parameter in the candidate identifier to obtain the target identifier.

[0053] Optionally, in this embodiment, before reading the identifier from the second identifier storage space to obtain the reference identifier, the method also includes: extracting the third storage device identifier of the first storage device in the reference storage system, and extracting the reference number of storage systems to which the first storage device in the reference storage system has been added; obtaining the reference identifier parameters corresponding to the reference number from the identifier parameters and quantities with a corresponding relationship; and determining the reference identifier based on the third storage device identifier and the reference identifier parameters.

[0054] Optionally, in this embodiment, the reference identifier can be determined based on the third storage device identifier and the reference identifier parameters in the following manner, but not limited to: performing a splicing operation on the third storage device identifier and the reference identifier parameters to obtain an initial identifier; and performing a masking operation on the reference identifier parameters in the initial identifier to obtain the reference identifier.

[0055] Optionally, in this embodiment, the concatenation result may include, but is not limited to, the second storage device identifier-the target identifier parameter, or the target identifier parameter-the second storage device identifier, and the like.

[0056] Optionally, in this embodiment, the mask operation may be, but is not limited to, setting a target identification parameter in the candidate identification to a preset identification parameter, where the preset identification parameter is different from the target identification parameter. For example, the target identification parameter may be, but is not limited to, set to 0.

[0057] Through the embodiments of the present application, on the one hand, the storage device identifier corresponding to each storage device is unique, and combined with the randomly generated identification parameters, the randomness of the generated storage system identifier is guaranteed; on the other hand, the identification parameters in the generated storage system identifier are masked, thereby avoiding the case where the storage system identifier is leaked. By analyzing the identification parameters in the storage system identifier, the generation pattern of the storage system identifier is found, thereby avoiding the leakage and loss of data stored in the expanded storage device, thereby ensuring the security of the data stored in the expanded storage device.

[0058] In an exemplary embodiment, before the identifier is read from the second identifier storage space to obtain the reference identifier, the following method can be used but is not limited to: upon receiving the access request, the identifier is read from the first identifier storage space to obtain the reference identifier, and the reference identifier is stored in the second identifier storage space; or, according to the target cycle, the identifier is read from the first identifier storage space to obtain the reference identifier, and the reference identifier is stored in the second identifier storage space.

[0059] Optionally, in this embodiment, when the expanded storage device includes a hard disk frame, the second controller may be, but is not limited to, a BMC (Baseboard Management Controller) on the backplane in the hard disk frame. In such a case, the BMC may be, but is not limited to, promptly reading the identifier from the first identifier storage space upon receiving an access request initiated by any storage device in the target storage system, obtaining a reference identifier, and storing the read reference identifier in the second identifier storage space, thereby ensuring the timeliness of the identifier of the storage system currently allowed to access the data storage space read by the BMC.

[0060] Alternatively, the BMC may also, but is not limited to, periodically read the identifier from the first identifier storage space according to the target cycle to obtain a reference identifier, and store the read reference identifier in the second identifier storage space. In this way, the first controller in the target storage system can directly read the identifier from the second identifier storage space without waiting for the BMC to read the identifier in the first identifier storage space and waiting for the BMC to store the read identifier in the second identifier storage space, thereby improving the efficiency of reading the identifier from the second identifier storage space.

[0061] Figure 3 is a schematic diagram of an optional method of reading an identifier from a second identifier storage space according to an embodiment of the present application, such as Figure 3 As shown, it can be explained and illustrated by taking, but not limited to, a storage system including storage system 1 and storage system 2, storage system 2 including storage device 1, storage device 2, storage device 3 and a first controller, and an extended storage device including a hard disk frame as an example, the hard disk frame includes a data storage space, a first identification storage space, a second identification storage space and a second controller, storage device 1, storage device 2 and storage device 3 are connected to the data storage space, the first controller is connected to the second identification storage space and the second controller, the second controller is connected to the first identification storage space and the second identification storage space, the first identification storage space stores the identification of the storage system 2 that is currently allowed to access the data storage space, the identification of the storage system 2 can include, but is not limited to, SN20345MA000000, wherein 000000 is data obtained after masking the identification parameters, and the second identification storage space is used to store the identification SN20345MA000000 read by the second controller from the first identification storage space. The first controller reads the identification from the second identification storage space to obtain SN20345MA000000, and determines the current usage status of the data storage space according to its own identification and the read SN20345MA000000.

[0062] In the technical solution provided in the above step S206, when the target usage status is used to indicate that the target storage device is not allowed to access the data storage space, it can indicate that a storage system is currently accessing the data storage space. In such a case, it is possible but not limited to refusing to write the target identifier to the second identifier storage space, or writing the target identifier to the second identifier storage space and continuing to detect the target usage status. When the target usage status is used to indicate that the target storage device is allowed to access the data storage space, the second controller is controlled to store the target identifier stored in the second identifier storage space in the first identifier storage space.

[0063] Optionally, in this embodiment, when the target identifier is stored in the first identifier storage space, all storage devices of the target storage system are configured to allow access to the data storage space.

[0064] In an exemplary embodiment, the current target usage status of the data storage space can be detected based on the reference identifier and the target identifier of the target storage system in the following manner, but is not limited to: comparing the first storage device identifier in the reference identifier with the second storage device identifier in the target identifier to obtain a comparison result, wherein the first storage device identifier is the identifier of the first storage device in the reference storage system and the second storage device identifier is the identifier of the first storage device in the target storage system; and detecting the target usage status based on the comparison result.

[0065] Optionally, in this embodiment, the first storage device in the target storage system may be, but is not limited to, the first storage device added to the target storage system when the target storage system is created.

[0066] Optionally, in this embodiment, the reference identifier and the target identifier may include, but is not limited to, identifiers after masking identifier parameters, and may include, but is not limited to, comparing the first storage device identifier in the reference identifier with the second storage device identifier in the target identifier.

[0067] In an exemplary embodiment, the target usage status can be detected based on the comparison result in the following manner, but is not limited to: when the comparison result is used to indicate that the first storage device identifier is empty, or when the first storage device identifier is the same as the second storage device identifier, determining that the target usage status is used to indicate that the target storage device is allowed to access the data storage space; when the comparison result is used to indicate that the first storage device identifier is not empty and the first storage device identifier is different from the second storage device identifier, determining that the target usage status is used to indicate that the target storage device is not allowed to access the data storage space.

[0068] Optionally, in this embodiment, when the comparison result is used to indicate that the first storage device identifier is empty, it can indicate that no storage system is currently allowed to access the data storage space. In this case, determining the target usage status is used to indicate that the target storage device is allowed to access the data storage space.

[0069] Optionally, in this embodiment, when the comparison result is used to indicate that the first storage device identifier is not empty and the first storage device identifier is different from the second storage device identifier, it can indicate that the current expanded storage device is being used by other storage systems. In such a case, the target usage status can be determined, but is not limited to, to indicate that the target storage device is not allowed to access the data storage space.

[0070] For example, if the current storage system queries the storage system identification data stored on the hard disk frame backplane and it is empty, the hard disk frame to which the current hard disk belongs is not managed by other storage systems. The hard disk can be used directly to regard the hard disk frame to which it belongs as being managed, and the storage system identification of the current storage system can be written to the hard disk frame backplane by relying on the automatic writing mechanism of the storage system identification mentioned above; if the current storage system queries the storage system identification data stored on the hard disk frame backplane and it is consistent with the current storage system, the hard disk frame to which the current hard disk belongs is already managed by the current storage system and can be used directly; if the current storage system queries the storage system identification data stored on the hard disk frame backplane and it is not empty and inconsistent with the current identification, the hard disk frame to which the current hard disk belongs is already managed by other storage systems and this hard disk cannot be used. Through the above logic, a hard disk frame and hard disk cannot be managed by different storage systems at the same time, avoiding the serious risk of multiple storage systems managing the same hard disk frame hard disk when the connection method is through a switch, resulting in the loss of business data.

[0071] In this way, only one storage system is allowed to access the data storage space at the same time, avoiding data confusion caused by multiple storage systems being allowed to access the data storage space at the same time and modification of the same data by different storage systems, thereby improving the accuracy of the data stored in the data storage space.

[0072] In the technical solution provided in the above step S208, after controlling the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space, the method further includes: storing a corresponding target identifier and an extended storage device and a managed status in the first controller, wherein the managed status is used to indicate that the target storage system allows access to the data storage space in the extended storage device.

[0073] Optionally, in this embodiment, after controlling the second controller to store the target identifier stored in the second identifier storage space in the first identifier storage space, the method also includes: detecting a target storage status of the target identifier stored in the first identifier storage space, wherein the target storage status is used to indicate whether the target identifier is stored in the first identifier storage space, and when the target storage status is used to indicate that the target identifier is not stored in the first identifier storage space, determining that the expansion storage device has been replaced, writing the target identifier into the second identifier storage space, and controlling the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space.

[0074] For example, during normal use of the hard disk of the hard disk frame, the backplane of the hard disk frame needs to be replaced due to damage to the backplane of the hard disk frame. The newly replaced backplane does not record the storage system ID. By detecting that the current storage system has managed the hard disk frame but the storage system ID stored in the managed hard disk frame backplane is empty, it is confirmed that the hard disk frame backplane has been replaced. At this time, the current storage system ID is written to the hard disk frame backplane to avoid the storage system ID stored in the backplane being empty due to replacement of the hard disk frame backplane. It is impossible to prevent the risk of data loss caused by the hard disk frame being managed by other storage systems in the future when the current storage system is already managing the hard disk frame.

[0075] Through the embodiments of the present application, when the target storage system has recorded that the expansion storage device is managed by the storage system, if the controller in the storage system detects that the target storage system's target identifier is not stored in the first identifier storage space of the expansion storage device, in this case, it can be indicated that the expansion storage device has failed and the expansion storage device has been replaced. In this case, the target identifier of the target storage system can be written into the first identifier storage space again, but is not limited to.

[0076] In this way, when the extended storage device fails or is under repair, there is no need to re-determine the storage system of the extended storage device that is currently allowed to be accessed. Instead, the target identifier of the target storage system is directly written into the corresponding identifier storage space. The original business of the target storage system can still be executed normally, thereby improving the stability of executing the original business on the target storage system.

[0077] Optionally, in this embodiment, when the target storage system finishes using the data storage space, it may be possible but not limited to controlling the second controller to write a null value into the first identification storage space to achieve the unmanagement of the data storage space by the target storage system.

[0078] Through the embodiments of the present application, the storage system identification data and current identification data stored in the memory of the hard disk frame backplane are used as the basis for managing the hard disk frame, and the managed conditions of the hard disk frame are restricted, thereby avoiding the risk of data loss caused by different storage systems managing the same hard disk frame hard disk when the hard disk frame is connected through a switch.

[0079] In an exemplary embodiment, the second controller may be controlled to store the target identifier stored in the second identifier storage space into the first identifier storage space in the following manner, but is not limited to: generating a target storage request, wherein the target storage request is used to request that the target identifier stored in the second identifier storage space be stored into the first identifier storage space; sending the target storage request to the second controller, wherein the second controller is used to execute the target storage request; the second controller includes a target interface, and the target interface is connected to the first identifier storage space. After sending the target storage request to the second controller, the method further includes: extracting an identifier from the second identifier storage space in response to the received target storage request to obtain the target identifier;

[0080] Optionally, in this embodiment, the target identifier may be written into the second identifier storage space in the following manner but is not limited to: the target identifier is written into the second identifier storage space via a target transmission protocol, for example, the target transmission protocol includes an NVME protocol and the like.

[0081] Optionally, in this embodiment, the second controller may also, but is not limited to, periodically read the identifier from the second identifier storage space to obtain the target identifier, and store the target identifier in the first identifier storage space.

[0082] Figure 4 is a schematic diagram of an optional method of writing a target identifier into a first identifier storage space according to an embodiment of the present application, such as Figure 4 As shown, taking the storage system including storage system 1 and storage system 2, storage system 1 including storage device 1, storage device 2, storage device 3 and a first controller, and the expanded storage device including a hard disk frame as an example, the hard disk frame includes data storage space, a first identification storage space, a second identification storage space and a second controller, storage device 1, storage device 2 and storage device 3 are connected to the data storage space, the first controller is connected to the second identification storage space and the second controller, and the second controller is connected to the first identification storage space and the second identification storage space.

[0083] When it is determined that storage system 1 allows access to the data storage space, the first controller may, but is not limited to, write the identification of storage system 1 into the second identification storage space. For example, the identification of storage system 1 is SN49267HB000000, where 000000 is the data obtained by masking the identification parameters in the target identification. The second controller may, but is not limited to, read the second identification from the second identification storage space to obtain SN49267HB000000, and store the read SN49267HB000000 in the first identification storage space.

[0084] In order to better understand the control method of the storage device in the embodiment of the present application, it can be explained and illustrated by taking, but not limited to, the expanded storage device including a hard disk frame, the second controller including a BMC, the first identification storage space including the memory in the hard disk frame, and the second identification storage space including the memory on the backplane as an example, and the control method of the storage device in the embodiment of the present application is explained and illustrated, which can be but not limited to being applicable to the embodiment of the present application.

[0085] The embodiment of the present application supports the management of the hard disk frame by the storage system in the switch connection mode, by setting two management states of the storage system for the hard disk frame, setting two management states of the storage system for the hard disk, setting different hard disk frame backplanes to store the storage system identification data, and obtaining the storage system identification data stored on the hard disk frame backplane and comparing it with the current storage system identification to determine whether the hard disk frame can be managed and setting the storage system identification data stored on the hard disk frame backplane to achieve the management or cancellation of the hard disk frame. It mainly includes the following contents:

[0086] 1) Hardware support is required: to meet the design requirements of switches, network cards, motherboards, and backplane connections;

[0087] 2) BMC needs to provide the corresponding IMPI interface and support the code of standard ipmitool commands;

[0088] 3) It is necessary to design two management states of the storage system for the disk enclosure;

[0089] 4) It is necessary to design two management states of the storage system for hard disks;

[0090] 5) It is necessary to design a hard disk enclosure backplane to store the storage system identification data;

[0091] 6) Query and set the storage system identification data stored on the hard disk enclosure backplane according to user needs.

[0092] Figure 5 is a schematic diagram of a control method for a storage device according to an embodiment of the present application, such as Figure 5 As shown, the following steps may be included but are not limited to:

[0093] Step S501, querying data stored on the backplane of the hard disk enclosure.

[0094] The present application is that the storage system MCS obtains the unique identification data stored in the memory on the hard disk frame from the hard disk frame through the NVME-MI protocol, and the identification data is the unique identification data read by the BMC from the memory on the backplane of the hard disk frame through the IPMI protocol, or the storage system MCS notifies the hard disk frame of the current unique identification data (equivalent to the target identification) through the NVME-MI protocol, and writes the identification data into the memory on the backplane of the hard disk frame through the BMC using IPMI, and uses the storage system identification data and current identification data stored in the backplane of the hard disk frame obtained as the basis for managing the hard disk frame and the hard disk, restricts the managed conditions of the hard disk frame and the hard disk, and realizes the need to avoid the risk of data loss caused by different storage systems managing the same hard disk frame in the scenario where the hard disk frame is connected through a switch.

[0095] A cluster may be, but is not limited to, equivalent to a storage system. A storage system identifier may be, but is not limited to, obtained by masking the cluster identifier. The cluster identifier may be, but is not limited to, include a unique confirmation field for each storage device (equivalent to the identifier of the storage device) and a field generated when the cluster is established (equivalent to the identifier parameter). Therefore, cluster identifiers of different clusters established successively by the same storage device will also be different. By masking the field generated when the cluster is established, the above method uses the storage system identifier to determine whether the disk enclosure and the hard disk have been managed by other storage systems, which can ensure that different storage system identifiers are effectively distinguished, and at the same time ensure that if the cluster is destroyed for some reason under a normal environment, the newly created cluster based on the original storage device can manage and use the disk enclosure and the hard disk normally.

[0096] In order to implement the method for the storage system to manage the hard disk frame and the hard disk, hardware support is required: the connection of the design switch, network card, mainboard, and backplane is met, the BMC provides the corresponding IMPI interface (equivalent to the target interface), and supports the code of the standard ipmitool instruction. According to user needs, the storage system management hard disk frame method can include but is not limited to obtaining the masked identification data stored on the backplane of the hard disk frame and comparing it with the current masked identification data to determine whether the hard disk frame and the hard disk can be managed, and setting the identification data stored in the memory on the backplane of the hard disk frame, and modifying the managed state of the hard disk frame in the storage system MCS to realize the management or cancellation of the hard disk frame.

[0097] Step S502, determine whether the query result is empty. If it is determined that the query result is empty, execute steps S503 to S504. If it is determined that the query result is not empty, execute step S505.

[0098] Step S503: store the current storage system identifier on the disk enclosure backplane.

[0099] Step S504: modify the managed state of the disk enclosure to managed.

[0100] Step S505, determining whether the query result is consistent with the current storage system. If the query result is inconsistent with the current storage system, executing step S506; if the query result is consistent with the current storage system, executing step S503.

[0101] Step S506 , confirm whether it is necessary to forcibly manage the hard disk enclosure. If it is determined that it is not necessary to forcibly manage the hard disk enclosure, the process ends.

[0102] For example, it is possible but not limited to comparing the storage system identification data stored on the backplane of the hard disk frame with the current identification to determine whether the hard disk frame can be managed for the current storage system. The storage system MCS can query the storage system identification data (equivalent to the reference identification) stored on the backplane of the connected hard disk frame. The comparison result of the storage system identification data stored on the backplane of the hard disk frame and the current identification can be divided into three cases: the first case: the storage system identification data stored on the backplane of the hard disk frame is empty; the second case: the storage system identification data stored on the backplane of the hard disk frame is not empty and is consistent with the current identification (equivalent to the target identification); the third case: the storage system identification data stored on the backplane of the hard disk frame is not empty and is inconsistent with the current identification.

[0103] Based on the comparison scenario of the storage system ID stored on the backplane of the disk enclosure and the current ID, three scenarios can be obtained and the corresponding scenario analysis and coping methods are as follows.

[0104] The storage system identification data stored on the backplane of the disk enclosure is empty. In this scenario, the storage system identification will be written to the backplane of the disk enclosure when the disk enclosure is managed. The storage system identification data stored on the backplane of the disk enclosure will be cleared only when the disk enclosure is unmanaged. In this scenario, the disk enclosure is not managed by any storage system and the current storage system can manage the disk enclosure. The storage system identification data stored on the backplane of the disk enclosure queried by the current storage system is consistent with the current identification. In this scenario, the disk enclosure is managed by the current storage system, or the current disk enclosure has been managed by the current storage system and the data stored on the backplane of the disk enclosure has not been cleared by unmanaging, or the current storage system can manage the disk enclosure. The storage system identification data stored on the backplane of the disk enclosure queried by the current storage system is not empty and is inconsistent with the current identification. In this scenario, the backplane of the disk enclosure stores the identification of other storage systems. It is judged that the disk enclosure is currently managed by other storage systems and the current storage system cannot manage the disk enclosure to prevent multiple storage systems from managing the same disk enclosure, which may cause serious data loss risks in business execution.

[0105] The storage system identification data stored on the backplane of the hard disk frame can be set to achieve management or cancellation of the hard disk frame in the following ways, but is not limited to: if the storage system identification data stored on the backplane of the hard disk frame is queried to determine that the hard disk frame can be managed, the current storage system identification is written into the memory on the backplane of the hard disk frame and the hard disk frame management mark is modified to managed; if the hard disk frame needs to be canceled from management, a null value is written into the backplane of the hard disk frame and the hard disk frame management mark is modified to unmanaged.

[0106] It should be noted that there may be a scenario where a hard disk frame is managed but is not unmanaged by the management storage system. Instead, it is directly disconnected from the management storage system and connected to another storage system to perform management operations. In this scenario, the storage system identification data stored on the backplane of the hard disk frame is consistent with the identification of the storage system that managed the hard disk frame last time. The storage system to which the hard disk frame is connected for the second time queries and confirms that the storage system identification data stored on the backplane of the hard disk frame is not empty and is inconsistent with the current storage system identification. It is determined that the hard disk frame is managed by another storage system and the hard disk frame is not allowed to be managed again. In this scenario, the current storage system identification can be written to the backplane of the hard disk frame and the hard disk frame management mark can be modified to managed by force management of the hard disk frame.

[0107] Based on the demand for flexible business use, there is a related technology that when a hard disk is used, the hard disk frame in which it is located is regarded as being managed by the current storage system, which leads to a scenario in which the hard disk frame is managed by multiple storage systems when multiple storage systems are connected to one hard disk frame. In the related technology, the hard disk is directly used and the hard disk frame in which it is located is regarded as being managed by the current storage system, which leads to a scenario in which the hard disk frame is managed by multiple storage systems. However, through the embodiment of the present application, it is possible to determine whether the current hard disk can be used directly by verifying whether the current storage system identifier and the storage system identifier stored on the backplane of the hard disk frame to which the hard disk to be used is specified are consistent. The comparison results of the storage system identifier of the current storage system and the storage system identifier stored on the backplane of the hard disk frame to which the hard disk to be used is specified have three situations as described above.

[0108] The embodiment of the present application supports the management of the hard disk frame by the storage system under the switch connection mode. By setting two management states of the storage system for the hard disk frame (which may include but is not limited to managed and unmanaged), setting two management states of the storage system for the hard disk, setting different hard disk frame backplanes to store the storage system identification data, and determining whether the hard disk frame can be managed by comparing the storage system identification data (equivalent to the reference identification) and the current storage system identification data (equivalent to the target identification) stored on the hard disk frame backplane, and setting the storage system identification data stored on the hard disk frame backplane to achieve the management or cancellation of the hard disk frame. By standardizing the management conditions of the hard disk frame and the hard disk and the management implementation method, the serious risk of loss of business data caused by multiple storage systems managing the same hard disk frame hard disk when the connection mode is through a switch is avoided, the protection of data information is achieved, and the security and reliability of the storage information are ensured.

[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0110] In the present embodiment, a control device for a storage device is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated here. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0111] Figure 6 is a structural block diagram of a control device for a storage device according to an embodiment of the present application, such as Figure 6As shown, the target storage system includes multiple storage devices and a first controller, the first controller is connected to the multiple storage devices, the extended storage device includes a data storage space, a first identification storage space, a second identification storage space and a second controller, the multiple storage devices are connected to the data storage space, the first controller is connected to the second identification storage space and the second controller, the second controller is connected to the first identification storage space and the second identification storage space, the first identification storage space is used to store the identification of the reference storage system currently allowed to access the data storage space, the second identification storage space is used to store the identification read by the second controller from the first identification storage space, the device is applied to the first controller, and the device includes:

[0112] A receiving module 602 is used to receive an access request initiated by a target storage device among the multiple storage devices, wherein the access request is used to request access to the data storage space;

[0113] A reading module 604, configured to respond to the access request and read an identifier from the second identifier storage space to obtain a reference identifier;

[0114] A detection module 606, configured to detect a current target usage state of the data storage space according to the reference identifier and the target identifier of the target storage system, wherein the target usage state is used to indicate whether the target storage device is allowed to access the data storage space;

[0115] The first processing module 608 is used to write the target identifier into the second identifier storage space when the target usage status indicates that the target storage device is allowed to access the data storage space, and control the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space.

[0116] Through the above-mentioned device, the extended storage device includes a data storage space, an identification storage space and a controller. The identification storage space stores the identification of the storage system currently allowed to access the data storage space. When other storage systems want to access the data storage space, the controller in the storage system can read the identification of the storage system currently allowed to access the data storage space from the identification storage space, and determine whether to allow the storage system to access the data storage space based on its own identification and the read identification. When it is determined that the storage system is allowed to access the data storage space, the identification of the storage system is written into the identification storage space by the controller in the extended storage device, so as to realize the use and management of the extended storage device by the storage system. In this way, it is achieved that only one storage system is allowed to access the data storage space in the extended storage device at the same time. Therefore, the problem of low control efficiency of the storage device can be solved, thereby achieving the effect of improving the control efficiency of the storage device.

[0117] In an exemplary embodiment, the detection module includes:

[0118] a comparison unit, configured to compare a first storage device identifier in the reference identifier with a second storage device identifier in the target identifier to obtain a comparison result, wherein the first storage device identifier is an identifier of a first storage device in the reference storage system, and the second storage device identifier is an identifier of a first storage device in the target storage system;

[0119] A detection unit is used to detect the target usage status according to the comparison result.

[0120] In an exemplary embodiment, the detection unit is used to:

[0121] In a case where the comparison result indicates that the first storage device identifier is empty, or in a case where the first storage device identifier is the same as the second storage device identifier, determining that the target usage state is used to indicate that the target storage device is allowed to access the data storage space;

[0122] When the comparison result indicates that the first storage device identifier is not empty and the first storage device identifier is different from the second storage device identifier, determining the target usage status indicates that the target storage device is not allowed to access the data storage space.

[0123] In an exemplary embodiment, the apparatus further comprises:

[0124] A first extraction module, configured to extract the second storage device identifier of the first storage device in the target storage system before reading the identifier from the second identifier storage space to obtain the reference identifier, and to extract the target number of storage systems to which the first storage device added to the target storage system when establishing the target storage system has been added;

[0125] An acquisition module, used for acquiring a target identification parameter corresponding to the target quantity from identification parameters and quantities having a corresponding relationship;

[0126] A determination module is used to determine the target identifier according to the second storage device identifier and the target identifier parameter.

[0127] In an exemplary embodiment, the determining module includes:

[0128] a concatenation unit, configured to concatenate the second storage device identifier and the target identifier parameter to obtain a candidate identifier;

[0129] The mask unit is used to perform a mask operation on the target identifier parameters in the candidate identifiers to obtain the target identifier.

[0130] In an exemplary embodiment, the apparatus further comprises:

[0131] a second processing module, configured to, before reading the identifier from the second identifier storage space to obtain the reference identifier, upon receiving the access request, read the identifier from the first identifier storage space to obtain the reference identifier, and store the reference identifier in the second identifier storage space; or

[0132] The third processing module is used to read the identifier from the first identifier storage space according to the target period, obtain the reference identifier, and store the reference identifier in the second identifier storage space.

[0133] In one exemplary embodiment,

[0134] The first processing module comprises:

[0135] a generating unit, configured to generate a target storage request, wherein the target storage request is used to request that the target identifier stored in the second identifier storage space be stored in the first identifier storage space;

[0136] a sending unit, configured to send the target storage request to the second controller, wherein the second controller is configured to execute the target storage request;

[0137] The second controller includes a target interface, the target interface is connected to the first identification storage space, and the device further includes:

[0138] a second extraction module, configured to extract an identifier from the second identifier storage space in response to the received target storage request after the target storage request is sent to the second controller, so as to obtain the target identifier;

[0139] A writing module is used to write the target identifier into the first identifier storage space through the target interface.

[0140] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0141] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0142] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0143] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0144] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0145] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.

[0146] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0147] An embodiment of the present application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.

[0148] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0149] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0150] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for controlling a storage device, characterized in that: The target storage system includes a plurality of storage devices and a first controller, the first controller is connected to the plurality of storage devices, the extended storage device includes a data storage space, a first identification storage space, a second identification storage space and a second controller, the plurality of storage devices are connected to the data storage space, the first controller is connected to the second identification storage space and the second controller, the second controller is connected to the first identification storage space and the second identification storage space, the first identification storage space is used to store an identification of a reference storage system currently allowed to access the data storage space, the second identification storage space is used to store an identification read by the second controller from the first identification storage space, the method is applied to the first controller, the method includes: receiving an access request initiated by a target storage device among the plurality of storage devices, wherein the access request is used to request access to the data storage space; In response to the access request, read the identifier from the second identifier storage space to obtain a reference identifier; Based on the reference identifier and the target identifier of the target storage system, the current target usage status of the data storage space is detected, wherein the target usage status is used to indicate whether the target storage device is allowed to access the data storage space; when the target usage status is used to indicate that the target storage device is allowed to access the data storage space, the target identifier is written into the second identifier storage space, and the second controller is controlled to store the target identifier stored in the second identifier storage space into the first identifier storage space.

2. The method according to claim 1, characterized in that The detecting the current target usage state of the data storage space according to the reference identifier and the target identifier of the target storage system comprises: Comparing the first storage device identifier in the reference identifier with the second storage device identifier in the target identifier to obtain a comparison result, wherein the first storage device identifier is the identifier of the first storage device in the reference storage system, and the second storage device identifier is the identifier of the first storage device in the target storage system; The target usage status is detected according to the comparison result.

3. The method according to claim 2, characterized in that The detecting the target usage status according to the comparison result includes: In a case where the comparison result indicates that the first storage device identifier is empty, or in a case where the first storage device identifier is the same as the second storage device identifier, determining that the target usage state is used to indicate that the target storage device is allowed to access the data storage space; When the comparison result indicates that the first storage device identifier is not empty and the first storage device identifier is different from the second storage device identifier, determining the target usage status is used to indicate that the target storage device is not allowed to access the data storage space.

4. The method according to claim 1, characterized in that: Before reading the identifier from the second identifier storage space to obtain the reference identifier, the method further includes: Extracting the second storage device identifier of the first storage device in the target storage system, and extracting the target number of storage systems to which the first storage device added to the target storage system when establishing the target storage system has added; From the identification parameters and quantities having a corresponding relationship, obtaining the target identification parameter corresponding to the target quantity; The target identifier is determined according to the second storage device identifier and the target identifier parameter.

5. The method according to claim 4, characterized in that The determining the target identifier according to the second storage device identifier and the target identifier parameter includes: Performing a concatenation operation on the second storage device identifier and the target identifier parameter to obtain a candidate identifier; A mask operation is performed on the target identifier parameter in the candidate identifier to obtain the target identifier.

6. The method according to claim 1, characterized in that Before reading the identifier from the second identifier storage space to obtain the reference identifier, the method further includes: Upon receiving the access request, reading the identifier from the first identifier storage space to obtain the reference identifier, and storing the reference identifier in the second identifier storage space; or, According to the target cycle, the identifier is read from the first identifier storage space to obtain the reference identifier, and the reference identifier is stored in the second identifier storage space.

7. The method according to claim 1, characterized in that The controlling the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space includes: Generate a target storage request, wherein the target storage request is used to request to store the target identifier stored in the second identifier storage space into the first identifier storage space; sending the target storage request to the second controller, wherein the second controller is used to execute the target storage request; The second controller includes a target interface, the target interface is connected to the first identification storage space, and after sending the target storage request to the second controller, the method further includes: In response to the received target storage request, extracting an identifier from the second identifier storage space to obtain the target identifier; The target identifier is written into the first identifier storage space through the target interface.

8. A control device for a storage device, characterized in that: The target storage system includes a plurality of storage devices and a first controller, the first controller is connected to the plurality of storage devices, the extended storage device includes a data storage space, a first identification storage space, a second identification storage space, and a second controller, the plurality of storage devices are connected to the data storage space, the first controller is connected to the second identification storage space and the second controller, the second controller is connected to the first identification storage space and the second identification storage space, the first identification storage space is used to store an identification of a reference storage system currently allowed to access the data storage space, the second identification storage space is used to store an identification read by the second controller from the first identification storage space, the device is applied to the first controller, and the device includes: A receiving module, configured to receive an access request initiated by a target storage device among the multiple storage devices, wherein the access request is used to request access to the data storage space; a reading module, configured to respond to the access request, read an identifier from the second identifier storage space, and obtain a reference identifier; a detection module, configured to detect a current target usage state of the data storage space according to the reference identifier and a target identifier of the target storage system, wherein the target usage state is used to indicate whether the target storage device is allowed to access the data storage space; A first processing module is configured to write the target identifier into the second identifier storage space when the target usage status indicates that the target storage device is allowed to access the data storage space, and to control the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Storage device access method and apparatus, and computer program product

    CN118760398A

  • Refreshing method and device for server firmware, storage medium and electronic equipment

    CN118860455A

  • Rebalancing storage I / O workloads by storage controller selection and redirection

    US20200028894A1

  • Method for determining blood relationship of data, electronic device and storage medium

    US20220129418A1