CN107133132B - Data sending method, data receiving method and storage device - Google Patents

Data sending method, data receiving method and storage device Download PDF

Info

Publication number
CN107133132B
CN107133132B CN201710215599.4A CN201710215599A CN107133132B CN 107133132 B CN107133132 B CN 107133132B CN 201710215599 A CN201710215599 A CN 201710215599A CN 107133132 B CN107133132 B CN 107133132B
Authority
CN
China
Prior art keywords
data
storage device
written
current time
time slice
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710215599.4A
Other languages
Chinese (zh)
Other versions
CN107133132A (en
Inventor
欧阳戟
邹冶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from PCT/CN2013/080203 external-priority patent/WO2015010327A1/en
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN107133132A publication Critical patent/CN107133132A/en
Application granted granted Critical
Publication of CN107133132B publication Critical patent/CN107133132B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2094Redundant storage or storage space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2097Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements maintaining the standby controller/processing unit updated

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a data sending method, a data receiving method and a storage device, wherein the data sending method, the data receiving method and the storage device comprise the following steps: a first storage device receives a first data writing request sent by a host, wherein the first data writing request carries data to be written and address information; adding a first number to the data to be written and the address information, and writing the data to be written and the address information into a cache, wherein the first number is the current time slice number; reading the data to be written and the address information corresponding to the first number from the cache; modifying the current time slice number to identify information carried by a subsequent write data request; and sending the data to be written and the address information to a second storage device. The efficiency of data replication can be improved.

Description

Data sending method, data receiving method and storage device
The present application claims priority of international patent application with application number PCT/CN2013/080203, international patent application entitled "data sending method, data receiving method and storage device" filed in 26/7/2013, which is incorporated by reference in its entirety.
Technical Field
The present invention relates to a storage technology, and in particular, to a data sending method, a data receiving method, and a storage device.
Background
Data disaster recovery, also known as remote data replication technology, refers to the establishment of a data system in a remote location that is an available replica of local data. When the local data and the whole application system have disasters, the system at least stores a piece of available data of key services in different places.
A typical data disaster recovery system includes a production center and a disaster recovery center. In the production center, a host and a storage array are deployed for normal service operation; in the disaster recovery center, a host and a storage array are deployed and used for taking over the services of the production center after a disaster occurs in the production center. The storage arrays of the production center or the disaster recovery center both comprise a plurality of data volumes, and the data volumes are a section of logical storage space formed by mapping physical storage spaces. After data generated by the business of the production center is written into the production array, the data can be copied to the disaster recovery backup center through the disaster recovery link and written into the disaster recovery backup array. In order to ensure that the data in the disaster recovery center can support the service takeover after the disaster occurs, the data copied to the disaster recovery array must ensure consistency (consistency). Ensuring data consistency essentially refers to a write data request with dependencies that need to be guaranteed. Applications, operating systems, databases all inherently rely on the logic of such dependencies of write data requests to run their services, such as: the order is fixed by completing write data request 1 first and then completing write data request 2. That is, the system ensures that write data request 1 returns a complete success before issuing write data request 2. Therefore, the method can recover the service by means of an inherent method when the execution process is interrupted due to the fault. Otherwise, situations may arise, such as: when data is read, the data stored in the write data request 2 can be read, but the data stored in the write data request 1 cannot be read, which results in that the service cannot be recovered.
In the prior art, this problem can be solved using snapshot techniques. A snapshot is an image of data at some point in time (the point in time at which copying begins). The purpose of the snapshot is to create a state view for the data volume at a particular point in time, through which only the data of the data volume at the time of creation can be seen, after which point the modifications of the data volume (with new data writes) are not reflected in the snapshot view. With this snapshot view, a copy of the data can be made. For the production center, because the snapshot data is "static", the production center can copy the snapshot data to the disaster recovery center after adding snapshots to the data at each time point, which can complete remote data copy and does not affect the continuous execution of the write data request in the production center. For disaster recovery centers, the requirement of data consistency can be met. For example, the data of write data request 2 is successfully copied to the disaster recovery center, the data of write data request 1 is not successfully copied, and the snapshot data before write data request 2 can be used to restore the data of the disaster recovery center to the previous state.
Because the production center needs to perform snapshot processing when executing the data writing request and stores the generated snapshot data in the data volume dedicated for storing the snapshot data, when the production center copies the snapshot data to the disaster recovery center, the production center needs to first read the snapshot data stored in the data volume to the cache and then send the snapshot data to the disaster recovery center. However, the data used for generating the snapshot data may still exist in the cache, but this part of data cannot be reasonably utilized, and each replication needs to first come in the data volume to read the snapshot data, which results in a long time for data replication and low efficiency.
Disclosure of Invention
The embodiment of the invention provides a data sending method, which can directly send information carried by a data writing request from a cache of a first storage device to a second storage device, and improves the efficiency of data copying.
A first aspect of an embodiment of the present invention provides a data sending method, including:
a first storage device receives a first data writing request sent by a host, wherein the first data writing request carries data to be written and address information;
adding a first number to the data to be written and the address information, and writing the data to be written and the address information into a cache, wherein the first number is the current time slice number;
reading the data to be written and the address information corresponding to the first number from the cache;
modifying the current time slice number to identify information carried by a subsequent write data request;
and sending the data to be written and the address information to a second storage device.
In a first possible implementation manner of the first aspect of the embodiment of the present invention, the first number is used to identify a current replication task; the method further comprises the following steps:
and recording a second number, wherein the second number is a number corresponding to a copy task which is completed last time before the current copy task.
With reference to the first implementation manner of the first aspect of the embodiment of the present invention, a second possible implementation manner of the first aspect further includes:
after reading the second number from the cache, the data to be written and the address information corresponding to the number before the first number are written;
and sending the data to be written and the address information corresponding to the number before the first number after the second number to the second storage device.
A third possible implementation manner of the first aspect of the embodiment of the present invention further includes: and recording the current time slice number, wherein the current time slice number is used for generating the first number.
A second aspect of the embodiments of the present invention provides a data receiving method, including:
the second storage device receives the address information sent by the first storage device;
when the first storage device is determined to be in fault, the second storage device obtains data to be written corresponding to a first number according to the address information, the address information corresponding to the first number is the same as the received address information, and the first number is a number before the current time slice number;
and adding a second number to the data to be written and the address information corresponding to the first number, and writing the data to be written and the address information into a cache.
In a first possible implementation manner of the second aspect of the embodiment of the present invention, the method further includes: and recording the current time slice number, wherein the current time slice number is used for generating the second number.
In a second possible implementation manner of the second aspect of the embodiment of the present invention, the method further includes:
receiving a data reading request sent by a host, wherein the data reading request comprises the received address information;
determining that the latest number corresponding to the received address information is the second number;
and sending the data to be written corresponding to the second number to the host.
A third aspect of an embodiment of the present invention provides a storage device, including:
the receiving module is used for receiving a first data writing request sent by a host, wherein the first data writing request carries data to be written and address information;
the read-write module is used for adding a first number to the data to be written and the address information and writing the data to be written and the address information into a cache, wherein the first number is the current time slice number; reading the data to be written and the address information corresponding to the first number from the cache;
the current time slice number manager is used for modifying the current time slice number so as to mark information carried by a subsequent data writing request;
and the sending module is used for sending the data to be written and the address information to the second storage device.
In a first possible implementation manner of the third aspect of the embodiment of the present invention, the first number is used to identify a current replication task;
the current time slice number manager is further configured to record a second number, where the second number is a number corresponding to a copy task that has been completed last time before the current copy task.
With reference to the first implementation manner of the third aspect of the embodiment of the present invention, in a second possible implementation manner of the third aspect: the read-write module is further configured to read, from the cache, to-be-written data and address information corresponding to a number before the first number after the second number is read;
the sending module is further configured to send the data to be written and the address information corresponding to the number after the second number and before the first number to the second storage device.
In a third possible implementation manner of the third aspect of the embodiment of the present invention, the current time slice number manager is further configured to record a current time slice number, where the current time slice number is used to generate the first number.
A fourth aspect of an embodiment of the present invention provides a storage device, including:
the receiving module is used for receiving the address information sent by the first storage device;
the searching module is configured to, when it is determined that the first storage device is in a failure, obtain, by the second storage device, to-be-written data corresponding to a first number according to the address information, where the address information corresponding to the first number is the same as the received address information, and the first number is a number before a current time slice number;
and the writing module is used for adding a second number to the data to be written and the address information corresponding to the first number and writing the data to be written and the address information into the cache.
In a first possible implementation manner of the fourth aspect of the embodiment of the present invention, the method further includes:
and the current time slice number manager is used for recording the current time slice number, and the current time slice number is used for generating the second number.
In a second possible implementation manner of the fourth aspect of the embodiment of the present invention, the receiving module is further configured to receive a read data request sent by a host, where the read data request includes the received address information;
the searching module is further configured to determine that the latest number corresponding to the received address information is the second number;
the storage device further comprises a sending module, and the sending module is used for sending the data to be written corresponding to the second number to the host.
A fifth aspect of an embodiment of the present invention provides a storage device, including: a processor, a memory, and a communication bus;
wherein the processor and the memory communicate over the communication bus;
the memory is used for storing programs;
the processor is configured to execute the program to implement:
receiving a first data writing request sent by a host, wherein the first data writing request carries data to be written and address information; adding a first number to the data to be written and the address information, and writing the data to be written and the address information into a cache, wherein the first number is the current time slice number; reading the data to be written and the address information corresponding to the first number from the cache; modifying the current time slice number to identify information carried by a subsequent write data request; and sending the data to be written and the address information to a second storage device.
In a first possible implementation manner of the fifth aspect of the embodiment of the present invention, the first number is used to identify a current replication task; the processor is further configured to:
and recording a second number, wherein the second number is a number corresponding to a copy task which is completed last time before the current copy task.
With reference to the first implementation manner of the fifth aspect of the embodiment of the present invention, in a second possible implementation manner of the fifth aspect, the processor is further configured to: after reading the second number from the cache, the data to be written and the address information corresponding to the number before the first number are written; and sending the data to be written and the address information corresponding to the number before the first number after the second number to the second storage device.
In a third possible implementation manner of the fifth aspect of the embodiment of the present invention, the processor is further configured to: and recording the current time slice number, wherein the current time slice number is used for generating the first number.
A sixth aspect of an embodiment of the present invention provides a storage device, including: a processor, a memory, and a communication bus;
wherein the processor and the memory communicate over the communication bus;
the memory is used for storing programs;
the processor is configured to execute the program to implement:
receiving address information sent by first storage equipment;
when the first storage device is determined to be in fault, the second storage device obtains data to be written corresponding to a first number according to the address information, the address information corresponding to the first number is the same as the received address information, and the first number is a number before the current time slice number;
and adding a second number to the data to be written and the address information corresponding to the first number, and writing the data to be written and the address information into a cache.
In a first possible implementation manner of the sixth aspect of the embodiment of the present invention, the processor is further configured to record the current time slice number, where the current time slice number is used to generate the second number.
In a second possible implementation manner of the sixth aspect of the embodiment of the present invention, the processor is further configured to receive a read data request sent by a host, where the read data request includes the received address information; determining that the latest number corresponding to the received address information is the second number; and sending the data to be written corresponding to the second number to the host.
A seventh aspect of the embodiments of the present invention provides a data replication method, including:
when the current replication task is triggered, the first storage device reads the current time slice number;
reading a second number, wherein the second number is a number which is associated with the current replication task and corresponds to a replication task which is completed last time;
determining a first number according to the current time slice number and the second number, wherein the first number is a number before the current time slice number when the current replication task is triggered, and the first number is a number after the second number;
and copying the data to be copied and the address information of the data to be copied, which are stored in the cache corresponding to the first number, to a second storage device.
In a first implementation manner of the seventh aspect of the embodiment of the present invention, a replication task associated with the current replication task refers to a replication task that belongs to a replication relationship with the current replication task;
when the current replication task is triggered, the method further comprises the following steps: receiving an identifier corresponding to the replication relationship;
the reading the second number includes:
and reading the second number according to the identification.
In a second implementation manner of the seventh aspect of the embodiment of the present invention, before the triggering of the current replication task, the method further includes:
receiving a first write data request, wherein the first write data request comprises the data to be copied and address information of the data to be copied;
and adding the first number in the data to be copied and the address information of the data to be copied, and writing the first number into the cache, wherein the first number is a historical time slice number.
With reference to the second implementation manner of the seventh aspect of the embodiment of the present invention, in a third implementation manner of the seventh aspect of the embodiment of the present invention, the current time slice number is modified from the historical time slice number.
An eighth aspect of the embodiments of the present invention provides a storage device, including:
the read-write module is used for reading the serial number of the current time slice when the current replication task is triggered; reading a second number, wherein the second number is a number which is associated with the current replication task and corresponds to a replication task which is completed last time;
a determining module, configured to determine a first number according to the current time slice number and the second number, where the first number is a number before the current time slice number when the current replication task is triggered, and the first number is a number after the second number;
and the copying module is used for copying the data to be copied stored in the cache corresponding to the first number and the address information of the data to be copied to a second storage device.
In a first implementation manner of the eighth aspect of the embodiment of the present invention, a replication task associated with the current replication task refers to a replication task that belongs to a replication relationship with the current replication task;
the storage device further includes: a receiving module;
the receiving module is used for receiving the identifier corresponding to the replication relationship;
and the read-write module is specifically used for reading the second number according to the identifier.
In a second implementation manner of the eighth aspect of the embodiment of the present invention, the receiving module is further configured to receive a first write data request before the current replication task is triggered, where the first write data request includes the data to be replicated and address information of the data to be replicated;
the read-write module is further configured to: and adding the first number in the data to be copied and the address information of the data to be copied, and writing the first number into the cache, wherein the first number is a historical time slice number.
With reference to the second implementation manner of the eighth aspect of the embodiment of the present invention, in a third implementation manner of the eighth aspect of the embodiment of the present invention, the current time slice number is modified from the historical time slice number.
A ninth aspect of an embodiment of the present invention provides a storage device, including: a processor, a memory, and a communication bus;
wherein the processor and the memory communicate over the communication bus;
the memory is used for storing programs;
the processor is configured to execute the program to implement: embodiment of the invention the method as described in any of the embodiments of the seventh aspect.
In the embodiment of the invention, after a first storage device receives a write data request sent by a host, information carried by the write data request comprises data to be written and address information, a first number is added in the data to be written and the address information, the data to be written and the address information are written into a cache, the first number is a current time slice number, when a replication task is triggered, the data to be written and the address information corresponding to the first number are read from the cache and sent to a second storage device, in addition, when the replication task is triggered, the current time slice number is modified, so that when the first storage device receives the write data request subsequently, the number which is the same as the modified current time slice number is added in the information carried by the first storage device, and therefore, the information carried by the write data request which needs to be sent to the second storage device is distinguished from the information carried by the write data request which is being received by the first storage device in the cache, the method and the device have the advantages that the information carried by the data writing request is directly sent to the second storage device from the cache, and the data is not required to be read from the data volume because the information is directly sent from the cache, so that the data copying time is short, and the data copying efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic diagram of an application network architecture of a data transmission method according to an embodiment of the present invention;
fig. 2 is a flowchart of a data transmission method according to an embodiment of the present invention;
fig. 3 is a flowchart of a data receiving method according to an embodiment of the present invention;
fig. 4 is a signaling diagram of a data transmission method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a storage device according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another storage device according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of another memory device according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of another memory device according to an embodiment of the present invention;
fig. 9 is a schematic diagram of an application network architecture of a data replication method according to an embodiment of the present invention;
FIG. 10 is a flowchart of a data replication method according to an embodiment of the present invention;
FIG. 11 is a schematic structural diagram of another memory device according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of another storage device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The data transmission method provided by the embodiment of the invention can be realized in the storage device. Fig. 1 is a schematic diagram of a system architecture of a data transmission method according to an embodiment of the present invention, and as shown in fig. 1, a production center includes a production host, a connection device, and a production array (corresponding to a first storage device in the following embodiment); the system architecture of the disaster recovery center is similar to that of the production center, and includes a disaster recovery host, a connection device, and a disaster recovery array (corresponding to the second storage device in the following embodiments). In the embodiment of the invention, more than one disaster recovery center can be provided. The production center and the disaster recovery center can transmit data through ip (internet protocol) or fc (fiber channel). A control center can be arranged between the production center and the disaster recovery center, and the control center can be deployed at the side of the production center, can also be deployed at the side of the disaster recovery center, and can also be deployed in third-party equipment between the production center and the disaster recovery center. And the control center is used for sending a signal to the disaster recovery array to take over the host service of the production array processing when the production array fails.
The production host and disaster recovery host may each be any computing device known in the art, such as a server, desktop computer, etc. Inside the host, an operating system and other application programs are installed.
The connection device may comprise any interface between a storage device and a host known in the art, such as a fabric switch, or other existing switch.
Both the production array and the disaster array may be Storage devices known in the art, such as Redundant array Of independent Disks (RAID), Just a Bunch Of Disks (JBOD), one or more interconnected disk drives Of Direct Access Storage Device (DASD), such as a tape library, a tape Storage Device Of one or more Storage units.
The storage space of the production array may include a plurality of data volumes, where a data volume is a segment of logical storage space mapped by a physical storage space, and for example, a data volume may be a Logical Unit Number (LUN) or a file system. In the embodiment of the invention, the disaster recovery array is similar in structure to the production array.
Referring to fig. 1, fig. 1 is a diagram of an embodiment of a data transmission method according to the present invention, where the embodiment of the present invention is applied to a first storage device, where the first storage device includes a controller, a cache (hereinafter referred to as a cache or cache), and a storage medium. The controller is a processor of the first storage device and is used for executing IO commands and other data services; the cache is a memory existing between the controller and the hard disk, and has a smaller capacity but a much higher speed than the hard disk; the storage medium is a main memory of the first storage device, and is usually referred to as a nonvolatile storage medium, for example, a magnetic disk. It may be the controller in the first storage device that performs the following steps.
Step S101: the method comprises the steps that first storage equipment receives a first data writing request sent by a host, wherein the first data writing request carries data to be written and address information.
The Address information may include a Logical Block Address (LBA), and when the first storage device includes a plurality of data volumes, the Address information may further include an ID of the data volume of the first storage device.
Step S102: and adding a first number to the data to be written and the address information, and writing the data to be written and the address information into a cache, wherein the first number is the current time slice number.
The first storage device may include a current time slice number manager, where the current time slice number manager stores the current time slice number, and the current time slice number may be represented by a numerical value, such as 0, 1, or 2, or may be represented by a letter, such as a, b, or c, which is not limited herein.
When a first data writing request is received, adding a first number in data to be written and address information carried by the first data writing request, wherein the first number is assigned to the first data writing request by a current time slice number.
After a first number is added to the information carried by the first data writing request, the modified information carried by the first data writing request is written into the cache, so that the data to be written, the address information and the first number carried by the first data writing request are all stored in the cache.
In addition, in a period of time, other data writing requests can be received, and the first number needs to be added to the information carried by the data writing requests and written into the cache. It should be noted that before the current time slice number is changed, the first number is added to the information carried in the write data request.
Step S103: and reading the data to be written and the address information corresponding to the first number from the cache.
When the copy task is triggered, the first storage device may read the data to be written and the address information corresponding to the first number from the cache, and it may be understood that there may be more than one data to be written and address information corresponding to the first number.
The replication task means that the first storage device sends information carried by the write data request received by one data volume in a period of time to the second storage device, and the information carried by the write data request is added with the same number as the current time slice number. The copy task trigger may be triggered by a timer or may be triggered manually, and is not limited herein. The purpose of the copying is to send data to be written carried by a write data request received by the first storage device to the second storage device for storage, so that when the first storage device fails, the second storage device can take over the work of the first storage device. It can be understood that address information (e.g. LBA) carried by the write data request also needs to be sent to the second storage device, where the LBA is used to indicate an address where the second storage device stores data to be written. Since the second storage device has the same physical structure as the first storage device, the LBA applied to the first storage device is also applied to the second storage device.
In this embodiment of the present invention, the replication task is for one data volume of the first storage device, and when the first storage device includes a plurality of data volumes, one replication task corresponds to each data volume.
Step S104: and modifying the current time slice number to identify information carried by a subsequent data writing request.
When a replication task is triggered, the current time slice number manager needs to modify the current time slice number, when a subsequent write data request is received, information carried by the subsequent write data request needs to be added with another number, and the other number is assigned to the current time slice number after modification. Therefore, the information carried by the write data request which needs to be sent to the second storage device can be distinguished from the information carried by the write data request which is received by the first storage device in the cache.
It should be noted that, there is no precedence order between step S103 and step S104.
Step S105: and sending the data to be written and the address information to a second storage device.
And the first storage equipment sends the data to be written and the address information corresponding to the first number read from the cache to the second equipment.
Specifically, the first storage device may directly send all read data to be written and address information to the second storage device; or after the ID of the data volume of the second storage device is obtained, new write data requests may be generated according to the data to be written and the address information carried in each write data request and the ID of the data volume of the second storage device, and then sent to the second storage device.
In the embodiment of the invention, after a first storage device receives a write data request sent by a host, information carried by the write data request comprises data to be written and address information, a first number is added in the data to be written and the address information, the data to be written and the address information are written into a cache, the first number is a current time slice number, when a replication task is triggered, the data to be written and the address information corresponding to the first number are read from the cache and sent to a second storage device, in addition, when the replication task is triggered, the current time slice number is modified, so that when the first storage device receives the write data request subsequently, the number which is the same as the modified current time slice number is added in the information carried by the first storage device, and therefore, the information carried by the write data request which needs to be sent to the second storage device is distinguished from the information carried by the write data request which is being received by the first storage device in the cache, the method and the device have the advantages that the information carried by the data writing request is directly sent to the second storage device from the cache, and the data is not required to be read from the data volume because the information is directly sent from the cache, so that the data copying time is short, and the data copying efficiency is improved.
It can be understood that, in the above embodiment, when the copy task is triggered, the first storage device sends the data to be written and the address information corresponding to the current time slice number to the second storage device, and modifies the current time slice number to identify information carried in a subsequent data writing request. And when the next replication task is triggered, sending the data to be written and the address information corresponding to the modified current time slice number to the second storage device, and simultaneously modifying the current time slice number again. The first storage device can be ensured to completely send the information carried by the received write data request to the second storage device in batches.
However, when there are multiple disaster recovery centers, assuming that the storage device corresponding to the second disaster recovery center is the third device, the first storage device needs to send the information carried in the received write data request to the third storage device. For the second storage device, when the replication task is triggered, the current time slice number manager modifies the current time slice number, and at this time, the numbers assigned to the second storage device and the third storage device by the current time slice number are modified numbers. However, the data-carrying information of the write data request corresponding to the number before the current time slice number is modified is not sent to the third storage device.
Therefore, for a scenario with multiple disaster recovery centers, the above embodiment may further include the following steps:
step S106: and recording a second number, wherein the second number is a number corresponding to a copy task which is completed last time before the current copy task.
In the foregoing embodiment, the first number is the same as the current time slice number and may be used to identify a current replication task, where the current replication task refers to that the first storage device sends information carried by a write data request received by one data volume in a current time period to the second storage device, and the information carried by the write data request is added with the number that is the same as the current time slice number.
The second number is a number corresponding to a copy task that has been completed last before the current copy task.
When a plurality of disaster recovery centers exist, the current time slice number may be modified when a copy task is initiated to the storage devices of other disaster recovery centers, and therefore, the number corresponding to the copy task that has been completed last time needs to be recorded.
If other numbers exist between the second number and the first number, the information carried by the write data request corresponding to the number is not sent to the second storage device, and step S107 needs to be executed.
Step S107: and after the second number is read from the cache, the data to be written and the address information which correspond to the number before the first number are written.
The specific reading process is similar to step S103, and is not described herein again.
It should be noted that step S107 may not be in sequence with step S103, or may be executed simultaneously.
Step S108: and sending the data to be written and the address information corresponding to the number before the first number after the second number to the second storage device.
The specific sending process is similar to step S105, and is not described here again.
In the embodiment of the invention, besides sending the information carried by the write data request corresponding to the current time slice number to the second storage device, the number corresponding to the copy task completed last time and the information carried by the write data request corresponding to the number between the current time slice numbers can be sent to the second storage device, so that the method and the device are suitable for scenes of a plurality of disaster recovery centers, and the integrity of data copy is ensured.
Referring to fig. 2, fig. 2 is an embodiment of a data receiving method according to the present invention, and the embodiment of the present invention is used in an application scenario where a disaster recovery center receives information carried in a write data request sent by a production center. The method may include:
step S201: and the second storage device receives the address information sent by the first storage device.
Specifically, the second storage device may receive data to be written and address information sent by the first storage device; a write data request sent by the first storage device may also be received, where the write data request includes data to be written and Address information, and the Address information may be a Logical Block Address (LBA). When the second storage device includes a plurality of data volumes, the address information may further include IDs of the data volumes of the second storage device. It is understood that there may be more than one piece of address information.
After receiving the data to be written and the address information, the second storage device adds the number which is the same as the number of the current time slice in the data to be written and the address information, and writes the data to be written and the address information into the cache, so that the number which is the same as the number of the current time slice, the data to be written and the address information are stored in the cache.
It should be noted that, the second storage device also includes a current time slice number manager, where the current time slice number manager stores the current time slice number, and the current time slice number may be represented by a numerical value, such as 0, 1, or 2, or may be represented by a letter, such as a, b, or c, which is not limited herein. The current time slice number here may not be linked to the current time slice number in the first storage device.
Step S202: and when the first storage device is determined to be in fault, the second storage device acquires the data to be written corresponding to a first number according to the address information, wherein the address information corresponding to the first number is the same as the received address information, and the first number is the number before the current time slice number.
In general, if the first storage device and the second storage device both operate normally, the first storage device sends information carried by how many write data requests, and the second storage device can receive the information carried by how many write data requests, and adds a number that is the same as the current time slice number to the information carried by each write data request, and stores the information in the cache. However, if the first storage device fails, the second storage device may only receive the data to be written in the corresponding part of the current time slice number of the first storage device, in this case, the data stored by the second storage device may be unreal data, and if the first storage device is directly taken over, the data consistency cannot be guaranteed. For example, if the host sends a read data request to the second storage device at this time to request to read the data stored in the address information, the second storage device searches for the latest number corresponding to the address information, and then sends the to-be-written data corresponding to the current time slice number to the host, but the data is not authentic. Therefore, at this time, the data in the buffer memory of the second storage device needs to be restored to the data corresponding to the number before the current time slice number of the second storage device.
Specifically, the manner of determining that the first storage device fails may be that the control center sends a signal to the second storage device, where the signal is used to indicate that the first storage device fails, and the second storage device needs to take over the first storage device to process the host service.
In general, when a replication task is completed, the control center may send an indication of successful replication to the first storage device and the second storage device, respectively. If the second storage device does not receive the indication, then the current replication task is not complete. The completion of the replication task means that the first storage device sends information carried by all the write data requests corresponding to the current time slice number to the second storage device, and the second storage device also completes receiving.
When the second storage device determines that the first storage device fails, if the current replication task is completed, the second storage device can directly take over the work of the first storage device, and the data consistency can be ensured. This is not the case in the discussion of the embodiments of the present invention.
However, if the current copy task is not completed, the data in the cache of the second storage device needs to be restored to the data corresponding to the number before the current time slice number.
The specific recovery method may be that, according to the received address information, whether there is address information that is the same as the address information is searched for in the address information corresponding to the last number of the current time slice number, if not, the address information corresponding to the last number is searched for continuously until the address information is found, and then the data to be written corresponding to the number is obtained.
Step S203: and adding a second number to the data to be written and the address information corresponding to the first number, and writing the data to be written and the address information into a cache.
The second number is a number obtained by modifying the current time slice number, and is also the latest number stored in the cache in this embodiment. When the host sends a read data request to the second storage device and requires to read the data stored in the address information, the second storage device finds out that the latest number corresponding to the address information is the second number through searching, and sends the data to be written corresponding to the second number to the host. Thus, data consistency is guaranteed.
In the embodiment of the invention, the second storage device receives the address information sent by the first storage device, when the first storage device fails, the data to be written corresponding to the number before the current time slice number is obtained according to the address information, and the data to be written and the address information corresponding to the number before the current time slice number are added with the second number and stored in the cache. Thus, data consistency is guaranteed.
Referring to fig. 3, fig. 3 is a diagram of an embodiment of a data transmission method according to the present invention, in the embodiment of the present invention, in order to distinguish a cache in a production array from a cache in a disaster recovery array, in the embodiment of the present invention, the cache in the production array is referred to as a first cache, and the cache in the disaster recovery array is referred to as a second cache.
As shown in fig. 3, the method includes:
step S301: the production array receives a write data request A sent by the production host.
The write data request a includes a volume ID, a to-be-written address a and a to-be-written data a, where the to-be-written address a refers to a logical address, such as an LBA, of a production array to which the to-be-written data a is to be written, and in a general case, the production array needs to convert the LBA into a PBA (physics Block address) when executing the write data request a, and then writes the to-be-written data a into a storage medium according to the PBA. The volume ID is the ID of the data volume corresponding to the write data request a. In this embodiment, for example, the production array includes a volume (hereinafter referred to as a primary volume), and the information carried by the write data request a includes a primary volume ID, an address a to be written, and data a to be written.
Step S302: the production array modifies the write data request A into a write data request A ', and the write data request A' contains the information carried by the write data request A and a first number.
In this embodiment of the present invention, the controller of the production array may include a Current Time Period Number (CTPN) manager, where the CTPN manager records a Current Time slice Number, and the Current Time slice Number is used to generate a first Number, and specifically, the first Number is equal to the Current Time slice Number.
After the production array receives the write data request A, the write data request A is modified into a write data request A'. Specifically, the modification manner may be to add a first number to the information carried in the write data request a, for example, the current time slice number may be 1, and then the first number is also 1.
Optionally, when the write data request a is received, a timestamp may be recorded, and the timestamp may be matched in a pre-stored numbering sequence, so as to determine a number corresponding to the timestamp. Specifically, the numbering sequence may be a mapping table or other forms, and is not limited herein. The number sequence includes a plurality of numbers, each number corresponding to a time stamp interval. As shown in table 1:
Figure BDA0001262177540000111
Figure BDA0001262177540000121
TABLE 1
Taking the example that the timestamp of receiving the write data request a is 9:30, and the corresponding number is 1, the write data request a may be modified into a write data request a' according to the number.
Step S303: and the production array writes the write data request A 'into a first cache, so that the information carried by the write data request A' is stored in the first cache. The information carried by the data writing request A' includes a first number, a primary volume ID, an address A to be written, and data A to be written.
In the embodiment of the present invention, there may be a plurality of write data requests corresponding to the first number. Before the current time slice number recorded in the CTPN manager is modified, the first number is added to the information carried by all the received write data requests.
It can be understood that after receiving the write data request a, a write data request B may also be received, and the write data request B is modified into a write data request B ', so that the write data request B' further includes the first number; the data writing method can also receive a data writing request C, and modify the data writing request C into a data writing request C ', so that the data writing request C' also contains the first number.
For example, after writing the write data request a ', the write data request B ', and the write data request C ' into the first cache, the stored information in the first cache may be as shown in table 2:
numbering Volume ID To-be-written address Data to be written
1 Primary volume ID To-be-written address A Data A to be written
1 Primary volume ID To-be-written address B Data B to be written
1 Primary volume ID To-be-written address C Data C to be written
TABLE 2
It should be noted that, in the embodiment of the present invention, for example, a production array includes one data volume (may be referred to as a primary volume), and IDs of the data volumes carried by the write data request a ', the write data request B ', and the write data request C ' are all primary volume IDs. In another embodiment of the present invention, the production array may contain a plurality of data volumes, so the IDs of the data volumes carried by the write data request a, the write data request B, and the write data request C may be different. In addition, table 2 is only one example of a form in which information carried in the write data request is stored in the first cache, and may also be stored in a tree form, which is not limited herein.
Taking table 2 as an example, the number, the volume ID, and the address to be written may be regarded as the index of table 2, and the corresponding data to be written may be found according to the index, and when the indexes are the same, the corresponding data to be written should also be the same. Therefore, when a new write data request is written, it is necessary to determine whether the first cache stores the information that is the same as the number, volume ID, and address to be written of the new write data request, and if so, the original information is overwritten with the information carried by the new write data request. It can be understood that, when writing the write data request a ', the write data request B', and the write data request C 'into the first cache, it is also necessary to determine whether the number, the volume ID, and the address to be written are the same as the information already stored in the first cache, and because they are different, the write data request a', the write data request B ', and the write data request C' can all be written into the first cache.
For example, if a write data request D is received at this time, the write data request D includes the primary volume ID, the address B to be written, and the data D to be written, the write data request D is modified into a write data request D ', so that the write data request D' also includes the first number. Then, when the data writing request D ' is written into the first cache, it needs to be determined whether the first cache stores the information that is the same as the number, the volume ID, and the address to be written of the data writing request D ', and if so, the original information is covered with the data carried by the data writing request D '. Since the number, the volume ID, and the address to be written carried in the write data request D 'are all the same as the number, the volume ID, and the address to be written contained in the write data request B', in the first cache, the information of the write data request D 'will overwrite the information of the write data request B'.
Specifically, after the write data request D' is written into the first cache, the information stored in the first cache may be as shown in table 3:
numbering Volume ID To-be-written address Data to be written
1 Primary volume ID To-be-written address A Data A to be written
1 Primary volume ID To-be-written address B Data D to be written
1 Primary volume ID To-be-written address C Data C to be written
TABLE 3
Step S304: when the copying task is triggered, the production array modifies the current time slice number contained in the CTPN manager; for example, the current time slice number may be modified from 1 to 2.
In order to distinguish the current time slice number of the production array from the current time slice number of the disaster recovery array, in the embodiment of the present invention, the current time slice number of the production array is referred to as a first current time slice number, and the current time slice number of the disaster recovery array is referred to as a second current time slice number.
It is understood that, after the first current time slice number is modified from 1 to 2, the information carried by the write data request received thereafter is added with the number 2 accordingly. For example, a write data request E is received, where the write data request E includes a primary volume ID, an address a to be written, and data E to be written, and the write data request E is modified into a write data request E ', so that the write data request E' further includes a number 2; receiving a write data request F, wherein the write data request F comprises a master volume ID, an address F to be written and data F to be written, and modifying the write data request F into a write data request F ', so that the write data request F' also comprises a number 2. After writing the write data request E 'and the write data request F' into the first cache, the information held in the first cache may be as shown in table 4:
numbering Volume ID To-be-written address Data to be written
1 Primary volume ID To-be-written address A Data A to be written
1 Primary volume ID To-be-written address B Data D to be written
1 Primary volume ID To-be-written address C Data C to be written
2 Primary volume ID To-be-written address A Data E to be written
2 Primary volume ID To-be-written address F Data F to be written
TABLE 4
Step S305: the disaster recovery array modifies the serial number of a second current time slice contained in the CTPN manager of the disaster recovery array; for example, the number of the channels can be modified from 11 to 12.
In the embodiment of the present invention, the disaster recovery array may also include its own CTPN manager. When the replication task of the production array is triggered, the CTPN manager in the production array modifies the first current time slice number, and at this time, the control center may also send a control signal to the disaster recovery array, so that the disaster recovery array also modifies the second current time slice number included in its own CTPN manager. Therefore, there is no priority between step S305 and step S304.
Step S306A: and the production array reads the information carried by the write data request corresponding to the first number from the first cache.
Specifically, as can be seen from the above description, the information carried by the write data request corresponding to the first number is shown in table 3.
Step S306B: the production array obtains the ID of the data volume to be written into the disaster recovery array;
step S306C: the production array generates a new data writing request according to the ID of the data volume and the information carried by the data writing request corresponding to the first number;
specifically, a write data request a ″ may be generated according to the ID of the data volume, the address a to be written, and the data a to be written; a write data request D' can be generated according to the ID of the data volume, the address B to be written and the data D to be written; the write data request C ″ may be generated from the ID of the data volume, the address C to be written, and the data C to be written.
In another embodiment of the present invention, the production array and the disaster recovery array may each include a plurality of data volumes, and the IDs of the data volumes included in the write data request a ", the write data request D", and the write data request C "may not be the same. However, the ID of each data volume in the disaster recovery array is in one-to-one correspondence with the ID of each data volume in the production array.
Step S307: and the production array sends the generated new data writing request to the disaster recovery array.
Specifically, the production array sends a write data request a ", a write data request D", and a write data request C "to the disaster recovery array.
Step S308: the disaster recovery array modifies the received write data request.
For example, the write data request a "may be modified to a write data request a'" according to the second current time slice number recorded in the CTPN manager. Specifically, the modification may be to add the number 12 to the information carried in the write data request a ".
Similarly, a number 12 can be added to the information carried by the data writing request B ″ to modify the data writing request B ″ into a data writing request B'; adding a number 12 in the information carried by the data writing request C ' and modifying the data writing request C ' into a data writing request C '.
Step S309: and the disaster recovery array writes the modified data writing request into the second cache.
Specifically, the information stored in the second cache may be as shown in table 5:
numbering Volume ID To-be-written address Data to be written
12 Slave volume ID To-be-written address A Data A to be written
12 Slave volume ID To-be-written address B Data D to be written
12 Slave volume ID To-be-written address C Data C to be written
TABLE 5
Step S310: and the disaster recovery array writes the data to be written into the storage medium corresponding to the address to be written according to the address to be written of the data writing request.
Generally, since the space of the cache is limited, when the space utilization rate reaches a certain threshold, the data in the cache needs to be written into the hard disk. Specifically, the data a to be written is written into the storage medium corresponding to the address a to be written, the data D to be written is written into the storage medium corresponding to the address B to be written, and the data C to be written is written into the storage medium corresponding to the address C to be written.
Step S311: and the production array writes the data to be written into the storage medium corresponding to the address to be written according to the address to be written of the data writing request.
Similarly, when the space utilization of the cache of the production array reaches a certain threshold, the data in the cache also needs to be written into the hard disk. As can be seen from the above description, the following information is stored in the first cache at this time:
Figure BDA0001262177540000141
Figure BDA0001262177540000151
specifically, for the write data requests with the same volume ID, the same address to be written, and different numbers, the data to be written carried by the write data request with the smaller number may be written first, and then the data to be written carried by the write data request with the larger number may be written, for example, the data D to be written is written first, and then the data E to be written is written; or directly writing the data to be written carried by the data writing request with the larger number, but not writing the data to be written carried by the data writing request with the smaller number, for example, directly writing the data to be written E.
There is no precedence between step S310 and step S311.
Step S312: when the replication task is triggered, the production array modifies a first current time slice number contained in a CTPN manager of the production array; for example, the current time slice number may be modified from 2 to 3.
It will be understood that when the first current slot number in the CTPN manager of the production array is modified from 2 to 3, the number 3 is added to the information carried in the write data request received from the production array accordingly.
Step S313: the disaster recovery array modifies the serial number of a second current time slice contained in the CTPN manager of the disaster recovery array; for example, the second current slot number may be modified from 12 to 13.
It can be understood that, after the second current time slice number in the CTPN manager of the disaster recovery array is modified from 12 to 13, the number 13 is added to the information carried by the write data request received by the disaster recovery array accordingly.
Step S314: and generating information carried by the data writing request corresponding to the array reading number 2, generating a corresponding data writing request and sending the data writing request to the disaster recovery array.
Specifically, as can be seen from the above description, the information carried by the write data request corresponding to number 2 includes the information carried by the write data request E and the information carried by the write data request F. Similarly, after obtaining the ID of the data volume of the disaster recovery array, the production array may generate a write data request E ″ according to the ID of the data volume, the address a to be written, and the data E to be written; the write data request F ″ may be generated from the ID of the data volume, the address F to be written, and the data F to be written. Therefore, the write data requests sent by the production array to the disaster recovery array are write data request E "and write data request F".
It should be noted that, in the embodiment of the present invention, when the production array sends the write data request to the disaster recovery array, the data request is not divided according to the sequence, and may be sent randomly, specifically, the write data request E ″ may be sent first, and then the write data request F ″ may be sent; the write data request F "may be sent first, and then the write data request E" may be sent.
As can be seen from the above description, at this time, the second current time slice number in the CTPN manager of the disaster recovery array is 13, so that the disaster recovery array needs to modify the write data request E "into the write data request E'" containing the number 13 after receiving the write data request E "; similarly, after receiving the write data request F ", the disaster recovery array needs to modify the write data request F" into a write data request F' "containing the number 13.
And step S315, the disaster recovery array receives the indication to take over the host service of the production array processing.
In the embodiment of the invention, if the production array fails, the disaster recovery array needs to take over the production array to process the host service, so that the disaster recovery array needs to meet the requirement of data consistency.
As shown in step S314, in the current replication task, the write data requests that the disaster recovery array needs to receive include a write data request E "and a write data request F". When the data writing request E 'and the data writing request F' are both successfully written into the second cache after being modified, the disaster recovery array starts to take over the production array to process the host service, which indicates that the current replication cycle is completed and has the requirement of data consistency.
If the production array fails and the disaster recovery array starts to take over the host service of the production array processing after the data writing request E ' is modified into the data writing request E ' and is successfully written into the second cache and before the data writing request F ' is successfully written into the second cache, the current replication task is not completed and the requirement of data consistency is not met. Similarly, if the disaster recovery array fails to complete the current replication task and does not meet the requirement of data consistency if the production array starts to take over the host service of the production array after the data writing request F ″ is modified into the data writing request F '″ and is successfully written into the second cache and before the data writing request E' ″ is successfully written into the second cache, and the production array fails.
At this time, the data in the cache of the disaster recovery array needs to be restored to the state when the copy task corresponding to number 12 is completed. In the following, the example that the disaster recovery array modifies the write data request E ″ into the write data request E ' ″ and successfully writes the write data request E ' ″ into the second cache, but the write data request F ' ″ is not successfully written into the second cache is taken as an example.
Step S316: and the disaster recovery array acquires a to-be-written address carried by a write data request which is successfully written into the second cache in the current replication cycle.
As can be seen from the above description, in the replication task corresponding to the number 13, the write data request E '″ has been successfully written into the second cache, and the address to be written carried by the write data request E' ″ is the address a to be written.
Step S317: and the disaster recovery array matches the information carried by the write data request corresponding to the last serial number according to the address to be written, and finds the address to be written which is the same as the address A to be written.
When the address to be written, which is the same as the address to be written, is found, step S318 is executed; if not, continuing to match the information carried by the write data request corresponding to the previous number (for example, the number 11) until the address to be written which is the same as the address to be written A carried by the write data request E' is found.
As can be seen from the above description, the information carried by the write data request corresponding to the number 12 is shown in table 5. The data writing request A 'carries the address to be written in the same as the address to be written in carried by the data writing request E'.
It can be understood that, when the disaster recovery array includes a plurality of data volumes, and the information carried in each write data request includes the ID of the data volume, it is necessary that both the address to be written and the ID of the data volume are the same to satisfy the condition.
Step S318: and generating a new write data request to be written into the second cache according to the found information of the address to be written, wherein the new write data request comprises the modified number.
For example, the information read from the second cache includes the address a to be written and the data a to be written (which may also include the slave volume ID), and a new write data request may be generated according to the read information and the modified number (for example, the number is modified from 13 to 14). After the new write data request is written into the second cache, the corresponding relationship stored in the cache at this time is shown in table 6:
numbering Volume ID To-be-written address Data to be written
12 Slave volume ID To-be-written address A Data A to be written
12 Slave volume ID To-be-written address B Data D to be written
12 Slave volume ID To-be-written address C Data C to be written
13 Slave volume ID To-be-written address A Data E to be written
14 Slave volume ID To-be-written address A Data A to be written
TABLE 6
When the host sends a read data request to the disaster recovery array, and the ID of the data volume to be read is the slave volume ID and the address to be written is the address to be written a, the disaster recovery array searches for the data to be written corresponding to the latest number and the ID of the data volume to be read is the slave volume ID and the address to be written is the address to be written a in the second cache, and sends the data to be written corresponding to the latest number to the host. In the embodiment of the present invention, the data a to be written corresponding to the number 14 is sent to the host from the second cache.
The production array of the embodiment of the invention can directly send the information carried by the received write data request to the disaster recovery array from the cache without reading the related information from the data volume, thereby improving the efficiency of data replication and ensuring the data consistency for the disaster recovery array.
In the prior art, data replication is realized by snapshot data, which requires that when a data writing request is executed each time in a production array, data carried by the data writing request needs to be put into a cache, old data stored in an address is read out and stored in a data volume according to an address to be written carried in the data writing request, and then the data in the cache is written into the address to be written. In the embodiment of the invention, data does not need to be subjected to snapshot processing, and although the data writing request is modified, the time consumption is small. Therefore, compared with the prior art, the embodiment of the invention reduces the time delay of the processing of the data writing request.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a storage device 50 according to an embodiment of the present invention, and as shown in fig. 5, the storage device 50 includes: a receiving module 501, a reading and writing module 502, a current time slice number manager 503 and a sending module 504.
The receiving module 501 is configured to receive a first write data request sent by a host, where the first write data request carries data to be written and address information.
The Address information may include a Logical Block Address (LBA), and when the storage device 50 includes a plurality of data volumes, the Address information may further include IDs of the data volumes of the storage device 50.
The read-write module 502 is configured to add a first number to the data to be written and the address information, and write the data to be written and the address information into a cache, where the first number is a current time slice number; and reading the data to be written and the address information corresponding to the first number from the cache.
A current time slice number manager 503 may be included in the storage device 50, the current time slice number manager 503 stores a current time slice number, and the current time slice number may be represented by a numerical value, such as 0, 1, or 2, or may be represented by a letter, such as a, b, or c, which is not limited herein.
When a first data writing request is received, adding a first number in data to be written and address information carried by the first data writing request, wherein the first number is assigned to the first data writing request by a current time slice number.
After a first number is added to the information carried by the first data writing request, the modified information carried by the first data writing request is written into the cache, so that the data to be written, the address information and the first number carried by the first data writing request are all stored in the cache.
In addition, in a period of time, other data writing requests can be received, and the first number needs to be added to the information carried by the data writing requests and written into the cache. It should be noted that before the current time slice number is changed, the first number is added to the information carried in the write data request.
When the copy task is triggered, the storage device 50 may read the data to be written and the address information corresponding to the first number from the cache, and it is understood that there may be more than one data to be written and address information corresponding to the first number.
The replication task means that the storage device 50 sends information carried by the write data request received by one data volume in a period of time to the storage device of the disaster recovery center, and the information carried by the write data request is added with the same number as the current time slice number. The copy task trigger may be triggered by a timer or may be triggered manually, and is not limited herein. The purpose of the copying is to send data to be written, which is carried by a write data request received by the storage device 50, to the storage device of the disaster recovery center for storage, so that when the storage device 50 fails, the storage device of the disaster recovery center can take over the operation of the storage device 50. It can be understood that address information (e.g., LBA) carried by the write data request also needs to be sent to the storage device of the disaster recovery center, where the LBA is used to instruct the storage device of the disaster recovery center to store an address of data to be written. Since the storage device in the disaster recovery center has the same physical structure as the storage device 50, the LBA of the storage device 50 is applicable, and the storage device in the disaster recovery center is also applicable.
In the embodiment of the present invention, the replication task is for one data volume of the storage device 50, and when the storage device 50 includes a plurality of data volumes, one replication task corresponds to each data volume.
A current time slice number manager 503, configured to modify the current time slice number to identify information carried by a subsequent write data request.
When the replication task is triggered, the current slice number manager 503 needs to modify the current slice number, and when a subsequent write data request is received, another number needs to be added to the information carried by the subsequent write data request, where the other number is assigned to the current slice number after modification. Thus, the information carried by the write data request that needs to be sent to the storage device of the disaster recovery center can be distinguished in the cache from the information carried by the write data request being received by the storage device 50.
A sending module 504, configured to send the data to be written and the address information to a storage device of the disaster recovery center.
And the storage device 50 sends the data to be written and the address information corresponding to the first number read from the cache to the storage device of the disaster recovery center.
Specifically, the storage device 50 may directly send all read data to be written and address information to the storage device of the disaster recovery center; or after the ID of the data volume of the storage device of the disaster recovery center is obtained, new write data requests can be respectively generated according to the data to be written and the address information carried by each write data request and the ID of the data volume of the storage device of the disaster recovery center, and then sent to the storage device of the disaster recovery center.
In the embodiment of the present invention, after receiving a write data request sent by a host, a storage device 50 adds a first number to the data to be written and address information, writes the first number into a cache, where the first number is a current time slice number, and when a replication task is triggered, reads the data to be written and address information corresponding to the first number from the cache and sends the data to be written and address information to a storage device in a disaster recovery center, and when the replication task is triggered, modifies the current time slice number so that when the storage device 50 receives the write data request subsequently, the storage device 50 adds a number identical to the modified current time slice number to the information carried by the storage device in the cache, thereby distinguishing the information carried by the write data request that needs to be sent to the storage device in the disaster recovery center from the information carried by the write data request that the storage device 50 is receiving, the method and the device have the advantages that the information carried by the data writing request is directly sent to the storage device of the disaster recovery center from the cache, and the data is not required to be read from the data volume because the information is directly sent from the cache, so that the data copying time is short, and the data copying efficiency is improved.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a storage device 60 according to an embodiment of the present invention, and as shown in fig. 6, the storage device 60 includes: a receiving module 601, a lookup module 602, and a writing module 604.
The receiving module 601 is configured to receive address information sent by the storage device 50.
Specifically, the storage device 60 may receive data to be written and address information sent by the storage device 50; a write data request sent by the storage device 50 may also be received, where the write data request includes data to be written and Address information, and the Address information may be a Logical Block Address (LBA). When the storage device 60 includes a plurality of data volumes, the address information may further include IDs of the data volumes of the storage device 60. It is understood that there may be more than one piece of address information.
After receiving the data to be written and the address information, the storage device 60 adds the number, which is the same as the current time slice number, to the data to be written and the address information, and writes the data to be written and the address information into the cache, so that the number, which is the same as the current time slice number, and the data to be written and the address information are stored in the cache.
It should be noted that the storage device 60 may also include a current time slice number manager 603, where the current time slice number manager 603 stores a current time slice number, and the current time slice number may be represented by a numerical value, such as 0, 1, or 2, or may be represented by a letter, such as a, b, or c, which is not limited herein. The current time slice number here may not be linked to the current time slice number in the storage device 50.
A searching module 602, configured to, when it is determined that the storage device 50 is in a failure, obtain, by the storage device 60, to-be-written data corresponding to a first number according to the address information, where the address information corresponding to the first number is the same as the received address information, and the first number is a number before a current time slice number.
In general, if the storage device 50 and the storage device 60 both operate normally, the storage device 50 sends information carried by how many write data requests, and the storage device 60 can receive information carried by how many write data requests, and adds a number that is the same as the current time slice number to the information carried by each write data request, and stores the information in the cache. However, if the storage device 50 fails, the storage device 60 may only receive the data to be written in the corresponding portion of the current time slice number of the storage device 50, in which case the data stored by the storage device 60 may be unreal data, and if the storage device 50 is directly taken over, the data consistency cannot be guaranteed. For example, if the host sends a read data request to the storage device 60 for reading the data stored on the address information (e.g., LBA), the storage device 60 searches for the latest number corresponding to the address information and then sends the to-be-written data corresponding to the current time slice number to the host, but the data is not authentic. Therefore, at this time, the data in the cache of the storage device 60 needs to be restored to the data corresponding to the number before the current time slice number of the storage device 60.
Specifically, the failure of the storage device 50 may be determined by the control center sending a signal to the storage device 60, where the signal indicates that the storage device 50 has failed and the storage device 60 needs to take over the storage device 50 to process the host service.
Typically, when a replication task is completed, the control center may send an indication of successful replication to storage devices 50 and 60, respectively. If the storage device 60 does not receive the indication, it indicates that the current replication task is not complete. The completion of the copy task means that the storage device 50 sends information carried by all the write data requests corresponding to the current time slice number to the storage device 60, and the storage device 60 also completes receiving.
When the storage device 60 determines that the storage device 50 fails, if the current replication task is completed, the storage device 60 may directly take over the storage device 50, and data consistency may be ensured. This is not the case in the discussion of the embodiments of the present invention.
However, if the current copy task is not completed, the data in the cache of the storage device 60 needs to be restored to the data corresponding to the number before the current time slice number.
The specific recovery method may be that, according to the received address information, whether there is address information that is the same as the address information is searched for in the address information corresponding to the last number of the current time slice number, if not, the address information corresponding to the last number is searched for continuously until the address information is found, and then the data to be written corresponding to the number is obtained.
The writing module 604 is configured to add a second number to the data to be written and the address information corresponding to the first number, and write the data to be written and the address information to the cache.
The second number is a number obtained by modifying the current time slice number, and is the latest number stored in the cache in this embodiment. When the host sends a read data request to the storage device 60 to request to read the data stored in the address information (e.g., LBA), the storage device 60 finds that the latest number corresponding to the address information is the second number, and sends the data to be written corresponding to the second number to the host. Thus, data consistency is guaranteed.
In the embodiment of the present invention, the storage device 60 receives the address information sent by the storage device 50, and when the storage device 50 fails, obtains the data to be written corresponding to the number before the current time slice number according to the address information, adds a second number to the data to be written and the address information corresponding to the number before the current time slice number, and stores the data and the address information in the cache. Thus, data consistency is guaranteed.
Referring to fig. 7, a schematic diagram of a memory device 700 according to an embodiment of the invention is provided. The storage device 700 may comprise a storage device known in the art, and the specific embodiment of the present invention does not limit the specific implementation of the storage device 700. The storage device 700 includes:
a processor (processor)710, a Communications Interface (Communications Interface)720, a memory (memory)730, and a Communications bus 740.
Processor 710, communication interface 720, and memory 730 communicate with each other via communication bus 740.
Communication interface 720 is used for communicating with network elements, such as with hosts or switches, etc.
Processor 710 for executing program 732.
In particular, the program 732 may include program code that includes computer operational instructions.
The processor 710 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
A memory 730 for storing a program 732. Memory 730 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The procedure 732 may specifically include:
the receiving module 501 is configured to receive a first write data request sent by a host, where the first write data request carries data to be written and address information.
The read-write module 502 is configured to add a first number to the data to be written and the address information, and write the data to be written and the address information into a cache, where the first number is a current time slice number; and reading the data to be written and the address information corresponding to the first number from the cache.
A current time slice number manager 503, configured to modify the current time slice number to identify information carried by a subsequent write data request.
A sending module 504, configured to send the data to be written and the address information to a storage device of the disaster recovery center.
The specific implementation of each module in the program 732 may refer to the corresponding module in the embodiment shown in fig. 5, which is not described herein again.
Referring to fig. 8, a schematic diagram of a memory device 800 according to an embodiment of the invention is provided. The memory device 800 may comprise a memory device known in the art, and the specific embodiment of the present invention does not limit the specific implementation of the memory device 800. The storage device 800 includes:
a processor (processor)810, a Communications Interface (Communications Interface)720, a memory (memory)830, and a Communications bus 840.
Processor 810, communication interface 820, and memory 830 communicate with each other via communication bus 840.
A communication interface 820 for communicating with a network element, such as a host or a switch, etc.
Processor 810 is configured to execute program 832.
In particular, the program 832 may include program code comprising computer operational instructions.
The processor 810 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
The memory 830 stores a program 832. Memory 830 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 832 may specifically include:
the receiving module 601 is configured to receive address information sent by the storage device 50.
A searching module 602, configured to, when it is determined that the storage device 50 is in a failure, obtain, by the storage device 60, to-be-written data corresponding to a first number according to the address information, where the address information corresponding to the first number is the same as the received address information, and the first number is a number before a current time slice number.
The writing module 604 is configured to add a second number to the data to be written and the address information corresponding to the first number, and write the data to be written and the address information to the cache.
The specific implementation of each module in the program 832 may refer to a corresponding module in the embodiment shown in fig. 6, which is not described herein again.
The following describes in detail the application of the embodiments of the present invention to a scenario comprising at least two disaster recovery centers.
As shown in fig. 9, the storage system comprises one production center and at least two disaster recovery centers.
The production center comprises a production host, a connecting device and a production array. The system architecture of the disaster backup center is similar to that of the production center and comprises a disaster backup host, connecting equipment and a disaster backup array. The production center and the disaster recovery center can perform data transmission through IP (Internet protocol) or FC (fiber Chanel). A control center can be arranged between the production center and the disaster recovery center, and the control center can be deployed at the side of the production center, can also be deployed at the side of the disaster recovery center, and can also be deployed in third-party equipment between the production center and the disaster recovery center. And the control center is used for sending a signal to the disaster recovery array to take over the host service of the production array processing when the production array fails.
The production host and disaster recovery host may each be any computing device known in the art, such as a server, desktop computer, etc. Inside the host, an operating system and other application programs are installed.
The connection device may comprise any interface between a storage device and a host known in the art, such as a fabric switch, or other existing switch.
Both the production array and the disaster array may be Storage devices known in the art, such as Redundant array Of independent Disks (RAID), Just a Bunch Of Disks (JBOD), one or more interconnected disk drives Of Direct Access Storage Device (DASD), such as a tape library, a tape Storage Device Of one or more Storage units.
The storage space of the production array may include a plurality of data volumes, where a data volume is a segment of logical storage space mapped by a physical storage space, and for example, a data volume may be a Logical Unit Number (LUN) or a file system. In the embodiment of the invention, the disaster recovery array is similar in structure to the production array.
In order to ensure the safety of data in a production center, a plurality of disaster recovery centers are generally deployed and the data in the production center is copied to the plurality of disaster recovery centers, so that when a disaster occurs in both the production center and one disaster recovery center, other disaster recovery centers store data and are not lost. In the embodiment of the present invention, the task of the production array to copy the data in one data volume stored by the production array to one disaster recovery array is called a copy relationship (also called pair). Each copy relationship corresponds to a unique identification (e.g., ID). Since the production array will continue to receive write data requests sent by the host before a disaster occurs, the production array also needs to continuously copy its stored data into the disaster recovery array. Then, a replication relationship may be divided into a plurality of time periods, and a task in which the production array sends information carried in a write data request received by one data volume to the disaster recovery array in each time period is referred to as a replication task.
A current time slice number manager may be included in the production array, and the current time slice number manager stores the current time slice number, and the current time slice number may be represented by a numerical value, such as 0, 1, or 2, or may be represented by a letter, such as a, b, or c, which is not limited herein. It should be noted that the current time slice number is applicable to each disaster recovery array, and the current time slice number is modified each time a replication task is triggered.
Taking the current time slice number as 1 as an example, when a production array receives a data writing request, adding a number with the value of 1 in data to be written and address information carried in the data writing request, and then writing the data to be written and the address information carried in the data writing request and the number with the value of 1 into a cache.
When a replication task corresponding to the first disaster recovery array is triggered, the production array modifies the current time slice number from a value 1 to a value 2, so that the number with the value of 2 is added to the data to be written and the address information carried by the data writing request received later. And then sending the data to be written and the address information corresponding to the serial number with the value of 1 to the first disaster recovery array.
When the replication task corresponding to the second disaster recovery array is triggered, the production array modifies the current time slice number from a value 2 to a value 3, so that the number with the value of 3 is added to the data to be written and the address information carried by the data writing request received later.
When a replication task corresponding to the third disaster recovery array is triggered, the production array modifies the current time slice number from a value 3 to a value 4, so that a number with a value of 4 is added to data to be written and address information carried by a data writing request received later.
However, when the replication task corresponding to the first disaster recovery array is triggered again, the production array modifies the current time slice number from the value 4 to the value 5, so that the number with the value of 5 is added to the data to be written and the address information carried in the data writing request received later. If only the current time slice number is recorded in the production array, correspondingly, only the data to be written and the address information corresponding to the number with the value of 4 are sent to the first disaster recovery array, then the data to be written and the address information corresponding to the number with the value of 2 and the data to be written and the address information corresponding to the number with the value of 3 will be omitted, and the data stored in the first disaster recovery array will be inconsistent with the production array. Similarly, the second disaster recovery array and the third disaster recovery array may also face the problem of incomplete received data to be written and address information.
Referring to fig. 10, fig. 10 is a diagram illustrating an embodiment of a data replication method according to the present invention for solving the problem, where the method is applied to a production array corresponding to at least two disaster recovery arrays, and in the embodiment of the present invention, for convenience of description, the production array is referred to as a first storage device, and one of the at least two disaster recovery arrays is referred to as a second storage device. It should be noted that the following steps can be executed specifically with reference to the embodiments shown in fig. 2 to 4.
The method comprises the following steps:
step 41: and when the current replication task is triggered, the first storage device reads the current time slice number.
The copy task trigger may be triggered by a timer, may be triggered manually, or may be triggered in other ways, and is not limited herein. When the copy task is triggered, the first storage device may read the current slot number from the current slot number manager. It should be noted that, when the copy task is triggered, the first storage device modifies the current time slice number at the triggering time, where the current time slice number read by the first storage device refers to the modified current time slice number. For convenience of description, in the following steps, the current slot number before modification may be referred to as a historical slot number.
Step 42: reading a second number, wherein the second number is a number corresponding to a copy task which is associated with the current copy task and has been completed last time.
In the embodiment of the present invention, the fact that the last completed replication task is associated with the current replication task means that the current replication task and the last completed replication task belong to the same replication relationship, and as can be seen from the foregoing description, each replication relationship has a unique ID. When the replication task is triggered, the first storage device may receive the ID, and read the second number according to the ID.
Specifically, when the current replication task is triggered by a timer, the ID may be carried in the timer; when the current replication task is triggered by a human, the first storage device may receive the ID in the form of a signal or the like.
In the embodiment of the invention, the number corresponding to the finished copy task is recorded every time one copy task is finished. Optionally, only the number corresponding to the copy task that has been completed last time may be saved, and the number is updated when the copy task is completed next time; the number corresponding to all completed copy tasks may also be saved, which is not limited herein.
It is understood that in each copy relationship, a number corresponding to a copy task that has been completed last time is recorded.
Step 43: and determining a first number according to the current time slice number and the second number, wherein the first number is the number before the current time slice number when the replication task is triggered, and the first number is the number after the second number.
For example, if the current time slice number is 5 and the second number is 2, the numbers in the interval (2,5) can be determined as the first number. The interval is an open interval and does not include the numerical values 2 and 5.
Step 44: and copying the data to be copied and the address information of the data to be copied, which are stored in the cache corresponding to the first number, to a second storage device.
Specifically, the data to be copied and the address information of the data to be copied corresponding to the first number are read from the cache, and the data to be copied and the address information of the data to be copied are sent to the second storage device.
Optionally, the first storage device may directly send the data to be copied and the address information of the data to be copied to the second storage device, or generate a write data request according to the data to be copied and the address information of the data to be copied, and send the write data request to the second storage device.
Optionally, when the plurality of numbers all satisfy a condition that the number is before the current time slice number when the current replication task is triggered and after the number corresponding to the last completed replication task, and address information corresponding to the plurality of numbers is the same, only address information corresponding to the latest number and data to be replicated may be sent to the second storage device. The latest number refers to the number generated most recently. For example, assuming that the current time slice number is modified by adding 1 each time, the latest number is the number with the largest index value.
In the embodiment of the present invention, when a current replication task is triggered, a first storage device determines a first number according to the current time slice number and a second number, where the second number is a number corresponding to a replication task that has been completed last time before the current replication task, the first number is a number before the current time slice number when the current replication task is triggered and after the second number, and address information of data to be replicated and address information of the data to be replicated that are stored in a cache corresponding to the first number are replicated to the second storage device. Since all numbers between the second number and the current slot number can be determined as the first number, the data to be copied and the address information of the data to be copied corresponding thereto can be copied to the second storage device as long as the number determined as the first number is determined. Therefore, even if the current time slice number is modified when the copy tasks corresponding to other disaster recovery arrays are triggered, the first storage device can find the data to be copied and the address information of the data to be copied which are not copied to the second storage device through the second number, and copy the data to be copied to the second storage device, so that the integrity of copying is ensured.
Optionally, in the above embodiment, before the current replication task is triggered, the method further includes:
receiving a first write data request, wherein the first write data request comprises the data to be copied and address information of the data to be copied; and adding a first number in the address information of the data to be copied and the data to be copied, and writing the first number into the cache, wherein the first number is a historical time slice number.
Specifically, the historical time slice number is a current time slice number corresponding to a time when the first write data request is received. As can be seen from the embodiments shown in fig. 2-4, the historical time slice number needs to be modified to the current time slice number when the replication task is triggered.
Optionally, the method may further include:
receiving a second write data request, the second write data request including target data and address information of the target data;
adding a third number to the target data and the address information of the target data;
judging whether the third number is the same as the first number or not;
when the third number is the same as the first number, judging whether the address information of the target data is the same as the address information of the data to be copied;
when the address information of the target data is the same as the address information of the data to be copied, replacing the data to be copied stored in the cache with the target data;
and when the address information of the target data is different from the address information of the data to be copied, writing the target data added with the third number and the address information of the target data into the cache.
And when the third number is different from the first number, writing the target data added with the third number and the address information of the target data into the cache.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a memory device according to an embodiment of the invention. As shown in fig. 11, the storage device includes: a read-write module 52, a determination module 53 and a copy module 54.
The reading and writing module 52 is configured to read a current time slice number when the current replication task is triggered; and reading a second number, wherein the second number is a number corresponding to a copy task which is associated with the current copy task and has been completed last time.
A determining module 53, configured to determine a first number according to the current time slice number and the second number, where the first number is a number before the current time slice number when the current replication task is triggered, and the first number is a number after the second number.
The copying module 54 is configured to copy the data to be copied and the address information of the data to be copied, which are stored in the cache corresponding to the first number, to a second storage device.
In the embodiment of the present invention, when a current replication task is triggered, a first storage device determines a first number according to the current time slice number and a second number, where the second number is a number corresponding to a replication task that has been completed last time before the current replication task, the first number is a number before the current time slice number when the current replication task is triggered and after the second number, and address information of data to be replicated and address information of the data to be replicated that are stored in a cache corresponding to the first number are replicated to the second storage device. Since all numbers between the second number and the current slot number can be determined as the first number, the data to be copied and the address information of the data to be copied corresponding thereto can be copied to the second storage device as long as the number determined as the first number is determined. Therefore, even if the current time slice number is modified when the copy tasks corresponding to other disaster recovery arrays are triggered, the first storage device can find the data to be copied and the address information of the data to be copied which are not copied to the second storage device through the second number, and copy the data to be copied to the second storage device, so that the integrity of copying is ensured.
Optionally, the storage device may further include: and a recording module 55, configured to record the second number.
Optionally, the last completed replication task is associated with the current replication task, which means that the current replication task and the last completed replication task belong to a replication relationship; the storage device further comprises a receiving module 51;
a receiving module 51, configured to receive an identifier corresponding to the copy relationship;
and the read-write module is specifically configured to read a second number corresponding to the current replication task according to the identifier.
Optionally, the receiving module 51 is further configured to receive a first write data request before the current replication task is triggered, where the first write data request includes the data to be replicated and address information of the data to be replicated;
the read-write module 52 is further configured to add a first number to the data to be copied and the address information of the data to be copied, and write the first number into the cache, where the first number is a historical time slice number. Wherein the current time slice number is modified from the historical time slice number.
Optionally, the copy module 54 is specifically configured to: when the address information corresponds to a plurality of numbers, determining that the latest number in the numbers corresponding to the address information is the first number; and copying the data to be copied and the address information of the data to be copied, which are stored in the cache corresponding to the first number, to a second storage device.
The storage device provided in the embodiment of the present invention is configured to execute the data copying method described in the foregoing embodiment, and detailed descriptions of functions of each module may refer to the description in the method embodiment, which is not described herein again.
As shown in fig. 12, the storage device provided in the embodiment of the present invention includes:
a processor 101, a memory 102, a system bus (bus for short) 105, and a communication interface 103. The processor 101, the memory 102 and the communication interface 103 are connected by a system bus 105 to complete communication with each other.
The processor 101 may be a single or multi-core central processing unit, or a specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention.
The memory 102 may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one hard disk memory.
The communication interface 103 is used for communicating with a storage device.
Memory 102 is used to store computer-executable instructions 1021. In particular, the computer executable instructions 1021 may include program code.
When the computer is running, the processor 101 runs the computer execution instructions 1021, and may execute the method flow described in fig. 10.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical sub-modules, may be located in one place, or may be distributed on a plurality of network sub-modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (15)

1. A data transmission method, comprising:
when a replication task is triggered, the first storage device modifies the current time slice number, and the modified current time slice number is used for marking data carried by a write data request received by the first storage device from a host after the replication task is triggered;
the first storage device reads data to be written in from a cache, the data to be written in is all data carried by data writing requests identified by all numbers between a first number and a second number, the first number is a current time slice number before modification, the data carried by the data writing requests identified by the second number is sent to a second storage device, all numbers between the first number and the second number include the first number but do not include the second number, and the data to be written in is not written in a data volume;
and the first storage device sends the data to be written read from the cache to the second storage device.
2. The method according to claim 1, wherein a correspondence relationship between the second storage device and the second number is stored in the first storage device, and the correspondence relationship is used to indicate that a number corresponding to a copy task that has been completed by the second storage device last time is the second number;
the method further comprises: and updating the corresponding relation to indicate that the number corresponding to the copy task which has been completed by the second storage device last time is the first number.
3. The method of claim 2, wherein prior to the replication task triggering, the method further comprises:
the first storage device receives a plurality of data writing requests from the host, wherein data carried by the data writing requests is a part or all of data to be written read from the cache;
the first storage device reads the first number;
the first storage device adds the first number to each of the plurality of write data requests;
the first storage device writes each write data request added with the first number into the cache.
4. The method of claim 3, wherein the plurality of write data requests further includes address information of the carried data, the method further comprising:
and the first storage equipment sends the address information of the carried data to the second storage equipment.
5. The method of claim 4, further comprising:
when the next replication task of the replication task is triggered, the first storage device modifies the modified current time slice number, and the twice-modified current time slice number is used for identifying data carried by a write data request received by the first storage device from the host after the next replication task is triggered;
the first storage device reads data carried by the write data request identified by the modified current time slice number from a cache;
and the first storage device sends the data carried by the write data request identified by the modified current time slice number read from the cache to the second storage device.
6. An apparatus for transmitting data, the apparatus being located in a first storage device, comprising:
the current time slice number manager is used for modifying the current time slice number when a replication task is triggered, and the modified current time slice number is used for marking data carried by a write data request received by the first storage device from a host after the replication task is triggered;
the read-write module is used for reading data to be written in from a cache of the first storage device, wherein the data is all data carried by a write data request identified by all numbers between a first number and a second number, the first number is a current time slice number before modification, the data carried by the write data request identified by the second number is sent to the second storage device, all numbers between the first number and the second number include the first number but do not include the second number, and the data to be written in is not written in a data volume;
and the sending module is used for sending the data to be written read from the cache to the second storage device.
7. The apparatus of claim 6, further comprising: the read-write module is further configured to record a corresponding relationship between the second storage device and the second number, where the corresponding relationship is used to indicate that a number corresponding to a copy task that has been completed by the second storage device last time is the second number;
the read-write module is further configured to update the correspondence to indicate that a number corresponding to a copy task that has been completed by the second storage device last time is the first number.
8. The apparatus of claim 6, further comprising:
a receiving module, configured to receive, before the replication task is triggered, multiple write data requests from the host, where data carried in the multiple write data requests is a part or all of data to be written read from the cache;
the read-write module is also used for reading the first serial number; adding the first number to each of the plurality of write data requests; writing each write data request added with the first number into the cache.
9. The apparatus of claim 8, wherein the plurality of write data requests further includes address information of the carried data, and wherein the sending module is further configured to send the address information of the carried data to the second storage device.
10. The apparatus of claim 6, wherein the current slot number manager is further configured to modify the modified current slot number when a next replication task of the replication task is triggered, and the twice modified current slot number is used to identify data carried by a write data request received by the first storage device from the host after the next replication task is triggered;
the read-write module is further configured to read, from the cache, data carried in the write data request identified by the modified current time slice number;
the sending module is further configured to send the data carried by the write data request identified by the modified current time slice number read from the cache to the second storage device.
11. A storage device, comprising: a processor, a memory, and a communication bus;
wherein the processor and the memory communicate over the communication bus;
the memory is used for storing programs;
the processor is configured to execute the program to implement:
when a replication task is triggered, modifying the current time slice number, wherein the modified current time slice number is used for marking data carried by a write data request received by the storage device from a host after the replication task is triggered;
reading data to be written in from a cache, wherein the data to be written in is all data carried by data writing requests identified by all numbers between a first number and a second number, the first number is a current time slice number before modification, the data carried by the data writing requests identified by the second number is sent to a target storage device, all numbers between the first number and the second number include the first number but do not include the second number, and the data to be written in is not written in a data volume;
and sending the data to be written read from the cache to the target storage device.
12. The storage device according to claim 11, wherein a correspondence relationship between the storage device and the second number is stored in the memory, and the correspondence relationship is used to indicate that a number corresponding to a copy task that has been completed by the storage device last time is the second number;
the processor is further configured to update the correspondence to indicate that a number corresponding to a copy task that has been completed by the storage device last time is the first number.
13. The storage device of claim 11, wherein the processor, prior to the replication task triggering, is further configured to:
receiving a plurality of data writing requests from the host, wherein the data carried by the data writing requests is a part or all of the data to be written read from the cache;
reading the first number;
adding the first number to each of the plurality of write data requests;
writing each write data request added with the first number into the cache.
14. The storage device of claim 13, wherein the plurality of write data requests further includes address information of the carried data, and wherein the processor is further configured to send the address information of the carried data to the target storage device.
15. The storage device of claim 11, wherein the processor is further configured to modify the modified current time slice number when a next replication task of the replication task is triggered, where the twice modified current time slice number is used to identify data carried by a write data request received by the storage device from the host after the next replication task is triggered; reading data carried by the data writing request identified by the modified current time slice number from a cache; and sending the data carried by the write data request identified by the modified current time slice number read from the cache to the target storage device.
CN201710215599.4A 2013-07-26 2013-11-15 Data sending method, data receiving method and storage device Active CN107133132B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
PCT/CN2013/080203 WO2015010327A1 (en) 2013-07-26 2013-07-26 Data sending method, data receiving method and storage device
CNPCT/CN2013/080203 2013-07-26
CN201380042349.5A CN104520802B (en) 2013-07-26 2013-11-15 Data sending method, data receiving method and storage device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201380042349.5A Division CN104520802B (en) 2013-07-26 2013-11-15 Data sending method, data receiving method and storage device

Publications (2)

Publication Number Publication Date
CN107133132A CN107133132A (en) 2017-09-05
CN107133132B true CN107133132B (en) 2020-11-17

Family

ID=52794266

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201380042349.5A Active CN104520802B (en) 2013-07-26 2013-11-15 Data sending method, data receiving method and storage device
CN201710215599.4A Active CN107133132B (en) 2013-07-26 2013-11-15 Data sending method, data receiving method and storage device

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201380042349.5A Active CN104520802B (en) 2013-07-26 2013-11-15 Data sending method, data receiving method and storage device

Country Status (1)

Country Link
CN (2) CN104520802B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528338B (en) * 2016-10-28 2020-08-14 华为技术有限公司 Remote data copying method, storage device and storage system
CN107577421A (en) * 2017-07-31 2018-01-12 深圳市牛鼎丰科技有限公司 Smart machine expansion method, device, storage medium and computer equipment
US10452503B2 (en) * 2017-09-29 2019-10-22 Hewlett Packard Enterprise Development Lp Bidirectional replication
CN109709902B (en) * 2017-10-25 2022-01-21 富泰华精密电子(郑州)有限公司 Data interaction method, system and memory
CN109933413A (en) * 2017-12-15 2019-06-25 北京嘀嘀无限科技发展有限公司 Service implementation method and device, electronic equipment, storage medium
CN111818108B (en) * 2019-04-10 2022-07-19 阿里巴巴集团控股有限公司 Method and device for ensuring data acquisition consistency
CN111917633B (en) * 2020-08-06 2022-08-05 北京金山云网络技术有限公司 Message sending method, sending device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751230A (en) * 2009-12-29 2010-06-23 成都市华为赛门铁克科技有限公司 Equipment and method for calibrating time stamp of I/O (input/output) data
CN102306115A (en) * 2011-05-20 2012-01-04 成都市华为赛门铁克科技有限公司 Asynchronous remote copying method, system and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761421B2 (en) * 2003-05-16 2010-07-20 Hewlett-Packard Development Company, L.P. Read, write, and recovery operations for replicated data

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751230A (en) * 2009-12-29 2010-06-23 成都市华为赛门铁克科技有限公司 Equipment and method for calibrating time stamp of I/O (input/output) data
CN102306115A (en) * 2011-05-20 2012-01-04 成都市华为赛门铁克科技有限公司 Asynchronous remote copying method, system and equipment

Also Published As

Publication number Publication date
CN107133132A (en) 2017-09-05
CN104520802A (en) 2015-04-15
CN104520802B (en) 2017-04-19

Similar Documents

Publication Publication Date Title
US10795788B2 (en) Remote data replication method and system
EP2849048B1 (en) Data sending method, data receiving method and storage device
CN107133132B (en) Data sending method, data receiving method and storage device
US7774565B2 (en) Methods and apparatus for point in time data access and recovery
US10235060B1 (en) Multilevel snapshot replication for hot and cold regions of a storage system
US7840766B2 (en) Storage system and method of producing recovery volume
US8078581B2 (en) Storage system and remote copy control method
US7761431B2 (en) Consolidating session information for a cluster of sessions in a coupled session environment
CN106776147B (en) Differential data backup method and differential data backup device
US20190317872A1 (en) Database cluster architecture based on dual port solid state disk
WO2015085529A1 (en) Data replication method, data replication device and storage device
US10740189B2 (en) Distributed storage system
JP3667084B2 (en) Data multiplexing control method
CN105573862B (en) Method and equipment for recovering file system
CN116601609A (en) Storing data in computer storage
US11853166B2 (en) Storage system recovery without data retransmission

Legal Events

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