WO2017024951A1 - Data storage method and system - Google Patents

Data storage method and system Download PDF

Info

Publication number
WO2017024951A1
WO2017024951A1 PCT/CN2016/092333 CN2016092333W WO2017024951A1 WO 2017024951 A1 WO2017024951 A1 WO 2017024951A1 CN 2016092333 W CN2016092333 W CN 2016092333W WO 2017024951 A1 WO2017024951 A1 WO 2017024951A1
Authority
WO
WIPO (PCT)
Prior art keywords
controller
cache device
data
cache
home
Prior art date
Application number
PCT/CN2016/092333
Other languages
French (fr)
Chinese (zh)
Inventor
贾晓林
许慧锋
陈昊
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2017024951A1 publication Critical patent/WO2017024951A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems

Definitions

  • the present invention relates to the field of storage, and in particular, to a data storage method and a storage system.
  • the storage system 120 includes a first controller 121, a second controller 122, and a storage device 123.
  • the first controller 121 is used for data communication with the host computer 110
  • the second controller 122 is also used for data communication with the host computer 110.
  • the first controller 121 and the second controller 122 pass PCIe/IB (nfiniband).
  • the first controller 121 is connected to the storage device 123, and the second controller is also connected to the storage device 123.
  • the speed of reading and writing data between the host computer 110 and the controller is much faster than reading and writing data between the host computer 110 and the storage device 123, when the data is frequently read and written, the host computer 110 does not directly store the data to the read.
  • the storage device 123 with slower writing speed data is sent to the controller with faster read/write speed until the data in the controller reaches a certain amount or the upper computer 110 determines that the data is to be stored in the storage device 123, and the control is performed.
  • the device sends the data in the controller to the storage device 123 for storage.
  • the host computer 110 first transmits data to any one of the first controller 121 and the second controller 122, and the controller that receives the data stores the received data in the cache of the controller, so that Interact with the host computer 110.
  • the controller that receives the data transfers the data to another controller's memory through a path such as PCIe/IB (nfiniband) for storage to obtain a mirror image for backup.
  • PCIe/IB finite-in-in/IB
  • the space of the mirrored data storage must be reserved in the memory of the controller to accommodate the mirrored data sent by other controllers, so the memory capacity of the controller is relatively large.
  • the bandwidth of the PCIe/IB (nfiniband) path is limited, when there is a large amount of mirrored data, it will put pressure on the normal data transmission of the PCIe/IB (nfiniband) path.
  • all data can only be stored by the remaining controllers, in order to To ensure the reliability of the data, the remaining controllers will not cache the data in the controller, but directly write to the storage device, which greatly reduces the speed of reading and writing.
  • the technical problem to be solved by the embodiments of the present invention is to provide a storage system and a data storage method, which achieve the requirement of reducing the memory capacity.
  • the present invention provides a data storage method, including: at least two controllers including at least a first controller and a second controller, a storage device, and a first cache device and a second cache device At least two cache devices, the first controller is configured to communicate with the upper computer, and the first controller is further connected to the storage device, the first cache device, and the second cache device, respectively The second controller is configured to communicate with the upper computer, the second controller is further connected to the storage device, the first cache device, and the second cache device, where the first controller is connected to the first a second controller, the first cache area and the second home area are disposed in the first cache device, and the first cache area and the second home area are disposed in the second cache device.
  • the attribute of the first home zone is that the first controller can perform a read operation and a write operation on the first home zone in the first cache device and the first home zone in the second cache device.
  • the second controller can perform a read operation on the first home zone in the first cache device and the first home zone in the second cache device, but cannot perform a write operation.
  • the attribute of the second home zone is: the second controller can perform a read operation and a write operation on the second home zone in the first cache device and the second home zone in the second cache device.
  • the first controller can perform a read operation on the second home area in the first cache device and the second home area in the second cache device, but cannot perform a write operation;
  • the first controller receives target data sent by the upper computer
  • the first controller forwards the target data to the second controller, and if yes, the first controller sends the target data to the first cache device or the The first home area in the second cache device is stored to obtain first image data;
  • the first controller When the data in the cache device needs to be stored in the storage device, the first controller includes the target data in the first home area of the first cache device and the second cache device The data processed by the first controller is stored in the storage device.
  • the method further includes:
  • the first controller and the second controller transfer data in the first cache device to the second cache device.
  • the method further includes:
  • the first controller sends the target data to the first cache device to obtain the first mirror data
  • the first controller further sends the target data to the second cache device Obtaining the second image data.
  • the second controller modifies the attributes of the first home zone in the first cache device and the first home zone in the second cache device when the device is faulty: the second controller pairs the The first home area in the first cache device and the first home area in the second cache device may perform a read operation and a write operation,
  • the second controller reads data in the first home area of the first cache device and the first home area in the second cache device, and stores the data in the storage device;
  • the second controller may send the data sent by the upper computer to the first home area in the first cache device and the first home area in the second cache device for storage. .
  • the fourth possible implementation manner of the first aspect of the present invention if the first control And the second controller fail, when the third controller replaces the first controller, and after the fourth controller replaces the second controller, the third controller is from the first cache device Reading the data stored by the first controller in the first home zone and/or the first home zone in the second cache device, the fourth controller from the second one of the first cache devices The home area and/or the second one of the second cache devices reads data stored by the second controller to recover data traffic.
  • the present invention provides a storage system, including: at least two controllers including at least a first controller and a second controller, a storage device, and a first cache device and a second cache device At least two cache devices, the first controller is configured to communicate with the upper computer, and the first controller is further connected to the storage device, the first cache device, and the second cache device, respectively, The second controller is configured to communicate with the upper computer, the second controller is further connected to the storage device, the first cache device, and the second cache device, and the first controller is connected to the second a first home area and a second home area are disposed in the first cache device, and the first cache area and the second home area are disposed in the second cache device.
  • the attribute of the first home zone is that the first controller can perform a read operation and a write operation on the first home zone in the first cache device and the first home zone in the second cache device.
  • the second controller can perform a read operation on the first home zone in the first cache device and the first home zone in the second cache device, but cannot perform a write operation.
  • the attribute of the second home zone is: the second controller can perform a read operation and a write operation on the second home zone in the first cache device and the second home zone in the second cache device.
  • the first controller can perform a read operation on the second home area in the first cache device and the second home area in the second cache device, but cannot perform a write operation;
  • the first controller is configured to receive target data sent by the upper computer
  • the first controller is configured to determine, according to the attribution information in the target data, whether the target data belongs to the first controller, and if the determination result is no, forwarding the target data to the second control And sending the target data to the first cache area of the first cache device or the second cache device for storage to obtain first mirror data;
  • the first controller is further configured to: when the data needs to be stored from the cache device to the storage device, include the target data in the first home area of the first cache device and the second cache device The data processed by the first controller is stored in the storage device.
  • the first controller and the second controller are configured to: when the first cache device fails, the first The data in the cache device is transferred to the second cache device.
  • the first controller is further configured to send, by the first controller, the target data to the first cache device Obtained And when the first image data is obtained, sending the target data to the second cache device to obtain the second image data.
  • the second controller modifies the attributes of the first home zone in the first cache device and the first home zone in the second cache device when the device is faulty: the second controller pairs the The first home area in the first cache device and the first home area in the second cache device may perform a read operation and a write operation,
  • the second controller is configured to read data in the first home area of the first cache device and the first home area in the second cache device, and store the data in the storage device;
  • the second controller is further configured to: after receiving the data sent by the upper computer, send the data sent by the upper computer to the first home zone in the first cache device and the first home in the second cache device The area is stored.
  • the fourth controller in the fourth possible implementation manner of the second aspect of the present invention, in the first control And the second controller fails.
  • the third controller replaces the first controller
  • the fourth controller replaces the second controller
  • the third controller is configured to read data stored by the first controller from a first home zone in the first cache device and/or a first home zone in the second cache device;
  • the fourth controller is configured to read data stored by the second controller from a second home zone in the first cache device and/or a second home zone in the second cache device to recover data business.
  • the cache device can be additionally set and the mirror data is stored in the cache device, so the controller does not need to provide storage space for the mirror data, thereby reducing the requirement on the controller memory size.
  • the data sent by the host computer reaches the controller, it is not necessary to send data to another controller through the PCIe/IB (nfiniband) path, thereby reducing the PCIe/IB (nfiniband) between the two controllers. The pressure of the data transmission of the path.
  • the other controller can write the data sent by the host computer to the cache device to ensure data reliability, and the controller does not need to directly write the data to the storage device, thereby Great Increased the speed of writing data.
  • the first controller cannot write the second home zone that can be written by the second controller
  • the second controller cannot write the first home zone that can be written by the first controller, that is, the first controller and the second controller
  • the storage space that the device can perform write operations is independent of each other, which can prevent conflicts caused by two different controllers simultaneously writing to the same storage unit.
  • FIG. 1 is a schematic structural diagram of an embodiment of a prior art storage system
  • FIG. 2 is a schematic structural diagram of a possible implementation manner of a storage system according to the present invention.
  • FIG. 3 is a schematic diagram of a first home zone and a second home zone in a cache device in the storage system of the present invention
  • FIG. 4 is a schematic structural diagram of an embodiment of a cache device in a storage system according to the present invention.
  • FIG. 5 is a schematic structural diagram of another embodiment of a cache device in a storage system according to the present invention.
  • FIG. 6 is a flow chart of an embodiment of a data storage method of the present invention.
  • FIG. 7 is a flow chart of another embodiment of a data storage method of the present invention.
  • FIG. 2 is a schematic structural diagram of a possible implementation manner of a storage system according to the present invention.
  • the storage system 220 of the embodiment includes: a first controller 221, a second controller 222, a storage device 223, a first cache device 224, and a second cache device 225.
  • the first cache device 224 and the second cache device 225 are both multi-port devices.
  • the first cache device 224 and the second cache device 225 each have a first port and a second port.
  • the first controller 221 is configured to be connected to the host computer 210.
  • the first controller 221 is further connected to the storage device 223, the first port of the first cache device 224, and the first port of the second cache device 225, respectively.
  • the PCIe/IB (nfiniband) is connected to the second controller 222, the second controller 222 is configured to be connected to the host computer 210, and the second controller 222 is connected to the storage device 223, the second port of the first cache device 224, and the second cache device 225.
  • the first controller 221 is connected between the first port of the first cache device 224 and the first port of the second cache device 225, the second controller 222 and the second port of the first cache device 224, and the second cache device.
  • the second port of 225 can be connected by PCIe/IB (nfiniband). In other embodiments, connections may be made through other buses, which are not specifically limited in the present invention.
  • the host computer 210 can selectively transmit target data to any one of the first controller 221 and the second controller 222. Since one data cannot be processed by both controllers at the same time, the attribution information of the target data is set in the target data, and the controller can determine whether the target data belongs to itself according to the attribution information. Assuming that the controller that receives the target data is the first controller 221, the first controller 221 determines whether the target data belongs to the first controller 221 based on the information of the controller that belongs to the target data. If the target data does not belong to the first controller 221, the first controller 221 forwards the target data to the second controller 222 via PCIe/IB (nfiniband), and then the second controller 222 controls the belonging according to the target data.
  • PCIe/IB finiteband
  • the information of the device determines whether the target data belongs to the second controller 222 for processing. If the target data belongs to the first controller 221, the first controller 221 sends the target data to one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data.
  • the second controller 222 When the host computer 210 selects to transmit the target data to the second controller 222, the second controller 222 also performs a similar operation.
  • the first controller 221 When the data in the cache device needs to be stored to the storage device 223, for example, when the data in the cache device reaches the threshold, or the host computer 210 instructs to store the data in the cache device to the storage device 223, the first controller 221 The data processed by the first controller 221 including the target data in the first cache device 224 and the second cache device 225 is stored in the storage device 223. Second The controller 222 also stores data processed by the second controller 222 in the first cache device 224 and the second cache device 225 into the storage device 223.
  • the first controller 221 and the second controller 222 may transfer the data in the first cache device 224 to the second cache device 225, and conversely if the second cache device 225 If a failure occurs, the first controller 221 and the second controller 222 can transfer the data in the second cache device 225 to the first cache device 224, thereby improving the security of the data.
  • the first cache device 224 and the second cache device 225 are additionally provided in addition to the first controller 221 and the second controller 222.
  • the first controller 221 or the second controller 222 may forward the target data to the first cache device 224 or the second cache.
  • the device 225 performs storage to obtain first image data. Therefore, when there is a problem with the target data, the first mirror data as a backup can also be used, which improves the reliability of the data.
  • the first controller 221 after receiving the target data sent by the host computer 210, the first controller 221 sends the target data to one of the first cache device 224 and the second cache device 225 for storage. In addition to obtaining the first image data, the first controller 221 may also send the target data to another cache device for storage, thereby obtaining the second image data. At this time, each of the first cache device 224 and the second cache device 225 has a data, and even if there is a problem with the data in one of the cache devices, the data in the other cache device can be used, thereby greatly improving the data. reliability.
  • the first cache device 224 and the second cache device 225 may be configured with a first home zone and a second home zone.
  • the attribute of the first home zone is: the first controller 221 can perform a read operation and a write operation on the first home zone, and the second controller 222 can perform a read operation on the first home zone but cannot perform a write operation.
  • the attribute of the second home zone is that the second controller 222 can perform a read operation and a write operation on the second home zone, and the first controller 221 can perform a read operation on the second home zone but cannot perform a write operation.
  • the first controller 221 sends the target data to one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data.
  • the first controller 221 sends the target data to the first home area of one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data. If receiving target data
  • the second controller 222 sends the target data to the second home area of one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data.
  • the first home area in the first cache device 224 and the first home area in the second cache device 225 may be read by the second controller 222.
  • the data is stored in the storage device 223.
  • the second controller 222 can send the data sent by the host computer 210 to the first home area and the second in the first cache device 224.
  • the first home zone in the cache device 225 is stored.
  • the other controller can take over the failed controller, and the read/write operation between the host computer 210 and the storage device 223 cannot be performed normally.
  • the first controller 221 may read the fault from the first cache device 224 and/or the second cache device 225. Pre-stored data to quickly recover data services.
  • the third controller when the third controller replaces the first controller 221, and the fourth controller replaces the second controller 222, the third The controller reads data stored before the first controller 221 fails from the first home area of the first cache device 224 and/or the second cache device 225, and the fourth controller is from the first cache device 224 and/or the second cache.
  • the second home zone of device 225 reads the data stored prior to the failure of the second controller 222 to recover the data traffic.
  • the cache device 400 (which may be the first cache device or the second cache device described above) may have a power-down protection function.
  • the first cache device or the second cache device may be correspondingly provided with a power-down protection function. If both the first cache device and the second cache device have one mirror data, the first cache device and the second cache device need to have the power-down protection function.
  • the cache device 400 includes a control chip 410, a non-volatile memory 420, and a random access memory 430.
  • the control chip 410 is connected to the non-volatile memory 420, respectively.
  • a random access memory 430 a storage space as the first space and another part of the storage space as the second space.
  • a part of the storage space of the random access memory 430 is used as the first home area, and a part of the space is empty.
  • the interval is the second home zone.
  • the control chip 410 fetches data from the first home zone of the random access memory 420 and stores the data fetched from the first home zone into the first space of the non-volatile memory 430, and Data is fetched from the second home area of the random access memory 420, and data fetched from the second home area is stored to the second space of the nonvolatile memory 430.
  • the control chip 410 fetches data from the first space of the nonvolatile memory 430, and restores the data fetched from the first space to the first home area of the random access memory 420, and The second space of the non-volatile memory 430 fetches data and restores the data fetched from the second space to the second home area of the random access memory to recover the data traffic.
  • the control chip 410 fetches data from the first home zone of the random access memory 420, adding a first tag to the data fetched from the first home zone. And storing the data after adding the first label into the non-volatile memory 430, and extracting data from the second home area of the random access memory 420, adding a second label for the data extracted from the second home area And storing the data after adding the second tag into the nonvolatile memory 430.
  • the control chip 410 retrieves data from the non-volatile memory 430, and restores the data in the data from the non-volatile memory 430 to the first tag to the random access memory 420. In a home zone, the data tagged as the second tag in the data fetched from the non-volatile memory 430 is restored to the second home zone of the random access memory 430.
  • the nonvolatile memory and the random access memory in the cache device 400 may also be replaced by a magnetic random access memory 450.
  • the magnetic random access memory 450 has both a random access memory access speed and a nonvolatile memory. The feature of memory power-down save.
  • controllers and two cache devices are used as an example.
  • the number of controllers may be three or more.
  • the cache device is used.
  • the number of attribution areas in the field should also increase accordingly, so that one controller corresponds to a home domain.
  • the number of the cache devices may also be four or more, which is not specifically limited in the present invention.
  • Figure 6 is a flow diagram of one possible embodiment of the data storage method of the present invention. This embodiment will be described from the perspective of the storage system shown in FIG. 2. Please understand with reference to FIG. 2, in the embodiment, the data storage method includes the following steps:
  • the host computer 210 selectively transmits the target data to the first controller 221 or the second controller 222.
  • the host computer 210 can selectively transmit target data to any one of the first controller 221 and the second controller 222. Since one data cannot be processed by both controllers at the same time, the attribution information of the target data is set in the target data, and the controller can determine whether the target data belongs to itself according to the attribution information. If the host computer 210 transmits the target data to the first controller 221, the process proceeds to step 520; if the host computer 210 transmits the target data to the second controller 222, the process proceeds to step 540.
  • the first controller 221 determines whether the target data belongs to the first controller 221 according to the attribution information in the target data.
  • the first controller 221 After receiving the target data, the first controller 221 acquires the home information from the target data, and determines whether it belongs to the first controller 221 according to the target data information. If it belongs to the first controller 221, the process proceeds to step 530; if it does not belong to the first controller 221, it is forwarded to the second controller 222, and proceeds to step 540.
  • the first controller 221 sends the target data to the first cache device 224 or the second cache device 225 for storage to obtain the first image data.
  • the first controller 221 may select to send the target data to the first cache device 224 for storage to obtain the first mirror data, or may select to send the target data to the second cache device 225 for storage to obtain the first mirror data.
  • the first cache device 224 and the second cache device 225 are both provided with a first home zone and a second home zone.
  • the attribute of the first home zone is: the first controller 221 can perform a read operation and a write operation on the first home zone, and the second controller 222 can perform a read operation on the first home zone but cannot perform a write operation.
  • the attribute of the second home zone is that the second controller 222 can perform a read operation and a write operation on the second home zone, and the first controller 221 can perform a read operation on the second home zone but cannot perform a write operation. Therefore, the first controller 221 sends the target data to the first home area of one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data. Then, returning to step 510, until it is necessary to store the data in the cache device to the storage device 223, the process proceeds to step 560.
  • the second controller 222 determines, according to the attribution information in the target data, whether the target data belongs to the second controller 222 for processing.
  • the second controller 222 After receiving the target data, the second controller 222 acquires the home information from the target data, and determines whether it belongs to the second controller 222 according to the target data information. If it belongs to the second controller 222, the process proceeds to step 550; if it does not belong to the second controller 222, the target data is forwarded to the first controller 221, and the process proceeds to step 520.
  • the second controller 222 sends the target data to the first cache device 224 or the second cache device 225 for storage to obtain the first image data.
  • the second controller 222 may select to send the target data to the first cache device 224 for storage to obtain the first mirror data, or may select to send the target data to the second cache device 225 for storage to obtain the first mirror data. In a specific implementation, the second controller 222 sends the target data to the second home area of one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data. Then, returning to step 510, until it is necessary to store the data in the cache device to the storage device 223, the process proceeds to step 560.
  • the first controller 221 and the second controller 222 store data in the first cache device 224 and the second cache device 225 into the storage device 223.
  • the first controller 221 When the data in the cache device needs to be stored to the storage device 223, for example, when the data in the cache device reaches the threshold, or the host computer 210 instructs to store the data in the cache device to the storage device 223, the first controller 221 The data processed by the first controller 221 in the first cache device 224 and the second cache device 225 is stored in the storage device 223. The second controller 222 also stores the data processed by the second controller 222 in the first cache device 224 and the second cache device 225 into the storage device 223.
  • the first controller 221 and the second controller 222 can transfer the data in the first cache device 224 to the second cache device 225. Conversely, if the second When the cache device 225 fails, the first controller 221 and the second controller 222 can transfer the data in the second cache device 225 to the first cache device 224, thereby improving the security of the data.
  • the cache device can be additionally set and the mirror data is stored in the cache device, so the controller does not need to provide storage space for the mirror data, thereby reducing the requirement on the controller memory size.
  • the mirrored data does not need to be transmitted through the PCIe/IB (nfiniband) path, which can alleviate the pressure of data transmission in the PCIe/IB (nfiniband) path.
  • the load on the controller is reduced. Less, even if one of the controllers has a problem, the controller will not be forced to write data directly to the storage device because the load is too heavy, thus greatly improving the speed of data reading and writing.
  • the first controller cannot write the second home zone that can be written by the second controller
  • the second controller cannot write the first home zone that can be written by the first controller, that is, the first controller and the second controller
  • the storage space that the device can perform write operations is independent of each other, which can prevent conflicts caused by two different controllers simultaneously writing to the same storage unit.
  • Figure 7 is a flow diagram of another possible implementation of the data storage method of the present invention. This embodiment will be described from the perspective of the storage system shown in FIG. 2. Please understand with reference to FIG. 2, in the embodiment, the data storage method includes the following steps:
  • the host computer 210 selectively transmits the target data to the first controller 221 or the second controller 222.
  • the host computer 210 can selectively transmit target data to any one of the first controller 221 and the second controller 222. Since one data cannot be processed by both controllers at the same time, the attribution information of the target data is set in the target data, and the controller can determine whether the target data belongs to itself according to the attribution information. If the host computer 210 transmits the target data to the first controller 221. Then, the process proceeds to step 620. If the host computer 210 transmits the target data to the second controller 222, the process proceeds to step 650.
  • the first controller 221 determines whether the target data belongs to the first controller 221 according to the attribution information in the target data.
  • the first controller 221 After receiving the target data, the first controller 221 acquires the home information from the target data, and determines whether it belongs to the first controller 221 according to the target data information. If it belongs to the first controller 221, the process proceeds to step 630; if it does not belong to the first controller 221, it is forwarded to the second controller 222, and proceeds to step 640.
  • the first controller 221 sends the target data to the first cache device 224 for storage to obtain the first image data.
  • the first controller 221 transmits the target data to the first cache device 224 for storage to obtain the first mirror data.
  • the first cache device 224 is provided with a first home zone and a second home zone.
  • the attribute of the first home zone is: the first controller 221 is the first home The genus area can perform a read operation and a write operation, and the second controller 222 can perform a read operation on the first home area but cannot perform a write operation.
  • the attribute of the second home zone is that the second controller 222 can perform a read operation and a write operation on the second home zone, and the first controller 221 can perform a read operation on the second home zone but cannot perform a write operation. Therefore, the first controller 221 transmits the target data to the first home area of the first cache device 224 for storage to obtain the first image data.
  • the first controller 221 sends the target data to the second cache device 225 for storage to obtain the second image data.
  • the first controller 221 transmits the target data to the second cache device 225 for storage to obtain second mirror data.
  • the first controller 221 sends the target data to the first home area of the second cache device 225 for storage to obtain the second image data. Then, returning to step 610, until it is necessary to store the data in the cache device to the storage device 223, the process proceeds to step 680.
  • the second controller 222 determines, according to the attribution information in the target data, whether the target data belongs to the second controller 222 for processing.
  • the second controller 222 After receiving the target data, the second controller 222 acquires the home information from the target data, and determines whether it belongs to the second controller 222 according to the target data information. If it belongs to the second controller 222, the process proceeds to step 660; if it does not belong to the second controller 222, the target data is forwarded to the first controller 221, and the process proceeds to step 620.
  • the second controller 222 sends the target data to the first cache device 224 for storage to obtain the first image data.
  • the second controller 222 sends the target data to the first cache device 224 for storage to obtain the first image data.
  • the second controller 222 sends the target data to the second home area of the first cache device 224 for storage to obtain the first image data.
  • the second controller 222 sends the target data to the second cache device 225 for storage to obtain the second image data.
  • the second controller 222 transmits the target data to the second cache device 225 for storage to obtain second mirror data.
  • the second controller 222 sends the target data to the second home area of the second cache device 225 for storage to obtain the second image data. Then, returning to step 610, until it is necessary to store the data in the cache device to the storage device 223, the process proceeds to step 680.
  • the first controller 221 and the second controller 222 will use the first cache device 224 and the second buffer
  • the data in the storage device 225 is stored in the storage device 223.
  • the first controller 221 When the data in the cache device needs to be stored to the storage device 223, for example, when the data in the cache device reaches the threshold, or the host computer 210 instructs to store the data in the cache device to the storage device 223, the first controller 221 The data processed by the first controller 221 in the first cache device 224 and the second cache device 225 is stored in the storage device 223. The second controller 222 also stores the data processed by the second controller 222 in the first cache device 224 and the second cache device 225 into the storage device 223.
  • the first controller 221 after receiving the target data sent by the host computer 210, the first controller 221 sends the target data to the first cache device 224 for storage to obtain the first image data, and the first controller 221 further The target data may be sent to the second cache device 225 for storage to obtain second mirror data.
  • each of the first cache device 224 and the second cache device 225 has a data, and even if there is a problem with the data in one of the cache devices, the data in the other cache device can be used, thereby greatly improving the data. reliability.
  • the data in the first home zone of the first cache device 224 and the first home zone in the second cache device 225 may be read by the second controller 222 and stored in the storage device.
  • the second controller 222 may send the data sent by the host computer 210 to the first home zone in the first cache device 224 and the first home zone in the second cache device 225.
  • the other controller can take over the failed controller, and the read/write operation between the host computer 210 and the storage device 223 cannot be performed normally.
  • the first controller 221 may read the fault from the first cache device 224 and/or the second cache device 225. Pre-stored data to quickly recover data services.
  • the third controller when the third controller replaces the first controller 221 and the fourth controller replaces the second controller 222, the third controller
  • the first home area of the first cache device 224 and/or the second cache device 225 reads data stored before the first controller 221 fails, and the fourth controller is from the first cache device 224 and/or the second cache device 225
  • the second home zone reads data stored before the second controller 222 fails to recover the data traffic.
  • the cache device 400 (which may be the first cache device or the second cache device described above) may have a power-down protection function. just one When the mirrored data is stored in the first cache device or the second cache device, the first cache device or the second cache device may be correspondingly provided with a power-down protection function. If both the first cache device and the second cache device have one mirror data, the first cache device and the second cache device need to have the power-down protection function.
  • the cache device 400 includes a control chip 410, a non-volatile memory 420, and a random access memory 430.
  • the control chip 410 is connected to the non-volatile memory 420, respectively.
  • a random access memory 430 a storage space as the first space and another part of the storage space as the second space.
  • a part of the storage space of the random access memory 430 is used as the first home area, and a part of the space is used as the second home area.
  • the control chip 410 fetches data from the first home zone of the random access memory 420 and stores the data fetched from the first home zone into the first space of the non-volatile memory 430, and Data is fetched from the second home area of the random access memory 420, and data fetched from the second home area is stored to the second space of the nonvolatile memory 430.
  • the control chip 410 fetches data from the first space of the nonvolatile memory 430, and restores the data fetched from the first space to the first home area of the random access memory 420, and The second space of the non-volatile memory 430 fetches data and restores the data fetched from the second space to the second home area of the random access memory to recover the data traffic.
  • the control chip 410 fetches data from the first home zone of the random access memory 420, adding a first tag to the data fetched from the first home zone. And storing the data after adding the first label into the non-volatile memory 430, and extracting data from the second home area of the random access memory 420, adding a second label for the data extracted from the second home area And storing the data after adding the second tag into the nonvolatile memory 430.
  • the control chip 410 retrieves data from the non-volatile memory 430, and restores the data in the data from the non-volatile memory 430 to the first tag to the random access memory 420. In a home zone, the data tagged as the second tag in the data fetched from the non-volatile memory 430 is restored to the second home zone of the random access memory 430.
  • the nonvolatile memory and the random access memory in the cache device 400 may also be replaced by a magnetic random access memory 450, which has both random access memory access speeds.
  • controllers and two cache devices are used as an example.
  • the number of controllers may be three or more.
  • the cache device is used.
  • the number of attribution areas in the field should also increase accordingly, so that one controller corresponds to a home domain.
  • the number of the cache devices may also be four or more, which is not specifically limited in the present invention.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Abstract

A data storage method and system (220). The method comprises: selectively transmitting, by a host computer (210), target data to a first controller (221) or a second controller (222) (510); if the first controller (221) receives the target data, determining, by the first controller (221), according to responsibility information in the target data, whether the first controller (221) is responsible for processing the target data (520); if not, forwarding, by the first controller (221), the target data to the second controller (222); if so, transmitting, by the first controller (221), the target data to a first buffer apparatus (224) or a second buffer apparatus (225) to store the same (530) and obtain first image data; and when it is required to store the data in the buffer apparatuses to a storage device (223), storing, by the first controller (221), data including the target data, processed by the first controller (221) and stored in the first buffer apparatus (224) or the second buffer apparatus (225), to the storage device (223) (560). The method lowers a controller memory requirement, and decreases stress of transmitting image data between controllers.

Description

数据存储方法以及存储系统Data storage method and storage system 技术领域Technical field
本发明涉及存储领域,尤其涉及一种数据存储方法以及存储系统。The present invention relates to the field of storage, and in particular, to a data storage method and a storage system.
背景技术Background technique
上位机中运算的数据,大部分最终都要发送到存储设备中进行存储。为了保证上位机将数据存储到存储设备过程的可靠性,存储系统通常采用多控制器结构。例如,如图1所示,存储系统120包括第一控制器121、第二控制器122以及存储设备123。其中,第一控制器121用于与上位机110数据通信,第二控制器122同样用于与上位机110数据通信,第一控制器121和第二控制器122之间通过PCIe/IB(nfiniband)连接,第一控制器121连接存储设备123,第二控制器同样连接存储设备123。Most of the data calculated in the host computer will eventually be sent to the storage device for storage. In order to ensure the reliability of the process of storing data to the storage device, the storage system usually adopts a multi-controller structure. For example, as shown in FIG. 1, the storage system 120 includes a first controller 121, a second controller 122, and a storage device 123. The first controller 121 is used for data communication with the host computer 110, and the second controller 122 is also used for data communication with the host computer 110. The first controller 121 and the second controller 122 pass PCIe/IB (nfiniband). The first controller 121 is connected to the storage device 123, and the second controller is also connected to the storage device 123.
由于上位机110与控制器之间读写数据的速度远比上位机110与存储设备123之间读写数据的速度快,当数据频繁读写时,上位机110不会将数据直接存储到读写速度比较慢的存储设备123中,而是向读写速度比较快的控制器发送数据,直到控制器内的数据达到一定的量或者上位机110确定要将数据存储到存储设备123时,控制器将控制器内的数据发送给存储设备123进行存储。例如,上位机110先将数据发送给第一控制器121和第二控制器122中的任意一个控制器,接收到数据的控制器会将接收到的数据存储在本控制器的缓存中,以便于和上位机110进行交互。此外,为了提高数据的可靠性,接收到数据的控制器将数据通过PCIe/IB(nfiniband)等通路传输到另一个控制器的内存中进行存储以获得一份镜像数据来进行备份。最后,当数据达到一定的量或者上位机110确定将数据存储到存储设备123时,控制器将内存中的数据处理后发送给存储设备123进行存储,从而提高数据读写效率。Since the speed of reading and writing data between the host computer 110 and the controller is much faster than reading and writing data between the host computer 110 and the storage device 123, when the data is frequently read and written, the host computer 110 does not directly store the data to the read. In the storage device 123 with slower writing speed, data is sent to the controller with faster read/write speed until the data in the controller reaches a certain amount or the upper computer 110 determines that the data is to be stored in the storage device 123, and the control is performed. The device sends the data in the controller to the storage device 123 for storage. For example, the host computer 110 first transmits data to any one of the first controller 121 and the second controller 122, and the controller that receives the data stores the received data in the cache of the controller, so that Interact with the host computer 110. In addition, in order to improve the reliability of the data, the controller that receives the data transfers the data to another controller's memory through a path such as PCIe/IB (nfiniband) for storage to obtain a mirror image for backup. Finally, when the data reaches a certain amount or the upper computer 110 determines to store the data to the storage device 123, the controller processes the data in the memory and sends it to the storage device 123 for storage, thereby improving data reading and writing efficiency.
但是,在这种方式下,控制器的内存中必须预留镜像数据存储的空间,以容纳其他控制器发送过来的镜像数据,所以对控制器的内存的容量要求比较大。而且,由于PCIe/IB(nfiniband)通路的带宽是有限的,当镜像数据较多时,会给PCIe/IB(nfiniband)通路的正常数据传输带来压力。最后,当其中一个控制器出现问题时,所有数据都只能通过剩下的控制器进行存储,为了 保证数据的可靠性,剩下的控制器不会将数据缓存在本控制器中,而是直接写入到存储设备中,大大降低了读写的速度。However, in this mode, the space of the mirrored data storage must be reserved in the memory of the controller to accommodate the mirrored data sent by other controllers, so the memory capacity of the controller is relatively large. Moreover, since the bandwidth of the PCIe/IB (nfiniband) path is limited, when there is a large amount of mirrored data, it will put pressure on the normal data transmission of the PCIe/IB (nfiniband) path. Finally, when one of the controllers has a problem, all data can only be stored by the remaining controllers, in order to To ensure the reliability of the data, the remaining controllers will not cache the data in the controller, but directly write to the storage device, which greatly reduces the speed of reading and writing.
发明内容Summary of the invention
本发明实施例所要解决的技术问题在于,提供一种存储系统以及数据存储方法,实现了减少对内存容量的要求。The technical problem to be solved by the embodiments of the present invention is to provide a storage system and a data storage method, which achieve the requirement of reducing the memory capacity.
第一方面,本发明提供了一种数据存储方法,包括:包含至少第一控制器以及第二控制器在内的至少两个控制器、存储设备以及包含第一缓存设备以及第二缓存设备在内的至少两个缓存设备,所述第一控制器用于与上位机进行通信,所述第一控制器还分别连接所述存储设备、所述第一缓存设备以及所述第二缓存设备,所述第二控制器用于与上位机进行通信,所述第二控制器还分别连接所述存储设备、所述第一缓存设备以及所述第二缓存设备,所述第一控制器连接所述第二控制器,所述第一缓存设备中设置有第一归属区域以及第二归属区域,所述第二缓存设备中设置有第一归属区域以及第二归属区域,In a first aspect, the present invention provides a data storage method, including: at least two controllers including at least a first controller and a second controller, a storage device, and a first cache device and a second cache device At least two cache devices, the first controller is configured to communicate with the upper computer, and the first controller is further connected to the storage device, the first cache device, and the second cache device, respectively The second controller is configured to communicate with the upper computer, the second controller is further connected to the storage device, the first cache device, and the second cache device, where the first controller is connected to the first a second controller, the first cache area and the second home area are disposed in the first cache device, and the first cache area and the second home area are disposed in the second cache device.
所述第一归属区域的属性为:所述第一控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作和写操作,所述第二控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作但不能进行写操作,The attribute of the first home zone is that the first controller can perform a read operation and a write operation on the first home zone in the first cache device and the first home zone in the second cache device. The second controller can perform a read operation on the first home zone in the first cache device and the first home zone in the second cache device, but cannot perform a write operation.
所述第二归属区域的属性为:所述第二控制器对所述第一缓存设备中的第二归属区域以及所述第二缓存设备中的第二归属区域可进行读取操作和写操作,所述第一控制器对所述第一缓存设备中的第二归属区域以及所述第二缓存设备中的第二归属区域可进行读取操作但不能进行写操作;The attribute of the second home zone is: the second controller can perform a read operation and a write operation on the second home zone in the first cache device and the second home zone in the second cache device. The first controller can perform a read operation on the second home area in the first cache device and the second home area in the second cache device, but cannot perform a write operation;
所述第一控制器接收所述上位机所发送的目标数据;The first controller receives target data sent by the upper computer;
所述第一控制器根据所述目标数据中的归属信息判断所述目标数据是否属于所述第一控制器处理;Determining, by the first controller, whether the target data belongs to the first controller according to the attribution information in the target data;
如果否,则所述第一控制器将所述目标数据转发至所述第二控制器,如果是,则所述第一控制器将所述目标数据发送至所述第一缓存设备或所述第二缓存设备中的第一归属区域进行存储以获得第一镜像数据;If not, the first controller forwards the target data to the second controller, and if yes, the first controller sends the target data to the first cache device or the The first home area in the second cache device is stored to obtain first image data;
在需要将缓存设备内的数据存储到所述存储设备时,所述第一控制器将所述第一缓存设备和所述第二缓存设备的第一归属区域中的包含所述目标数据 在内的由所述第一控制器处理之后的数据存储到所述存储设备中。When the data in the cache device needs to be stored in the storage device, the first controller includes the target data in the first home area of the first cache device and the second cache device The data processed by the first controller is stored in the storage device.
结合第一方面,本发明第一方面的第一种可能的实施方式中,所述方法还包括:In conjunction with the first aspect, in a first possible implementation manner of the first aspect, the method further includes:
如果所述第一缓存设备发生故障,则所述第一控制器以及所述第二控制器将所述第一缓存设备中的数据转移至所述第二缓存设备。If the first cache device fails, the first controller and the second controller transfer data in the first cache device to the second cache device.
结合第一方面,本发明第一方面的第二种可能的实施方式中,所述方法还包括:In conjunction with the first aspect, in a second possible implementation manner of the first aspect, the method further includes:
如果所述第一控制器将所述目标数据发送给所述第一缓存设备以获得所述第一镜像数据,则所述第一控制器还将所述目标数据发送给所述第二缓存设备以获得所述第二镜像数据。And if the first controller sends the target data to the first cache device to obtain the first mirror data, the first controller further sends the target data to the second cache device Obtaining the second image data.
结合第一方面或第一方面的第一种可能的实施方式或第一方面的第二种可能的实施方式,本发明第一方面的第三种可能的实施方式中,当所述第一控制器出现故障时,所述第二控制器修改所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域的属性为:所述第二控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作和写操作,With reference to the first aspect or the first possible embodiment of the first aspect or the second possible implementation of the first aspect, in a third possible implementation manner of the first aspect of the present invention, when the first control The second controller modifies the attributes of the first home zone in the first cache device and the first home zone in the second cache device when the device is faulty: the second controller pairs the The first home area in the first cache device and the first home area in the second cache device may perform a read operation and a write operation,
所述第二控制器读取所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域中的数据,并存储到所述存储设备中;The second controller reads data in the first home area of the first cache device and the first home area in the second cache device, and stores the data in the storage device;
所述第二控制器接收到上位机发送的数据后,可以将上位机发送的数据发送到所述第一缓存设备中的第一归属区域以及所述第二缓存设备中第一归属区域进行存储。After receiving the data sent by the upper computer, the second controller may send the data sent by the upper computer to the first home area in the first cache device and the first home area in the second cache device for storage. .
结合第一方面或第一方面的第一种可能的实施方式或第一方面的第二种可能的实施方式,本发明第一方面的第四种可能的实施方式中,如果所述第一控制器和所述第二控制器发生故障,当第三控制器替换所述第一控制器,第四控制器替换所述第二控制器后,所述第三控制器从所述第一缓存设备中的第一归属区域和/或所述第二缓存设备中的第一归属区域读取所述第一控制器存储的数据,所述第四控制器从所述第一缓存设备中的第二归属区域和/或所述第二缓存设备中的第二归属区域读取所述第二控制器存储的数据,以恢复数据业务。 With reference to the first aspect or the first possible embodiment of the first aspect or the second possible implementation of the first aspect, in the fourth possible implementation manner of the first aspect of the present invention, if the first control And the second controller fail, when the third controller replaces the first controller, and after the fourth controller replaces the second controller, the third controller is from the first cache device Reading the data stored by the first controller in the first home zone and/or the first home zone in the second cache device, the fourth controller from the second one of the first cache devices The home area and/or the second one of the second cache devices reads data stored by the second controller to recover data traffic.
第二方面,本发明提供了一种存储系统,包括:包含至少第一控制器以及第二控制器在内的至少两个控制器、存储设备以及包含第一缓存设备以及第二缓存设备在内的至少两个缓存设备,所述第一控制器用于与上位机进行通信,所述第一控制器还分别连接所述存储设备、所述第一缓存设备以及所述第二缓存设备,所述第二控制器用于与上位机进行通信,所述第二控制器还分别连接所述存储设备、所述第一缓存设备以及所述第二缓存设备,所述第一控制器连接所述第二控制器,所述第一缓存设备中设置有第一归属区域以及第二归属区域,所述第二缓存设备中设置有第一归属区域以及第二归属区域,In a second aspect, the present invention provides a storage system, including: at least two controllers including at least a first controller and a second controller, a storage device, and a first cache device and a second cache device At least two cache devices, the first controller is configured to communicate with the upper computer, and the first controller is further connected to the storage device, the first cache device, and the second cache device, respectively, The second controller is configured to communicate with the upper computer, the second controller is further connected to the storage device, the first cache device, and the second cache device, and the first controller is connected to the second a first home area and a second home area are disposed in the first cache device, and the first cache area and the second home area are disposed in the second cache device.
所述第一归属区域的属性为:所述第一控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作和写操作,所述第二控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作但不能进行写操作,The attribute of the first home zone is that the first controller can perform a read operation and a write operation on the first home zone in the first cache device and the first home zone in the second cache device. The second controller can perform a read operation on the first home zone in the first cache device and the first home zone in the second cache device, but cannot perform a write operation.
所述第二归属区域的属性为:所述第二控制器对所述第一缓存设备中的第二归属区域以及所述第二缓存设备中的第二归属区域可进行读取操作和写操作,所述第一控制器对所述第一缓存设备中的第二归属区域以及所述第二缓存设备中的第二归属区域可进行读取操作但不能进行写操作;The attribute of the second home zone is: the second controller can perform a read operation and a write operation on the second home zone in the first cache device and the second home zone in the second cache device. The first controller can perform a read operation on the second home area in the first cache device and the second home area in the second cache device, but cannot perform a write operation;
所述第一控制器用于接收所述上位机所发送的目标数据;The first controller is configured to receive target data sent by the upper computer;
所述第一控制器用于根据所述目标数据中的归属信息判断所述目标数据是否属于所述第一控制器处理,在判断结果为否时,将所述目标数据转发至所述第二控制器,在判断结果为是时,将所述目标数据发送至所述第一缓存设备或所述第二缓存设备中的第一归属区域进行存储以获得第一镜像数据;The first controller is configured to determine, according to the attribution information in the target data, whether the target data belongs to the first controller, and if the determination result is no, forwarding the target data to the second control And sending the target data to the first cache area of the first cache device or the second cache device for storage to obtain first mirror data;
所述第一控制器还用于在需要将数据从缓存设备存储到所述存储设备时,将所述第一缓存设备和所述第二缓存设备的第一归属区域中的包含所述目标数据在内的由所述第一控制器处理之后的数据存储到所述存储设备中。The first controller is further configured to: when the data needs to be stored from the cache device to the storage device, include the target data in the first home area of the first cache device and the second cache device The data processed by the first controller is stored in the storage device.
结合第二方面,本发明第二方面的第一种可能的实施方式中,所述第一控制器以及所述第二控制器用于在所述第一缓存设备发生故障时,将所述第一缓存设备中的数据转移至所述第二缓存设备。With reference to the second aspect, in a first possible implementation manner of the second aspect of the present invention, the first controller and the second controller are configured to: when the first cache device fails, the first The data in the cache device is transferred to the second cache device.
结合第二方面,本发明第二方面的第二种可能的实施方式中,所述第一控制器还用于在所述第一控制器将所述目标数据发送给所述第一缓存设备以获 得所述第一镜像数据时,将所述目标数据发送给所述第二缓存设备以获得所述第二镜像数据。With reference to the second aspect, in a second possible implementation manner of the second aspect of the present invention, the first controller is further configured to send, by the first controller, the target data to the first cache device Obtained And when the first image data is obtained, sending the target data to the second cache device to obtain the second image data.
结合第二方面或第二方面的第一种可能的实施方式或第二方面的第二种可能的实施方式,本发明第二方面的第三种可能的实施方式中,当所述第一控制器出现故障时,所述第二控制器修改所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域的属性为:所述第二控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作和写操作,With reference to the second aspect or the first possible embodiment of the second aspect or the second possible implementation of the second aspect, in a third possible implementation manner of the second aspect of the present invention, when the first control The second controller modifies the attributes of the first home zone in the first cache device and the first home zone in the second cache device when the device is faulty: the second controller pairs the The first home area in the first cache device and the first home area in the second cache device may perform a read operation and a write operation,
所述第二控制器用于读取所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域中的数据,并存储到所述存储设备中;The second controller is configured to read data in the first home area of the first cache device and the first home area in the second cache device, and store the data in the storage device;
所述第二控制器还用于接收到上位机发送的数据后,可以将上位机发送的数据发送到所述第一缓存设备中的第一归属区域以及所述第二缓存设备中第一归属区域进行存储。The second controller is further configured to: after receiving the data sent by the upper computer, send the data sent by the upper computer to the first home zone in the first cache device and the first home in the second cache device The area is stored.
结合第二方面或第二方面的第一种可能的实施方式或第二方面的第二种可能的实施方式,本发明第二方面的第四种可能的实施方式中,在所述第一控制器和所述第二控制器发生故障,当第三控制器替换所述第一控制器,第四控制器替换所述第二控制器后,With reference to the second aspect or the first possible embodiment of the second aspect or the second possible implementation of the second aspect, in the fourth possible implementation manner of the second aspect of the present invention, in the first control And the second controller fails. When the third controller replaces the first controller, and the fourth controller replaces the second controller,
所述第三控制器用于从所述第一缓存设备中的第一归属区域和/或所述第二缓存设备中的第一归属区域读取所述第一控制器存储的数据;The third controller is configured to read data stored by the first controller from a first home zone in the first cache device and/or a first home zone in the second cache device;
所述第四控制器用于从所述第一缓存设备中的第二归属区域和/或所述第二缓存设备中的第二归属区域读取所述第二控制器存储的数据,以恢复数据业务。The fourth controller is configured to read data stored by the second controller from a second home zone in the first cache device and/or a second home zone in the second cache device to recover data business.
通过实施本发明实施例,能够另外设置缓存设备并将镜像数据存储在缓存设备中,则控制器无需为镜像数据提供存储空间,从而减少对控制器内存大小的要求。而且,当上位机发送的数据到达所属的控制器后,不需要通过PCIe/IB(nfiniband)通路将数据发送至另一个控制器,则能减轻两个控制器之间的PCIe/IB(nfiniband)通路的数据传输的压力。最后,当其中一个控制器出现问题时,另一个控制器可以把上位机发送的数据写到缓存设备中以保证数据可靠性,而且,控制器不需要将数据直接写入到存储设备中,从而大大 提高了写数据的速度。而且,第一控制器不能写属于第二控制器可以写的第二归属区域,第二控制器不能写属于第一控制器可以写的第一归属区域,即,第一控制器和第二控制器可以进行写操作的存储空间是互相独立的,可以防止两个不同的控制器同时对同一存储单元进行写操作而造成的冲突。By implementing the embodiment of the present invention, the cache device can be additionally set and the mirror data is stored in the cache device, so the controller does not need to provide storage space for the mirror data, thereby reducing the requirement on the controller memory size. Moreover, when the data sent by the host computer reaches the controller, it is not necessary to send data to another controller through the PCIe/IB (nfiniband) path, thereby reducing the PCIe/IB (nfiniband) between the two controllers. The pressure of the data transmission of the path. Finally, when one of the controllers has a problem, the other controller can write the data sent by the host computer to the cache device to ensure data reliability, and the controller does not need to directly write the data to the storage device, thereby Great Increased the speed of writing data. Moreover, the first controller cannot write the second home zone that can be written by the second controller, and the second controller cannot write the first home zone that can be written by the first controller, that is, the first controller and the second controller The storage space that the device can perform write operations is independent of each other, which can prevent conflicts caused by two different controllers simultaneously writing to the same storage unit.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1是现有技术存储系统一实施方式的结构示意图;1 is a schematic structural diagram of an embodiment of a prior art storage system;
图2是本发明存储系统一种可能的实施方式的结构示意图;2 is a schematic structural diagram of a possible implementation manner of a storage system according to the present invention;
图3是本发明存储系统中缓存设备中第一归属区域和第二归属区域的示意图;3 is a schematic diagram of a first home zone and a second home zone in a cache device in the storage system of the present invention;
图4是本发明存储系统中缓存设备一实施方式的结构示意图;4 is a schematic structural diagram of an embodiment of a cache device in a storage system according to the present invention;
图5是本发明存储系统中缓存设备另一实施方式的结构示意图;5 is a schematic structural diagram of another embodiment of a cache device in a storage system according to the present invention;
图6是本发明数据存储方法一实施方式的流程图;6 is a flow chart of an embodiment of a data storage method of the present invention;
图7是本发明数据存储方法另一实施方式的流程图。7 is a flow chart of another embodiment of a data storage method of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
需要说明的是,在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。It is to be understood that the terminology used in the embodiments of the present invention is for the purpose of describing the particular embodiments, and is not intended to limit the invention. The singular forms "a", "the" and "the" It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
参阅图2,图2是本发明存储系统一种可能的实施方式的结构示意图。本 实施方式的存储系统220包括:第一控制器221、第二控制器222、存储设备223、第一缓存设备224以及第二缓存设备225。其中,第一缓存设备224和第二缓存设备225均是多端口设备,这里,第一缓存设备224和第二缓存设备225均具有第一端口以及第二端口两个端口。Referring to FIG. 2, FIG. 2 is a schematic structural diagram of a possible implementation manner of a storage system according to the present invention. Ben The storage system 220 of the embodiment includes: a first controller 221, a second controller 222, a storage device 223, a first cache device 224, and a second cache device 225. The first cache device 224 and the second cache device 225 are both multi-port devices. Here, the first cache device 224 and the second cache device 225 each have a first port and a second port.
第一控制器221用于连接上位机210,第一控制器221还分别连接存储设备223、第一缓存设备224的第一端口以及第二缓存设备225的第一端口,第一控制器221通过PCIe/IB(nfiniband)连接第二控制器222,第二控制器222用于连接上位机210,第二控制器222连接存储设备223、第一缓存设备224的第二端口以及第二缓存设备225的第二端口。其中,第一控制器221与第一缓存设备224的第一端口以及第二缓存设备225的第一端口之间,第二控制器222与第一缓存设备224的第二端口以及第二缓存设备225的第二端口之间都可以通过PCIe/IB(nfiniband)连接。在其他的实施方式中,也可以通过其他总线进行连接,本发明不作具体限定。The first controller 221 is configured to be connected to the host computer 210. The first controller 221 is further connected to the storage device 223, the first port of the first cache device 224, and the first port of the second cache device 225, respectively. The PCIe/IB (nfiniband) is connected to the second controller 222, the second controller 222 is configured to be connected to the host computer 210, and the second controller 222 is connected to the storage device 223, the second port of the first cache device 224, and the second cache device 225. The second port. The first controller 221 is connected between the first port of the first cache device 224 and the first port of the second cache device 225, the second controller 222 and the second port of the first cache device 224, and the second cache device. The second port of 225 can be connected by PCIe/IB (nfiniband). In other embodiments, connections may be made through other buses, which are not specifically limited in the present invention.
上位机210可以选择性向第一控制器221和第二控制器222中的任意一个控制器发送目标数据。由于一个数据不能同时被两个控制器进行处理,所以,在目标数据中设置了目标数据的归属信息,控制器可以根据这个归属信息判断目标数据是否属于自己处理。假设接收到目标数据的控制器为第一控制器221,则第一控制器221根据目标数据中的所属控制器的信息判断目标数据是否属于第一控制器221处理。如果目标数据不属于第一控制器221处理,则第一控制器221通过PCIe/IB(nfiniband)将目标数据转发给第二控制器222,再由第二控制器222根据目标数据中的所属控制器的信息判断目标数据是否属于第二控制器222处理。如果目标数据属于第一控制器221处理,则第一控制器221会将目标数据发送给第一缓存设备224和第二缓存设备225中的一个缓存设备进行存储以获得第一镜像数据。The host computer 210 can selectively transmit target data to any one of the first controller 221 and the second controller 222. Since one data cannot be processed by both controllers at the same time, the attribution information of the target data is set in the target data, and the controller can determine whether the target data belongs to itself according to the attribution information. Assuming that the controller that receives the target data is the first controller 221, the first controller 221 determines whether the target data belongs to the first controller 221 based on the information of the controller that belongs to the target data. If the target data does not belong to the first controller 221, the first controller 221 forwards the target data to the second controller 222 via PCIe/IB (nfiniband), and then the second controller 222 controls the belonging according to the target data. The information of the device determines whether the target data belongs to the second controller 222 for processing. If the target data belongs to the first controller 221, the first controller 221 sends the target data to one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data.
当上位机210选择向第二控制器222发送目标数据时,第二控制器222也进行类似的操作。When the host computer 210 selects to transmit the target data to the second controller 222, the second controller 222 also performs a similar operation.
在需要将缓存设备内的数据存储到存储设备223时,例如,缓存设备中的数据达到阈值,或者上位机210下指令将缓存设备内的数据存储到存储设备223时,第一控制器221会将第一缓存设备224和第二缓存设备225中的包含目标数据在内由第一控制器221进行处理的数据存储到存储设备223中。第二 控制器222也会将第一缓存设备224和第二缓存设备225中的由第二控制器222处理的数据存储到存储设备223中。When the data in the cache device needs to be stored to the storage device 223, for example, when the data in the cache device reaches the threshold, or the host computer 210 instructs to store the data in the cache device to the storage device 223, the first controller 221 The data processed by the first controller 221 including the target data in the first cache device 224 and the second cache device 225 is stored in the storage device 223. Second The controller 222 also stores data processed by the second controller 222 in the first cache device 224 and the second cache device 225 into the storage device 223.
如果第一缓存设备224发生非毁灭性故障,则第一控制器221以及第二控制器222可以将第一缓存设备224中的数据转移至第二缓存设备225,相反,如果第二缓存设备225发生故障,则第一控制器221以及第二控制器222可以将第二缓存设备225中的数据转移至第一缓存设备224,从而提高了数据的安全性。If the first cache device 224 has a non-destructive failure, the first controller 221 and the second controller 222 may transfer the data in the first cache device 224 to the second cache device 225, and conversely if the second cache device 225 If a failure occurs, the first controller 221 and the second controller 222 can transfer the data in the second cache device 225 to the first cache device 224, thereby improving the security of the data.
在本实施方式中,在第一控制器221和第二控制器222之外另外设置了第一缓存设备224以及第二缓存设备225。当第一控制器221或第二控制器222接收到上位机210所发送的目标数据时,第一控制器221或第二控制器222可以将目标数据转发至第一缓存设备224或者第二缓存设备225中进行存储从而获得第一镜像数据。所以,当目标数据出现问题时,还可以使用作为备份的第一镜像数据,提高了数据的可靠性。In the present embodiment, the first cache device 224 and the second cache device 225 are additionally provided in addition to the first controller 221 and the second controller 222. When the first controller 221 or the second controller 222 receives the target data sent by the host computer 210, the first controller 221 or the second controller 222 may forward the target data to the first cache device 224 or the second cache. The device 225 performs storage to obtain first image data. Therefore, when there is a problem with the target data, the first mirror data as a backup can also be used, which improves the reliability of the data.
在另一种实施方式中,第一控制器221接收到上位机210所发送的目标数据后,除了将目标数据发送至第一缓存设备224和第二缓存设备225中的一个缓存设备进行存储以获得第一镜像数据外,第一控制器221还可以将目标数据发送至另一个缓存设备中进行存储,从而得到第二镜像数据。此时,第一缓存设备224和第二缓存设备225中各有一份数据,即使其中一个缓存设备中的数据出现了问题,还有另一个缓存设备中的数据可以使用,从而大大提升了数据的可靠性。In another embodiment, after receiving the target data sent by the host computer 210, the first controller 221 sends the target data to one of the first cache device 224 and the second cache device 225 for storage. In addition to obtaining the first image data, the first controller 221 may also send the target data to another cache device for storage, thereby obtaining the second image data. At this time, each of the first cache device 224 and the second cache device 225 has a data, and even if there is a problem with the data in one of the cache devices, the data in the other cache device can be used, thereby greatly improving the data. reliability.
如图3所示,在另一实施方式中,第一缓存设备224和第二缓存设备225都可以设置有第一归属区域以及第二归属区域。其中,第一归属区域的属性为:第一控制器221对第一归属区域可进行读取操作和写操作,第二控制器222对第一归属区域可进行读取操作但不能进行写操作。第二归属区域的属性为:第二控制器222对第二归属区域可进行读取操作和写操作,第一控制器221对第二归属区域可进行读取操作但不能进行写操作。所以,上述的第一控制器221接收到目标数据后,第一控制器221将目标数据发送给第一缓存设备224和第二缓存设备225中的一个缓存设备进行存储以获得第一镜像数据具体为:第一控制器221将目标数据发送给第一缓存设备224和第二缓存设备225中的一个缓存设备的第一归属区域进行存储以获得第一镜像数据。如果接收到目标数据 的是第二控制器222,则第二控制器222会将目标数据发送给第一缓存设备224和第二缓存设备225中的一个缓存设备的第二归属区域进行存储以获得第一镜像数据。As shown in FIG. 3, in another embodiment, the first cache device 224 and the second cache device 225 may be configured with a first home zone and a second home zone. The attribute of the first home zone is: the first controller 221 can perform a read operation and a write operation on the first home zone, and the second controller 222 can perform a read operation on the first home zone but cannot perform a write operation. The attribute of the second home zone is that the second controller 222 can perform a read operation and a write operation on the second home zone, and the first controller 221 can perform a read operation on the second home zone but cannot perform a write operation. Therefore, after the first controller 221 receives the target data, the first controller 221 sends the target data to one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data. The first controller 221 sends the target data to the first home area of one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data. If receiving target data The second controller 222 sends the target data to the second home area of one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data.
在另一种实施方式中,当第一控制器221出现故障时,可由第二控制器222读取第一缓存设备224中的第一归属区域以及第二缓存设备225中的第一归属区域中的数据,并存储到存储设备223中;第二控制器222接收到上位机210发送的数据后,可以将上位机210发送的数据发送到第一缓存设备224中的第一归属区域以及第二缓存设备225中第一归属区域进行存储。In another implementation manner, when the first controller 221 fails, the first home area in the first cache device 224 and the first home area in the second cache device 225 may be read by the second controller 222. The data is stored in the storage device 223. After receiving the data sent by the host computer 210, the second controller 222 can send the data sent by the host computer 210 to the first home area and the second in the first cache device 224. The first home zone in the cache device 225 is stored.
此时,即使其中一个控制器发生了故障,另一个控制器也可以接管发生故障的控制器,不会造成上位机210和存储设备223之间不能正常进行读写操作。At this time, even if one of the controllers fails, the other controller can take over the failed controller, and the read/write operation between the host computer 210 and the storage device 223 cannot be performed normally.
当第一控制器221的故障排除了后,或者第一控制器221更换为新的控制器后,第一控制器221可以从第一缓存设备224和/或第二缓存设备225中读取故障前存储的数据,从而快速恢复数据业务。After the fault of the first controller 221 is eliminated, or the first controller 221 is replaced with a new controller, the first controller 221 may read the fault from the first cache device 224 and/or the second cache device 225. Pre-stored data to quickly recover data services.
在另一种实施方式中,如果第一控制器221和第二控制器222都发生故障,当第三控制器替换第一控制器221,第四控制器替换第二控制器222后,第三控制器从第一缓存设备224和/或第二缓存设备225的第一归属区域读取第一控制器221故障前存储的数据,第四控制器从第一缓存设备224和/或第二缓存设备225的第二归属区域读取第二控制器222故障前存储的数据,以恢复数据业务。In another embodiment, if both the first controller 221 and the second controller 222 fail, when the third controller replaces the first controller 221, and the fourth controller replaces the second controller 222, the third The controller reads data stored before the first controller 221 fails from the first home area of the first cache device 224 and/or the second cache device 225, and the fourth controller is from the first cache device 224 and/or the second cache. The second home zone of device 225 reads the data stored prior to the failure of the second controller 222 to recover the data traffic.
参阅图4,为了进一步提高数据的可靠性,可以使得缓存设备400(可以是上述的第一缓存设备,也可以是第二缓存设备)具有掉电保护功能。只有一份镜像数据存储在第一缓存设备或者第二缓存设备时,可以相应地只令第一缓存设备或者第二缓存设备具有掉电保护功能。如果第一缓存设备和第二缓存设备均具有一份镜像数据时,则需要令第一缓存设备和第二缓存设备均具有掉电保护功能。Referring to FIG. 4, in order to further improve the reliability of the data, the cache device 400 (which may be the first cache device or the second cache device described above) may have a power-down protection function. When only one piece of mirror data is stored in the first cache device or the second cache device, the first cache device or the second cache device may be correspondingly provided with a power-down protection function. If both the first cache device and the second cache device have one mirror data, the first cache device and the second cache device need to have the power-down protection function.
为了使缓存设备400具有掉电保护功能,在一种具体的实施方式中,缓存设备400包括控制芯片410、非易失存储器420以及随机存取存储器430,控制芯片410分别连接非易失存储器420以及随机存取存储器430。其中,非易失存储器420的其中一部分存储空间作为第一空间,另一部分存储空间作为第二空间。随机存取存储器430的一部分存储空间作为第一归属区域,一部分空 间作为第二归属区域。In order to enable the cache device 400 to have a power-down protection function, in a specific embodiment, the cache device 400 includes a control chip 410, a non-volatile memory 420, and a random access memory 430. The control chip 410 is connected to the non-volatile memory 420, respectively. And a random access memory 430. The part of the non-volatile memory 420 has a storage space as the first space and another part of the storage space as the second space. A part of the storage space of the random access memory 430 is used as the first home area, and a part of the space is empty. The interval is the second home zone.
当缓存设备400掉电时,控制芯片410从随机存取存储器420的第一归属区域中取出数据,并将从第一归属区域中取出的数据存储到非易失存储器430的第一空间,以及,从随机存取存储器420的第二归属区域中取出数据,并将从第二归属区域取出的数据存储到非易失存储器430的第二空间。When the cache device 400 is powered down, the control chip 410 fetches data from the first home zone of the random access memory 420 and stores the data fetched from the first home zone into the first space of the non-volatile memory 430, and Data is fetched from the second home area of the random access memory 420, and data fetched from the second home area is stored to the second space of the nonvolatile memory 430.
当缓存设备400重新上电后,控制芯片410从非易失存储器430的第一空间取出数据,并将从第一空间取出的数据还原到随机存取存储器420的第一归属区域,以及,从非易失存储器430的第二空间取出数据,并将从第二空间取出的数据还原到随机存取存储器的第二归属区域,以恢复数据业务。After the cache device 400 is powered back on, the control chip 410 fetches data from the first space of the nonvolatile memory 430, and restores the data fetched from the first space to the first home area of the random access memory 420, and The second space of the non-volatile memory 430 fetches data and restores the data fetched from the second space to the second home area of the random access memory to recover the data traffic.
在另一种具体的实施方式中,当缓存设备400掉电时,控制芯片410从随机存取存储器420的第一归属区域中取出数据,为从第一归属区域中取出的数据添加第一标签,并将添加第一标签后的数据存储到非易失存储器430中,以及,从随机存取存储器420的第二归属区域中取出数据,为从第二归属区域中取出的数据添加第二标签,并将添加第二标签后的数据存储到非易失存储器430中。In another specific embodiment, when the cache device 400 is powered off, the control chip 410 fetches data from the first home zone of the random access memory 420, adding a first tag to the data fetched from the first home zone. And storing the data after adding the first label into the non-volatile memory 430, and extracting data from the second home area of the random access memory 420, adding a second label for the data extracted from the second home area And storing the data after adding the second tag into the nonvolatile memory 430.
当缓存设备400重新上电后,控制芯片410从非易失存储器430中取出数据,并将从非易失存储器430中取出数据中标签为第一标签的数据还原到随机存取存储器420的第一归属区域中,将从非易失存储器430中取出数据中标签为第二标签的数据还原到随机存取存储器430的第二归属区域中。After the cache device 400 is powered back on, the control chip 410 retrieves data from the non-volatile memory 430, and restores the data in the data from the non-volatile memory 430 to the first tag to the random access memory 420. In a home zone, the data tagged as the second tag in the data fetched from the non-volatile memory 430 is restored to the second home zone of the random access memory 430.
参阅图5,缓存设备400中的非易失存储器以及随机存取存储器,也可以由磁性随机存储器450代替,磁性随机存储器450既有随机存取存储器存取速度快的特点,又具有非易失存储器掉电保存的特点。Referring to FIG. 5, the nonvolatile memory and the random access memory in the cache device 400 may also be replaced by a magnetic random access memory 450. The magnetic random access memory 450 has both a random access memory access speed and a nonvolatile memory. The feature of memory power-down save.
可以理解的是,上面的实施方式中只以两个控制器和两个缓存设备为例进行说明,在其他的实施方式中,控制器的数量可以为三个或者更多,此时,缓存设备中的归属领域的数量也应相应增加,使得一个控制器对应一个归属领域。而缓存设备的数量也可以为4个或者更多,本发明不作具体限定。It can be understood that, in the above embodiment, only two controllers and two cache devices are used as an example. In other embodiments, the number of controllers may be three or more. In this case, the cache device is used. The number of attribution areas in the field should also increase accordingly, so that one controller corresponds to a home domain. The number of the cache devices may also be four or more, which is not specifically limited in the present invention.
参阅图6,图6是本发明数据存储方法一种可能的实施方式的流程图。本实施方式从如图2所示的存储系统的角度出发来进行描述。请结合图2进行理解,在本实施方式中,数据存储方法包括如下步骤: Referring to Figure 6, Figure 6 is a flow diagram of one possible embodiment of the data storage method of the present invention. This embodiment will be described from the perspective of the storage system shown in FIG. 2. Please understand with reference to FIG. 2, in the embodiment, the data storage method includes the following steps:
510:上位机210将目标数据选择性发送第一控制器221或者第二控制器222。510: The host computer 210 selectively transmits the target data to the first controller 221 or the second controller 222.
上位机210可以选择性向第一控制器221和第二控制器222中的任意一个控制器发送目标数据。由于一个数据不能同时被两个控制器进行处理,所以,在目标数据中设置了目标数据的归属信息,控制器可以根据这个归属信息判断目标数据是否属于自己处理。如果上位机210将目标数据发送给第一控制器221,则进入步骤520;如果上位机210将目标数据发送给第二控制器222,则进入步骤540。The host computer 210 can selectively transmit target data to any one of the first controller 221 and the second controller 222. Since one data cannot be processed by both controllers at the same time, the attribution information of the target data is set in the target data, and the controller can determine whether the target data belongs to itself according to the attribution information. If the host computer 210 transmits the target data to the first controller 221, the process proceeds to step 520; if the host computer 210 transmits the target data to the second controller 222, the process proceeds to step 540.
520:第一控制器221根据目标数据中的归属信息判断目标数据是否属于第一控制器221处理。520: The first controller 221 determines whether the target data belongs to the first controller 221 according to the attribution information in the target data.
第一控制器221在接收到目标数据后,从目标数据中获取归属信息,并根据目标数据信息判断是否属于第一控制器221处理。如果是属于第一控制器221处理,进入步骤530;如果不属于第一控制器221处理,则转发给第二控制器222,并进入步骤540。After receiving the target data, the first controller 221 acquires the home information from the target data, and determines whether it belongs to the first controller 221 according to the target data information. If it belongs to the first controller 221, the process proceeds to step 530; if it does not belong to the first controller 221, it is forwarded to the second controller 222, and proceeds to step 540.
530:第一控制器221将目标数据发送至第一缓存设备224或第二缓存设备225中进行存储以获得第一镜像数据。530: The first controller 221 sends the target data to the first cache device 224 or the second cache device 225 for storage to obtain the first image data.
第一控制器221可以选择将目标数据发送至第一缓存设备224中进行存储以获得第一镜像数据,也可以选择将目标数据发送至第二缓存设备225中进行存储以获得第一镜像数据。在一具体的实施方式中,第一缓存设备224和第二缓存设备225都设置有第一归属区域以及第二归属区域。其中,第一归属区域的属性为:第一控制器221对第一归属区域可进行读取操作和写操作,第二控制器222对第一归属区域可进行读取操作但不能进行写操作。第二归属区域的属性为:第二控制器222对第二归属区域可进行读取操作和写操作,第一控制器221对第二归属区域可进行读取操作但不能进行写操作。所以,第一控制器221将目标数据发送给第一缓存设备224和第二缓存设备225中的一个缓存设备的第一归属区域进行存储以获得第一镜像数据。然后,返回步骤510,直到需要将缓存设备内的数据存储到存储设备223时,进入步骤560。The first controller 221 may select to send the target data to the first cache device 224 for storage to obtain the first mirror data, or may select to send the target data to the second cache device 225 for storage to obtain the first mirror data. In a specific implementation, the first cache device 224 and the second cache device 225 are both provided with a first home zone and a second home zone. The attribute of the first home zone is: the first controller 221 can perform a read operation and a write operation on the first home zone, and the second controller 222 can perform a read operation on the first home zone but cannot perform a write operation. The attribute of the second home zone is that the second controller 222 can perform a read operation and a write operation on the second home zone, and the first controller 221 can perform a read operation on the second home zone but cannot perform a write operation. Therefore, the first controller 221 sends the target data to the first home area of one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data. Then, returning to step 510, until it is necessary to store the data in the cache device to the storage device 223, the process proceeds to step 560.
540:第二控制器222根据目标数据中的归属信息判断目标数据是否属于第二控制器222处理。 540: The second controller 222 determines, according to the attribution information in the target data, whether the target data belongs to the second controller 222 for processing.
第二控制器222在接收到目标数据后,从目标数据中获取归属信息,并根据目标数据信息判断是否属于第二控制器222处理。如果是属于第二控制器222处理,进入步骤550;如果不属于第二控制器222处理,则转发目标数据给第一控制器221,并进入步骤520。After receiving the target data, the second controller 222 acquires the home information from the target data, and determines whether it belongs to the second controller 222 according to the target data information. If it belongs to the second controller 222, the process proceeds to step 550; if it does not belong to the second controller 222, the target data is forwarded to the first controller 221, and the process proceeds to step 520.
550:第二控制器222将目标数据发送至第一缓存设备224或第二缓存设备225中进行存储以获得第一镜像数据。550: The second controller 222 sends the target data to the first cache device 224 or the second cache device 225 for storage to obtain the first image data.
第二控制器222可以选择将目标数据发送至第一缓存设备224中进行存储以获得第一镜像数据,也可以选择将目标数据发送至第二缓存设备225中进行存储以获得第一镜像数据。在一具体的实施方式中,第二控制器222将目标数据发送给第一缓存设备224和第二缓存设备225中的一个缓存设备的第二归属区域进行存储以获得第一镜像数据。然后,返回步骤510,直到需要将缓存设备内的数据存储到存储设备223时,进入步骤560。The second controller 222 may select to send the target data to the first cache device 224 for storage to obtain the first mirror data, or may select to send the target data to the second cache device 225 for storage to obtain the first mirror data. In a specific implementation, the second controller 222 sends the target data to the second home area of one of the first cache device 224 and the second cache device 225 for storage to obtain the first image data. Then, returning to step 510, until it is necessary to store the data in the cache device to the storage device 223, the process proceeds to step 560.
560:第一控制器221以及第二控制器222将第一缓存设备224和第二缓存设备225中的数据存储到存储设备223中。560: The first controller 221 and the second controller 222 store data in the first cache device 224 and the second cache device 225 into the storage device 223.
在需要将缓存设备内的数据存储到存储设备223时,例如,缓存设备中的数据达到阈值,或者上位机210下指令将缓存设备内的数据存储到存储设备223时,第一控制器221会将第一缓存设备224和第二缓存设备225中的由第一控制器221进行处理的数据存储到存储设备223中。第二控制器222也会将第一缓存设备224和第二缓存设备225中的由第二控制器222处理的数据存储到存储设备223中。When the data in the cache device needs to be stored to the storage device 223, for example, when the data in the cache device reaches the threshold, or the host computer 210 instructs to store the data in the cache device to the storage device 223, the first controller 221 The data processed by the first controller 221 in the first cache device 224 and the second cache device 225 is stored in the storage device 223. The second controller 222 also stores the data processed by the second controller 222 in the first cache device 224 and the second cache device 225 into the storage device 223.
可以理解,如果第一缓存设备224发生非毁灭性故障,则第一控制器221以及第二控制器222可以将第一缓存设备224中的数据转移至第二缓存设备225,相反,如果第二缓存设备225发生故障,则第一控制器221以及第二控制器222可以将第二缓存设备225中的数据转移至第一缓存设备224,从而提高了数据的安全性。It can be understood that if the first cache device 224 has a non-destructive failure, the first controller 221 and the second controller 222 can transfer the data in the first cache device 224 to the second cache device 225. Conversely, if the second When the cache device 225 fails, the first controller 221 and the second controller 222 can transfer the data in the second cache device 225 to the first cache device 224, thereby improving the security of the data.
通过实施本发明实施例,能够另外设置缓存设备并将镜像数据存储在缓存设备中,则控制器无需为镜像数据提供存储空间,从而减少对控制器内存大小的要求。而且,镜像数据不需要通过PCIe/IB(nfiniband)通路进行传输,则能减轻PCIe/IB(nfiniband)通路的数据传输的压力。最后,控制器的负荷减 少了,即使其中一个控制器出现问题时,控制器也不会因为负荷太重而被迫将数据直接写入到存储设备中,从而大大提高了数据读写的速度。By implementing the embodiment of the present invention, the cache device can be additionally set and the mirror data is stored in the cache device, so the controller does not need to provide storage space for the mirror data, thereby reducing the requirement on the controller memory size. Moreover, the mirrored data does not need to be transmitted through the PCIe/IB (nfiniband) path, which can alleviate the pressure of data transmission in the PCIe/IB (nfiniband) path. Finally, the load on the controller is reduced. Less, even if one of the controllers has a problem, the controller will not be forced to write data directly to the storage device because the load is too heavy, thus greatly improving the speed of data reading and writing.
而且,第一控制器不能写属于第二控制器可以写的第二归属区域,第二控制器不能写属于第一控制器可以写的第一归属区域,即,第一控制器和第二控制器可以进行写操作的存储空间是互相独立的,可以防止两个不同的控制器同时对同一存储单元进行写操作而造成的冲突。Moreover, the first controller cannot write the second home zone that can be written by the second controller, and the second controller cannot write the first home zone that can be written by the first controller, that is, the first controller and the second controller The storage space that the device can perform write operations is independent of each other, which can prevent conflicts caused by two different controllers simultaneously writing to the same storage unit.
参阅图7,图7是本发明数据存储方法另一种可能的实施方式的流程图。本实施方式从如图2所示的存储系统的角度出发来进行描述。请结合图2进行理解,在本实施方式中,数据存储方法包括如下步骤:Referring to Figure 7, Figure 7 is a flow diagram of another possible implementation of the data storage method of the present invention. This embodiment will be described from the perspective of the storage system shown in FIG. 2. Please understand with reference to FIG. 2, in the embodiment, the data storage method includes the following steps:
610:上位机210将目标数据选择性发送第一控制器221或者第二控制器222。610: The host computer 210 selectively transmits the target data to the first controller 221 or the second controller 222.
上位机210可以选择性向第一控制器221和第二控制器222中的任意一个控制器发送目标数据。由于一个数据不能同时被两个控制器进行处理,所以,在目标数据中设置了目标数据的归属信息,控制器可以根据这个归属信息判断目标数据是否属于自己处理。如果上位机210将目标数据发送给第一控制器221,则进入步骤620;如果上位机210将目标数据发送给第二控制器222,则进入步骤650。The host computer 210 can selectively transmit target data to any one of the first controller 221 and the second controller 222. Since one data cannot be processed by both controllers at the same time, the attribution information of the target data is set in the target data, and the controller can determine whether the target data belongs to itself according to the attribution information. If the host computer 210 transmits the target data to the first controller 221. Then, the process proceeds to step 620. If the host computer 210 transmits the target data to the second controller 222, the process proceeds to step 650.
620:第一控制器221根据目标数据中的归属信息判断目标数据是否属于第一控制器221处理。620: The first controller 221 determines whether the target data belongs to the first controller 221 according to the attribution information in the target data.
第一控制器221在接收到目标数据后,从目标数据中获取归属信息,并根据目标数据信息判断是否属于第一控制器221处理。如果是属于第一控制器221处理,进入步骤630;如果不属于第一控制器221处理,则转发给第二控制器222,并进入步骤640。After receiving the target data, the first controller 221 acquires the home information from the target data, and determines whether it belongs to the first controller 221 according to the target data information. If it belongs to the first controller 221, the process proceeds to step 630; if it does not belong to the first controller 221, it is forwarded to the second controller 222, and proceeds to step 640.
630:第一控制器221将目标数据发送至第一缓存设备224中进行存储以获得第一镜像数据。630: The first controller 221 sends the target data to the first cache device 224 for storage to obtain the first image data.
第一控制器221将目标数据发送至第一缓存设备224中进行存储以获得第一镜像数据。在一具体的实施方式中,第一缓存设备224设置有第一归属区域以及第二归属区域。其中,第一归属区域的属性为:第一控制器221对第一归 属区域可进行读取操作和写操作,第二控制器222对第一归属区域可进行读取操作但不能进行写操作。第二归属区域的属性为:第二控制器222对第二归属区域可进行读取操作和写操作,第一控制器221对第二归属区域可进行读取操作但不能进行写操作。所以,第一控制器221将目标数据发送给第一缓存设备224的第一归属区域进行存储以获得第一镜像数据。The first controller 221 transmits the target data to the first cache device 224 for storage to obtain the first mirror data. In a specific implementation, the first cache device 224 is provided with a first home zone and a second home zone. The attribute of the first home zone is: the first controller 221 is the first home The genus area can perform a read operation and a write operation, and the second controller 222 can perform a read operation on the first home area but cannot perform a write operation. The attribute of the second home zone is that the second controller 222 can perform a read operation and a write operation on the second home zone, and the first controller 221 can perform a read operation on the second home zone but cannot perform a write operation. Therefore, the first controller 221 transmits the target data to the first home area of the first cache device 224 for storage to obtain the first image data.
640:第一控制器221将目标数据发送至第二缓存设备225中进行存储以获得第二镜像数据。640: The first controller 221 sends the target data to the second cache device 225 for storage to obtain the second image data.
第一控制器221将目标数据发送至第二缓存设备225中进行存储以获得第二镜像数据。在一具体的实施方式中,第一控制器221将目标数据发送给第二缓存设备225的第一归属区域进行存储以获得第二镜像数据。然后,返回步骤610,直到需要将缓存设备内的数据存储到存储设备223时,进入步骤680。The first controller 221 transmits the target data to the second cache device 225 for storage to obtain second mirror data. In a specific embodiment, the first controller 221 sends the target data to the first home area of the second cache device 225 for storage to obtain the second image data. Then, returning to step 610, until it is necessary to store the data in the cache device to the storage device 223, the process proceeds to step 680.
650:第二控制器222根据目标数据中的归属信息判断目标数据是否属于第二控制器222处理。650: The second controller 222 determines, according to the attribution information in the target data, whether the target data belongs to the second controller 222 for processing.
第二控制器222在接收到目标数据后,从目标数据中获取归属信息,并根据目标数据信息判断是否属于第二控制器222处理。如果是属于第二控制器222处理,进入步骤660;如果不属于第二控制器222处理,则转发目标数据给第一控制器221,并进入步骤620。After receiving the target data, the second controller 222 acquires the home information from the target data, and determines whether it belongs to the second controller 222 according to the target data information. If it belongs to the second controller 222, the process proceeds to step 660; if it does not belong to the second controller 222, the target data is forwarded to the first controller 221, and the process proceeds to step 620.
660:第二控制器222将目标数据发送至第一缓存设备224中进行存储以获得第一镜像数据。660: The second controller 222 sends the target data to the first cache device 224 for storage to obtain the first image data.
第二控制器222将目标数据发送至第一缓存设备224中进行存储以获得第一镜像数据。在一具体的实施方式中,第二控制器222将目标数据发送给第一缓存设备224的第二归属区域进行存储以获得第一镜像数据。The second controller 222 sends the target data to the first cache device 224 for storage to obtain the first image data. In a specific embodiment, the second controller 222 sends the target data to the second home area of the first cache device 224 for storage to obtain the first image data.
670:第二控制器222将目标数据发送至第二缓存设备225中进行存储以获得第二镜像数据。670: The second controller 222 sends the target data to the second cache device 225 for storage to obtain the second image data.
第二控制器222将目标数据发送至第二缓存设备225中进行存储以获得第二镜像数据。在一具体的实施方式中,第二控制器222将目标数据发送给第二缓存设备225的第二归属区域进行存储以获得第二镜像数据。然后,返回步骤610,直到需要将缓存设备内的数据存储到存储设备223时,进入步骤680。The second controller 222 transmits the target data to the second cache device 225 for storage to obtain second mirror data. In a specific implementation, the second controller 222 sends the target data to the second home area of the second cache device 225 for storage to obtain the second image data. Then, returning to step 610, until it is necessary to store the data in the cache device to the storage device 223, the process proceeds to step 680.
680:第一控制器221以及第二控制器222将第一缓存设备224和第二缓 存设备225中的数据存储到存储设备223中。680: The first controller 221 and the second controller 222 will use the first cache device 224 and the second buffer The data in the storage device 225 is stored in the storage device 223.
在需要将缓存设备内的数据存储到存储设备223时,例如,缓存设备中的数据达到阈值,或者上位机210下指令将缓存设备内的数据存储到存储设备223时,第一控制器221会将第一缓存设备224和第二缓存设备225中的由第一控制器221进行处理的数据存储到存储设备223中。第二控制器222也会将第一缓存设备224和第二缓存设备225中的由第二控制器222处理的数据存储到存储设备223中。When the data in the cache device needs to be stored to the storage device 223, for example, when the data in the cache device reaches the threshold, or the host computer 210 instructs to store the data in the cache device to the storage device 223, the first controller 221 The data processed by the first controller 221 in the first cache device 224 and the second cache device 225 is stored in the storage device 223. The second controller 222 also stores the data processed by the second controller 222 in the first cache device 224 and the second cache device 225 into the storage device 223.
在本实施方式中,第一控制器221接收到上位机210所发送的目标数据后,除了将目标数据发送至第一缓存设备224进行存储以获得第一镜像数据外,第一控制器221还可以将目标数据发送至第二缓存设备225中进行存储,从而得到第二镜像数据。此时,第一缓存设备224和第二缓存设备225中各有一份数据,即使其中一个缓存设备中的数据出现了问题,还有另一个缓存设备中的数据可以使用,从而大大提升了数据的可靠性。In this embodiment, after receiving the target data sent by the host computer 210, the first controller 221 sends the target data to the first cache device 224 for storage to obtain the first image data, and the first controller 221 further The target data may be sent to the second cache device 225 for storage to obtain second mirror data. At this time, each of the first cache device 224 and the second cache device 225 has a data, and even if there is a problem with the data in one of the cache devices, the data in the other cache device can be used, thereby greatly improving the data. reliability.
当第一控制器221出现故障时,可由第二控制器222读取第一缓存设备224中的第一归属区域以及第二缓存设备225中的第一归属区域中的数据,并存储到存储设备223中;第二控制器222接收到上位机210发送的数据后,可以将上位机210发送的数据发送到第一缓存设备224中的第一归属区域以及第二缓存设备225中第一归属区域进行存储。When the first controller 221 fails, the data in the first home zone of the first cache device 224 and the first home zone in the second cache device 225 may be read by the second controller 222 and stored in the storage device. After receiving the data sent by the host computer 210, the second controller 222 may send the data sent by the host computer 210 to the first home zone in the first cache device 224 and the first home zone in the second cache device 225. Store.
此时,即使其中一个控制器发生了故障,另一个控制器也可以接管发生故障的控制器,不会造成上位机210和存储设备223之间不能正常进行读写操作。At this time, even if one of the controllers fails, the other controller can take over the failed controller, and the read/write operation between the host computer 210 and the storage device 223 cannot be performed normally.
当第一控制器221的故障排除了后,或者第一控制器221更换为新的控制器后,第一控制器221可以从第一缓存设备224和/或第二缓存设备225中读取故障前存储的数据,从而快速恢复数据业务。After the fault of the first controller 221 is eliminated, or the first controller 221 is replaced with a new controller, the first controller 221 may read the fault from the first cache device 224 and/or the second cache device 225. Pre-stored data to quickly recover data services.
可以理解的是,如果第一控制器221和第二控制器222都发生故障,当第三控制器替换第一控制器221,第四控制器替换第二控制器222后,第三控制器从第一缓存设备224和/或第二缓存设备225的第一归属区域读取第一控制器221故障前存储的数据,第四控制器从第一缓存设备224和/或第二缓存设备225的第二归属区域读取第二控制器222故障前存储的数据,以恢复数据业务。It can be understood that if both the first controller 221 and the second controller 222 fail, when the third controller replaces the first controller 221 and the fourth controller replaces the second controller 222, the third controller The first home area of the first cache device 224 and/or the second cache device 225 reads data stored before the first controller 221 fails, and the fourth controller is from the first cache device 224 and/or the second cache device 225 The second home zone reads data stored before the second controller 222 fails to recover the data traffic.
参阅图4,为了进一步提高数据的可靠性,可以使得缓存设备400(可以是上述的第一缓存设备,也可以是第二缓存设备)具有掉电保护功能。只有一 份镜像数据存储在第一缓存设备或者第二缓存设备时,可以相应地只令第一缓存设备或者第二缓存设备具有掉电保护功能。如果第一缓存设备和第二缓存设备均具有一份镜像数据时,则需要令第一缓存设备和第二缓存设备均具有掉电保护功能。Referring to FIG. 4, in order to further improve the reliability of the data, the cache device 400 (which may be the first cache device or the second cache device described above) may have a power-down protection function. just one When the mirrored data is stored in the first cache device or the second cache device, the first cache device or the second cache device may be correspondingly provided with a power-down protection function. If both the first cache device and the second cache device have one mirror data, the first cache device and the second cache device need to have the power-down protection function.
为了使缓存设备400具有掉电保护功能,在一种具体的实施方式中,缓存设备400包括控制芯片410、非易失存储器420以及随机存取存储器430,控制芯片410分别连接非易失存储器420以及随机存取存储器430。其中,非易失存储器420的其中一部分存储空间作为第一空间,另一部分存储空间作为第二空间。随机存取存储器430的一部分存储空间作为第一归属区域,一部分空间作为第二归属区域。In order to enable the cache device 400 to have a power-down protection function, in a specific embodiment, the cache device 400 includes a control chip 410, a non-volatile memory 420, and a random access memory 430. The control chip 410 is connected to the non-volatile memory 420, respectively. And a random access memory 430. The part of the non-volatile memory 420 has a storage space as the first space and another part of the storage space as the second space. A part of the storage space of the random access memory 430 is used as the first home area, and a part of the space is used as the second home area.
当缓存设备400掉电时,控制芯片410从随机存取存储器420的第一归属区域中取出数据,并将从第一归属区域中取出的数据存储到非易失存储器430的第一空间,以及,从随机存取存储器420的第二归属区域中取出数据,并将从第二归属区域取出的数据存储到非易失存储器430的第二空间。When the cache device 400 is powered down, the control chip 410 fetches data from the first home zone of the random access memory 420 and stores the data fetched from the first home zone into the first space of the non-volatile memory 430, and Data is fetched from the second home area of the random access memory 420, and data fetched from the second home area is stored to the second space of the nonvolatile memory 430.
当缓存设备400重新上电后,控制芯片410从非易失存储器430的第一空间取出数据,并将从第一空间取出的数据还原到随机存取存储器420的第一归属区域,以及,从非易失存储器430的第二空间取出数据,并将从第二空间取出的数据还原到随机存取存储器的第二归属区域,以恢复数据业务。After the cache device 400 is powered back on, the control chip 410 fetches data from the first space of the nonvolatile memory 430, and restores the data fetched from the first space to the first home area of the random access memory 420, and The second space of the non-volatile memory 430 fetches data and restores the data fetched from the second space to the second home area of the random access memory to recover the data traffic.
在另一种具体的实施方式中,当缓存设备400掉电时,控制芯片410从随机存取存储器420的第一归属区域中取出数据,为从第一归属区域中取出的数据添加第一标签,并将添加第一标签后的数据存储到非易失存储器430中,以及,从随机存取存储器420的第二归属区域中取出数据,为从第二归属区域中取出的数据添加第二标签,并将添加第二标签后的数据存储到非易失存储器430中。In another specific embodiment, when the cache device 400 is powered off, the control chip 410 fetches data from the first home zone of the random access memory 420, adding a first tag to the data fetched from the first home zone. And storing the data after adding the first label into the non-volatile memory 430, and extracting data from the second home area of the random access memory 420, adding a second label for the data extracted from the second home area And storing the data after adding the second tag into the nonvolatile memory 430.
当缓存设备400重新上电后,控制芯片410从非易失存储器430中取出数据,并将从非易失存储器430中取出数据中标签为第一标签的数据还原到随机存取存储器420的第一归属区域中,将从非易失存储器430中取出数据中标签为第二标签的数据还原到随机存取存储器430的第二归属区域中。After the cache device 400 is powered back on, the control chip 410 retrieves data from the non-volatile memory 430, and restores the data in the data from the non-volatile memory 430 to the first tag to the random access memory 420. In a home zone, the data tagged as the second tag in the data fetched from the non-volatile memory 430 is restored to the second home zone of the random access memory 430.
参阅图5,缓存设备400中的非易失存储器以及随机存取存储器,也可以由磁性随机存储器450代替,磁性随机存储器450既有随机存取存储器存取速 度快的特点,又具有非易失存储器掉电保存的特点。Referring to FIG. 5, the nonvolatile memory and the random access memory in the cache device 400 may also be replaced by a magnetic random access memory 450, which has both random access memory access speeds. The characteristics of fast speed, and the characteristics of non-volatile memory power-down preservation.
可以理解的是,上面的实施方式中只以两个控制器和两个缓存设备为例进行说明,在其他的实施方式中,控制器的数量可以为三个或者更多,此时,缓存设备中的归属领域的数量也应相应增加,使得一个控制器对应一个归属领域。而缓存设备的数量也可以为4个或者更多,本发明不作具体限定。It can be understood that, in the above embodiment, only two controllers and two cache devices are used as an example. In other embodiments, the number of controllers may be three or more. In this case, the cache device is used. The number of attribution areas in the field should also increase accordingly, so that one controller corresponds to a home domain. The number of the cache devices may also be four or more, which is not specifically limited in the present invention.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。One of ordinary skill in the art can understand that all or part of the process of implementing the foregoing embodiments can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所揭露的仅为本发明一种较佳实施例而已,当然不能以此来限定本发明之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本发明权利要求所作的等同变化,仍属于发明所涵盖的范围。 The above disclosure is only a preferred embodiment of the present invention, and of course, the scope of the present invention is not limited thereto, and those skilled in the art can understand all or part of the process of implementing the above embodiments, and according to the present invention. The equivalent changes required are still within the scope of the invention.

Claims (10)

  1. 一种数据存储方法,其特征在于,包括:包含至少第一控制器以及第二控制器在内的至少两个控制器、存储设备以及包含第一缓存设备以及第二缓存设备在内的至少两个缓存设备,所述第一控制器用于与上位机进行通信,所述第一控制器还分别连接所述存储设备、所述第一缓存设备以及所述第二缓存设备,所述第二控制器用于与上位机进行通信,所述第二控制器还分别连接所述存储设备、所述第一缓存设备以及所述第二缓存设备,所述第一控制器连接所述第二控制器,所述第一缓存设备中设置有第一归属区域以及第二归属区域,所述第二缓存设备中设置有第一归属区域以及第二归属区域,A data storage method, comprising: at least two controllers including at least a first controller and a second controller, a storage device, and at least two devices including a first cache device and a second cache device a cache device, the first controller is configured to communicate with the upper computer, and the first controller is further connected to the storage device, the first cache device, and the second cache device, respectively, the second control The second controller is further configured to connect to the storage device, the first cache device, and the second cache device, where the first controller is connected to the second controller, The first cache area is provided with a first home area and a second home area, and the second cache device is provided with a first home area and a second home area.
    所述第一归属区域的属性为:所述第一控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作和写操作,所述第二控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作但不能进行写操作,The attribute of the first home zone is that the first controller can perform a read operation and a write operation on the first home zone in the first cache device and the first home zone in the second cache device. The second controller can perform a read operation on the first home zone in the first cache device and the first home zone in the second cache device, but cannot perform a write operation.
    所述第二归属区域的属性为:所述第二控制器对所述第一缓存设备中的第二归属区域以及所述第二缓存设备中的第二归属区域可进行读取操作和写操作,所述第一控制器对所述第一缓存设备中的第二归属区域以及所述第二缓存设备中的第二归属区域可进行读取操作但不能进行写操作;The attribute of the second home zone is: the second controller can perform a read operation and a write operation on the second home zone in the first cache device and the second home zone in the second cache device. The first controller can perform a read operation on the second home area in the first cache device and the second home area in the second cache device, but cannot perform a write operation;
    所述第一控制器接收所述上位机所发送的目标数据;The first controller receives target data sent by the upper computer;
    所述第一控制器根据所述目标数据中的归属信息判断所述目标数据是否属于所述第一控制器处理;Determining, by the first controller, whether the target data belongs to the first controller according to the attribution information in the target data;
    如果否,则所述第一控制器将所述目标数据转发至所述第二控制器,如果是,则所述第一控制器将所述目标数据发送至所述第一缓存设备或所述第二缓存设备中的第一归属区域进行存储以获得第一镜像数据;If not, the first controller forwards the target data to the second controller, and if yes, the first controller sends the target data to the first cache device or the The first home area in the second cache device is stored to obtain first image data;
    在需要将缓存设备内的数据存储到所述存储设备时,所述第一控制器将所述第一缓存设备和所述第二缓存设备的第一归属区域中的包含所述目标数据在内的由所述第一控制器处理之后的数据存储到所述存储设备中。When the data in the cache device needs to be stored in the storage device, the first controller includes the target data in the first home area of the first cache device and the second cache device The data processed by the first controller is stored in the storage device.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    如果所述第一缓存设备发生故障,则所述第一控制器以及所述第二控 制器将所述第一缓存设备中的数据转移至所述第二缓存设备。If the first cache device fails, the first controller and the second controller The controller transfers data in the first cache device to the second cache device.
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    如果所述第一控制器将所述目标数据发送给所述第一缓存设备以获得所述第一镜像数据,则所述第一控制器还将所述目标数据发送给所述第二缓存设备以获得所述第二镜像数据。And if the first controller sends the target data to the first cache device to obtain the first mirror data, the first controller further sends the target data to the second cache device Obtaining the second image data.
  4. 根据权利要求1至3任一权利要求所述的方法,其特征在于,当所述第一控制器出现故障时,所述第二控制器修改所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域的属性为:所述第二控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作和写操作,The method according to any one of claims 1 to 3, wherein when the first controller fails, the second controller modifies a first home zone in the first cache device and The attribute of the first home zone in the second cache device is: the second controller may perform the first home zone in the first cache device and the first home zone in the second cache device. Read and write operations,
    所述第二控制器读取所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域中的数据,并存储到所述存储设备中;The second controller reads data in the first home area of the first cache device and the first home area in the second cache device, and stores the data in the storage device;
    所述第二控制器接收到上位机发送的数据后,可以将上位机发送的数据发送到所述第一缓存设备中的第一归属区域以及所述第二缓存设备中第一归属区域进行存储。After receiving the data sent by the upper computer, the second controller may send the data sent by the upper computer to the first home area in the first cache device and the first home area in the second cache device for storage. .
  5. 根据权利要求1至3任一权利要求所述的方法,其特征在于,如果所述第一控制器和所述第二控制器发生故障,当第三控制器替换所述第一控制器,第四控制器替换所述第二控制器后,所述第三控制器从所述第一缓存设备中的第一归属区域和/或所述第二缓存设备中的第一归属区域读取所述第一控制器存储的数据,所述第四控制器从所述第一缓存设备中的第二归属区域和/或所述第二缓存设备中的第二归属区域读取所述第二控制器存储的数据,以恢复数据业务。The method according to any one of claims 1 to 3, wherein if the first controller and the second controller fail, when the third controller replaces the first controller, After the fourth controller replaces the second controller, the third controller reads the first local area from the first cache device and/or the first one of the second cache devices Data stored by the first controller, the fourth controller reads the second controller from a second home zone in the first cache device and/or a second home zone in the second cache device Store data to recover data traffic.
  6. 一种存储系统,其特征在于,包括:包含至少第一控制器以及第二控制器在内的至少两个控制器、存储设备以及包含第一缓存设备以及第二缓存设备在内的至少两个缓存设备,所述第一控制器用于与上位机进行通信,所述第一控制器还分别连接所述存储设备、所述第一缓存设备以及所述第二缓存设备,所述第二控制器用于与上位机进行通信,所述第二控制器还分别连接所述存储设备、所述第一缓存设备以及所述第二缓存设备,所述第一控制器连接所述第二控制器,所述第一缓存设备中设置有第一归 属区域以及第二归属区域,所述第二缓存设备中设置有第一归属区域以及第二归属区域,A storage system, comprising: at least two controllers including at least a first controller and a second controller, a storage device, and at least two devices including a first cache device and a second cache device a cache device, the first controller is configured to communicate with a host computer, and the first controller is further connected to the storage device, the first cache device, and the second cache device, respectively, where the second controller is configured And communicating with the upper computer, the second controller is further connected to the storage device, the first cache device, and the second cache device, where the first controller is connected to the second controller. The first cache is set in the first cache device a second home area and a second home area, wherein the second cache device is provided with a first home area and a second home area,
    所述第一归属区域的属性为:所述第一控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作和写操作,所述第二控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作但不能进行写操作,The attribute of the first home zone is that the first controller can perform a read operation and a write operation on the first home zone in the first cache device and the first home zone in the second cache device. The second controller can perform a read operation on the first home zone in the first cache device and the first home zone in the second cache device, but cannot perform a write operation.
    所述第二归属区域的属性为:所述第二控制器对所述第一缓存设备中的第二归属区域以及所述第二缓存设备中的第二归属区域可进行读取操作和写操作,所述第一控制器对所述第一缓存设备中的第二归属区域以及所述第二缓存设备中的第二归属区域可进行读取操作但不能进行写操作;The attribute of the second home zone is: the second controller can perform a read operation and a write operation on the second home zone in the first cache device and the second home zone in the second cache device. The first controller can perform a read operation on the second home area in the first cache device and the second home area in the second cache device, but cannot perform a write operation;
    所述第一控制器用于接收所述上位机所发送的目标数据;The first controller is configured to receive target data sent by the upper computer;
    所述第一控制器用于根据所述目标数据中的归属信息判断所述目标数据是否属于所述第一控制器处理,在判断结果为否时,将所述目标数据转发至所述第二控制器,在判断结果为是时,将所述目标数据发送至所述第一缓存设备或所述第二缓存设备中的第一归属区域进行存储以获得第一镜像数据;The first controller is configured to determine, according to the attribution information in the target data, whether the target data belongs to the first controller, and if the determination result is no, forwarding the target data to the second control And sending the target data to the first cache area of the first cache device or the second cache device for storage to obtain first mirror data;
    所述第一控制器还用于在需要将数据从缓存设备存储到所述存储设备时,将所述第一缓存设备和所述第二缓存设备的第一归属区域中的包含所述目标数据在内的由所述第一控制器处理之后的数据存储到所述存储设备中。The first controller is further configured to: when the data needs to be stored from the cache device to the storage device, include the target data in the first home area of the first cache device and the second cache device The data processed by the first controller is stored in the storage device.
  7. 根据权利要求6所述的系统,其特征在于,The system of claim 6 wherein:
    所述第一控制器以及所述第二控制器用于在所述第一缓存设备发生故障时,将所述第一缓存设备中的数据转移至所述第二缓存设备。The first controller and the second controller are configured to transfer data in the first cache device to the second cache device when the first cache device fails.
  8. 根据权利要求6所述的系统,其特征在于,The system of claim 6 wherein:
    所述第一控制器还用于在所述第一控制器将所述目标数据发送给所述第一缓存设备以获得所述第一镜像数据时,将所述目标数据发送给所述第二缓存设备以获得所述第二镜像数据。The first controller is further configured to send the target data to the second when the first controller sends the target data to the first cache device to obtain the first mirror data. The cache device obtains the second image data.
  9. 根据权利要求6至8任一权利要求所述的系统,其特征在于,当所述第一控制器出现故障时,所述第二控制器修改所述第一缓存设备中的第 一归属区域以及所述第二缓存设备中的第一归属区域的属性为:所述第二控制器对所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域可进行读取操作和写操作,The system according to any one of claims 6 to 8, wherein when the first controller fails, the second controller modifies the first of the first cache devices An attribute of the first home area and the first one of the second cache devices is: the second controller is the first one of the first cache devices and the first one of the second cache devices The home area can be read and written.
    所述第二控制器用于读取所述第一缓存设备中的第一归属区域以及所述第二缓存设备中的第一归属区域中的数据,并存储到所述存储设备中;The second controller is configured to read data in the first home area of the first cache device and the first home area in the second cache device, and store the data in the storage device;
    所述第二控制器还用于接收到上位机发送的数据后,可以将上位机发送的数据发送到所述第一缓存设备中的第一归属区域以及所述第二缓存设备中第一归属区域进行存储。The second controller is further configured to: after receiving the data sent by the upper computer, send the data sent by the upper computer to the first home zone in the first cache device and the first home in the second cache device The area is stored.
  10. 根据权利要求6至8任一权利要求所述的系统,其特征在于,在所述第一控制器和所述第二控制器发生故障,当第三控制器替换所述第一控制器,第四控制器替换所述第二控制器后,The system according to any one of claims 6 to 8, wherein a failure occurs in the first controller and the second controller, and when the third controller replaces the first controller, After the four controllers replace the second controller,
    所述第三控制器用于从所述第一缓存设备中的第一归属区域和/或所述第二缓存设备中的第一归属区域读取所述第一控制器存储的数据;The third controller is configured to read data stored by the first controller from a first home zone in the first cache device and/or a first home zone in the second cache device;
    所述第四控制器用于从所述第一缓存设备中的第二归属区域和/或所述第二缓存设备中的第二归属区域读取所述第二控制器存储的数据,以恢复数据业务。 The fourth controller is configured to read data stored by the second controller from a second home zone in the first cache device and/or a second home zone in the second cache device to recover data business.
PCT/CN2016/092333 2015-08-07 2016-07-29 Data storage method and system WO2017024951A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510478475.6 2015-08-07
CN201510478475.6A CN106445840B (en) 2015-08-07 2015-08-07 Date storage method and storage system

Publications (1)

Publication Number Publication Date
WO2017024951A1 true WO2017024951A1 (en) 2017-02-16

Family

ID=57984058

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/092333 WO2017024951A1 (en) 2015-08-07 2016-07-29 Data storage method and system

Country Status (2)

Country Link
CN (2) CN106445840B (en)
WO (1) WO2017024951A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928495B (en) * 2019-11-12 2023-09-22 杭州宏杉科技股份有限公司 Data processing method and device on multi-control storage system
US11722436B2 (en) * 2021-08-24 2023-08-08 International Business Machines Corporation Transport control word architecture for physical port mirroring

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354633A (en) * 2008-08-22 2009-01-28 杭州华三通信技术有限公司 Method for improving writing efficiency of virtual storage system and virtual storage system thereof
CN101840309A (en) * 2009-10-28 2010-09-22 创新科存储技术有限公司 Access control method and system of double control disk array in multipath environment
CN102081584A (en) * 2009-11-30 2011-06-01 英业达股份有限公司 Cache mirror system and method of dual-controller storage system
WO2015054897A1 (en) * 2013-10-18 2015-04-23 华为技术有限公司 Data storage method, data storage apparatus, and storage device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2439691C2 (en) * 2005-04-20 2012-01-10 Акссана (Израэль) Лтд. Method of data protection
US20090132765A1 (en) * 2007-11-21 2009-05-21 Inventec Corporation Dual controller storage apparatus and cache memory mirror method thereof
US10061534B2 (en) * 2011-12-01 2018-08-28 Intel Corporation Hardware based memory migration and resilvering
WO2012126425A2 (en) * 2012-05-18 2012-09-27 华为技术有限公司 Data storage system and method
CN104461935B (en) * 2014-11-27 2018-03-13 华为技术有限公司 A kind of method, apparatus and system for carrying out data storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354633A (en) * 2008-08-22 2009-01-28 杭州华三通信技术有限公司 Method for improving writing efficiency of virtual storage system and virtual storage system thereof
CN101840309A (en) * 2009-10-28 2010-09-22 创新科存储技术有限公司 Access control method and system of double control disk array in multipath environment
CN102081584A (en) * 2009-11-30 2011-06-01 英业达股份有限公司 Cache mirror system and method of dual-controller storage system
WO2015054897A1 (en) * 2013-10-18 2015-04-23 华为技术有限公司 Data storage method, data storage apparatus, and storage device

Also Published As

Publication number Publication date
CN106445840B (en) 2019-03-01
CN109783401B (en) 2023-11-10
CN109783401A (en) 2019-05-21
CN106445840A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
US9003114B2 (en) Methods and apparatus for cut-through cache management for a mirrored virtual volume of a virtualized storage system
US10671498B2 (en) Method and apparatus for redundancy in active-active cluster system
CN100581172C (en) Method for accessing object magnetic dish and system for extensing disk content
US9081910B2 (en) Methods and structure for fast context switching among a plurality of expanders in a serial attached SCSI domain
WO2019047579A1 (en) Data access method and apparatus
US10795785B2 (en) Failover method, apparatus and system
US7143176B2 (en) Data communication with a protocol that supports a given logical address range
US9690665B2 (en) Relay device, relay method, computer-readable recoding medium having stored therein relay program, and relay system
US20130007368A1 (en) Methods and systems for improved miorroring of data between storage controllers using bidirectional communications
WO2017024951A1 (en) Data storage method and system
US9229654B2 (en) Input/output request shipping in a storage system with multiple storage controllers
US8868806B2 (en) Methods and structure for hardware management of serial advanced technology attachment (SATA) DMA Non-Zero Offsets in a serial attached SCSI (SAS) expander
US8055939B2 (en) Memory control device and methods thereof
CN107911372B (en) Method and device for realizing access of serial device to Ethernet based on logic device
CN112947869A (en) Solid state disk and write operation method
US20150244612A1 (en) Relaying apparatus and storage apparatus
US9129068B2 (en) Methods and structure for buffering host requests in serial attached SCSI expanders
CN104683153B (en) A kind of active and standby MPU control method of cluster routers and its system
US9170959B2 (en) Method and device for configuring storage system connection
US10671549B2 (en) Memory system
US8898506B2 (en) Methods and structure for hardware serial advanced technology attachment (SATA) error recovery in a serial attached SCSI (SAS) expander
JP2001236250A (en) Device and method for data transition
US20150006781A1 (en) Switch and control method
US10628059B2 (en) Storage system, connection controller, and storage control program
US20210294765A1 (en) Method and system for controlling data response with aid of attribute of transaction identifier

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16834575

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16834575

Country of ref document: EP

Kind code of ref document: A1