Storage device control method and device, storage medium and electronic device
By introducing controller management of data storage space and identification storage space in the storage device, it is ensured that only one storage system accesses the data storage space, which solves the risk of data loss caused by simultaneous access by multiple storage systems and improves the control efficiency and data accuracy of the storage device.
Patent Information
- Application Number
- CN202411755745.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-11-30
Smart Images

Figure CN119690343B_ABST
Abstract
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] Storage devices significantly increase the storage capacity of a storage system by connecting to expansion storage devices, such as hard disk enclosures. In related technologies, storage devices and hard disk enclosures can be connected via switches, enabling normal RoCE connections and IO (Input / Output) read and write operations. After passing through the switch, plug-and-play functionality is normal. When connected via a switch, different storage systems may be connected to the same hard disk enclosure. Because different storage systems are unaware of whether they are connected to and managing the same hard disk enclosure, there is a serious risk of data loss when different storage systems use the hard disks in the same hard disk enclosure to perform services.
[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] 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 one 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 a 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 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.
[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 the target identification parameter corresponding to the target number from the identification parameters and quantities having a corresponding relationship; and determining the target identifier based on the second storage device identifier and the target identification 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 splicing operation on the second storage device identifier and the target identifier parameter to obtain a candidate identifier; and performing a masking 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, 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 further 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 into 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 the 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 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; a first processing module, used to write the target identifier into the second identifier storage space when the target usage status is used to indicate 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. The computer program is configured to execute the steps of any one 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, which implements the steps of any of the above method embodiments when executed by a processor.
[0016] Through the present application, the expanded storage device includes data storage space, 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 expanded storage device, thereby realizing the use and management of the expanded 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 expanded 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 This is a hardware structure block diagram of a server device for 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 method for controlling a storage device according to an embodiment of the present application;
[0022] Figure 6 This is a structural block diagram of a control device for 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 description 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 this 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 converged Ethernet.
[0029] IO: Input Output, input and output.
[0030] MCS: Multiple Controller System, multiple 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 This is a hardware structure block diagram of a server device for 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) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 for communication functions and an input and output device 108. It will 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 than shown, or with Figure 1 Different configurations 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, implementing the above-mentioned 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 instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to a 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. A specific example of the aforementioned network may include a wireless network provided by a communication provider of the server device. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may 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 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, and 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 plurality of storage devices, wherein the access request is used to request access to the data storage space;
[0038] Step S204, responding to the access request, reading the identifier from the second identifier storage space to obtain a reference identifier;
[0039] Step S206: detecting a 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;
[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, 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.
[0041] Through the above steps, the expanded storage device includes data storage space, 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 expanded storage device, thereby realizing the use and management of the expanded 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 expanded 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 disks, USB hard disks, and SATA hard disks.
[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 or write data in the data storage space. It is understood that the access request may cause changes to the data in the data storage space, such as the addition of new data, the reduction of data, or the modification of data.
[0045] Optionally, in this embodiment, the expansion storage device may be, but is not limited to, 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 the memory in the hard disk frame, and the second identification storage space may be, but is not limited to, including the 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 is not limited to, different from the target identifier, or the reference identifier may be, but is 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 methods can be used, but are not limited to: 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 the target identification parameter corresponding to the target number from the identification parameters and quantities having a corresponding relationship; and determining the target identifier based on the second storage device identifier and the target identification parameter.
[0048] Optionally, in this embodiment, the target number can be, but is not limited to, 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 code number of the storage device.
[0050] Optionally, in this embodiment, the target identification parameter can also be, but is not limited to, 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 corresponding relationships; 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 the 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 splicing operation on the second storage device identifier and the target identifier parameter to obtain a candidate identifier; 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 corresponding relationships; 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 mask operation on the reference identifier parameters in the initial identifier to obtain the reference identifier.
[0055] Optionally, in this embodiment, the result of the splicing may include, but is not limited to, the second storage device identifier-target identifier parameter, or the target identifier parameter-second storage device identifier, etc.
[0056] Optionally, in this embodiment, the mask operation may be, but is not limited to, setting the target identification parameter in the candidate identification to a preset identification parameter, which 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 methods may be used, but are 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 of 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 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, 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 the 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 identifier from the second identifier storage space to obtain SN20345MA000000, and determines the current usage status of the data storage space according to its own identifier 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 may indicate that a storage system is currently accessing the data storage space. In such a case, it may be 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 in 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 the identifier parameters, and may compare, but is not limited to, 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 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 indicates that the first storage device identifier is empty, it may indicate that no storage system currently allows access to 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 may indicate that the current expanded storage device is being used by other storage systems. In such a case, the target usage status may 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 treat 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 write mechanism of the storage system identification. 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 is 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 when the connection is through a switch, resulting in 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 the target identifier and the expanded storage device and the managed status having a corresponding relationship 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 expanded storage device.
[0073] Optionally, in this embodiment, 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: 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; 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 the normal use of the hard disk frame hard disk, 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 operation of replacing the hard disk frame backplane has occurred. 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 the 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] According to the embodiment 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 identification of the target storage system is not stored in the first identification 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 identification of the target storage system can be written into the first identification storage space again, but is not limited to being written again.
[0076] In this way, when the expanded storage device fails or is under maintenance, there is no need to re-determine the storage system of the expanded 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, which improves the stability of executing the original business on the target storage system.
[0077] Optionally, in this embodiment, when the target storage system has finished using the data storage space, it can, but is not limited to, control the second controller to write a null value into the first identification storage space to achieve the target storage system's cancellation of the management of the data storage space.
[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 method may include, but is not limited to, controlling the second controller to store the target identifier stored in the second identifier storage space into the first identifier storage space in the following manner: 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, wherein 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: writing the target identifier into the second identifier storage space through a target transmission protocol, for example, the target transmission protocol includes an NVME protocol, etc.
[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 the 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] If it is determined that storage system 1 is allowed to access the data storage space, the first controller may, but is not limited to, write the identifier of storage system 1 into the second identifier storage space. For example, the identifier of storage system 1 is SN49267HB000000, where 000000 is the data obtained by masking the identifier parameters in the target identifier. The second controller may, but is not limited to, read the second identifier from the second identifier storage space to obtain SN49267HB000000, and store the read SN49267HB000000 in the first identifier 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 the hard disk frame, the second controller including the 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. 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, applicable to the embodiment of the present application.
[0085] The embodiment of the present application supports the management of the hard disk enclosure by the storage system in the switch connection mode, by setting two management states of the storage system for the hard disk enclosure, setting two management states of the storage system for the hard disk, setting different hard disk enclosure backplanes to store storage system identification data, and determining whether the hard disk enclosure can be managed by comparing the storage system identification data stored on the hard disk enclosure backplane with the current storage system identification and setting the storage system identification data stored on the hard disk enclosure backplane to achieve management or cancellation of the hard disk enclosure. It mainly includes the following contents:
[0086] 1) Hardware support is required: Design switches, network cards, motherboards, and backplane connections;
[0087] 2) The BMC needs to provide the corresponding IMPI interface and support the code of the standard ipmitool command;
[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) A disk enclosure backplane needs to be designed to store 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 method for controlling a storage device according to an embodiment of the present application, such as Figure 5 As shown, it may include but is not limited to the following steps:
[0093] Step S501: query the data stored on the backplane of the hard disk enclosure.
[0094] This 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. 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. Alternatively, 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 to the memory on the backplane of the hard disk frame through the BMC using IPMI. The storage system identification data and current identification data stored on the backplane of the hard disk frame obtained are used as the basis for managing the hard disk frame and the hard disk, and the managed conditions of the hard disk frame and the hard disk are restricted, so as 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 can be, but is not limited to, equivalent to a storage system. The storage system identifier can be, but is not limited to, obtained by masking the cluster identifier. The cluster identifier can be, but is not limited to, including a unique confirmation field for each storage device (equivalent to the storage device identifier) and a field generated when the cluster is established (equivalent to the identification parameter). Therefore, the cluster identifiers of different clusters established successively from 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 hard disk are already managed by another storage system. This ensures that different storage system identifiers can be effectively distinguished, and at the same time, if a cluster is destroyed for some reason under normal circumstances, a newly created cluster based on the original storage device can manage and use the disk enclosure and hard disk normally.
[0096] In order to implement the method of storage system management of hard disk enclosures and hard disks, hardware support is required: the connection of the designed switch, network card, motherboard, and backplane must be met, the BMC provides the corresponding IMPI interface (equivalent to the target interface), and supports the code of the standard ipmitool command. According to user requirements, the storage system management method of the hard disk enclosure can include, but is not limited to, obtaining the masked identification data stored on the hard disk enclosure backplane and comparing it with the current masked identification data to determine whether the hard disk enclosure and hard disk can be managed, setting the identification data stored in the memory on the hard disk enclosure backplane, and modifying the managed status of the hard disk enclosure in the storage system MCS to manage or cancel the hard disk enclosure.
[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: Change the managed status 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 the disk enclosure needs to be forcibly managed. If it is determined that the disk enclosure does not need to be forcibly managed, the process ends.
[0102] For example, it is possible, but not limited to, to determine whether the hard disk frame can be managed for the current storage system by comparing the storage system identification data stored on the backplane of the query hard disk frame with the current identification. 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 results 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] Comparing the storage system ID stored on the disk enclosure backplane with the current ID, three scenarios can be identified, along with corresponding scenario analysis and solutions.
[0104] If the storage system identification data stored on the disk enclosure backplane is empty, the storage system identification is written to the disk enclosure backplane when the disk enclosure is managed. The storage system identification data stored on the backplane is 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. If the storage system identification data stored on the disk enclosure backplane is consistent with the current identification, the disk enclosure is already managed by the current storage system, or the disk enclosure was previously managed by the current storage system and the data stored on the disk enclosure backplane was not cleared by unmanaging it, or the current storage system can manage the disk enclosure. If the storage system identification data stored on the disk enclosure backplane is not empty and is inconsistent with the current identification, the disk enclosure backplane stores the identification of another storage system and is currently managed by another storage system. The current storage system cannot manage the disk enclosure, preventing multiple storage systems from managing the same disk enclosure and causing serious data loss risks to business execution.
[0105] The storage system identification data stored on the backplane of the hard disk frame can be set in the following ways, but is not limited to, to achieve management or cancellation of the hard disk frame: if the hard disk frame is determined to be managed by querying the storage system identification data stored on the backplane of the hard disk frame, 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 cancelled, 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 scenarios where a hard disk enclosure 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 hard disk enclosure backplane is consistent with the identification of the storage system that last managed the hard disk enclosure. The storage system to which the hard disk enclosure is connected for the second time queries and confirms that the storage system identification data stored on the hard disk enclosure backplane is not empty and is inconsistent with the current storage system identification. It is determined that the hard disk enclosure is managed by another storage system and that the hard disk enclosure cannot be managed again. In this scenario, the current storage system identification can be written to the hard disk enclosure backplane and the hard disk enclosure management flag can be changed to managed by force management.
[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 having been 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. 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 belongs 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 belongs 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 realize 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 the necessary general hardware platform, and of course it can also be implemented 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 enabling 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 this embodiment, a control device for a storage device is also provided. The device is used to implement the above-mentioned embodiments and preferred embodiments. Details already described are omitted for clarity. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[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 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, and 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 configured to receive 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;
[0113] a reading module 604, configured to respond to the access request and read the 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 expanded storage device includes data storage space, 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 expanded storage device, thereby realizing the use and management of the expanded 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 expanded 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 comparing 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 configured to:
[0121] When the comparison result indicates 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 indicates 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 a 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, configured to acquire a target identification parameter corresponding to the target quantity from the identification parameters and quantities having a corresponding relationship;
[0126] A determination module is configured 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 masking unit is used to perform a masking 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 configured to read the identifier from the first identifier storage space according to a 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 includes:
[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 sending the target storage request to the second controller, to obtain the target identifier;
[0139] A writing module is configured 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 through 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. The computer program is configured to execute the steps of any of the above method embodiments when run.
[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, comprising 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.
[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, comprising 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 of 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 of any 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 here.
[0149] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices, they can be implemented using program code executable by the computing device, and thus, 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 performed in a different order than herein, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated 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 merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A method for controlling a storage device, characterized in that: 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 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, and 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, and 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; 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; When the target usage status indicates 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; Wherein, 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 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; detecting the target usage status based on the comparison result.
2. The method according to claim 1, characterized in that Detecting the target usage status according to the comparison result includes: When the comparison result indicates 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 indicates 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 indicates that the target storage device is not allowed to access the data storage space.
3. 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 already added; Obtaining a target identification parameter corresponding to the target quantity from the identification parameters and quantities having a corresponding relationship; The target identifier is determined according to the second storage device identifier and the target identifier parameter.
4. The method according to claim 3, 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.
5. The method according to claim 1, wherein 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.
6. The method according to claim 1, wherein The controlling the second controller to store the target identifier stored in the second identifier storage space into 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 configured to execute the target storage request; The second controller includes a target interface connected to the first identification storage space. 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.
7. A control device for a storage device, characterized in that: 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 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, and the second identification storage space is used to store the identification read by the second controller from the first identification storage space, the apparatus is applied to the first controller, and the apparatus includes: a receiving module, configured to receive 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; a reading module, configured to respond to the access request, read the 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 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; a first processing module, configured to, when the target usage status indicates 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; Among them, the detection module includes: a comparison unit, used to compare 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; a detection unit, used to detect the target usage status according to the comparison result.
8. 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 6 when executed by a processor.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Storage device access method and apparatus, and computer program product
CN118760398A
Method for determining blood relationship of data, electronic device and storage medium
US20220129418A1