WO2018045758A1 - Data storage method and data centre - Google Patents

Data storage method and data centre Download PDF

Info

Publication number
WO2018045758A1
WO2018045758A1 PCT/CN2017/081340 CN2017081340W WO2018045758A1 WO 2018045758 A1 WO2018045758 A1 WO 2018045758A1 CN 2017081340 W CN2017081340 W CN 2017081340W WO 2018045758 A1 WO2018045758 A1 WO 2018045758A1
Authority
WO
WIPO (PCT)
Prior art keywords
version
data
history queue
version number
data center
Prior art date
Application number
PCT/CN2017/081340
Other languages
French (fr)
Chinese (zh)
Inventor
白平昌
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018045758A1 publication Critical patent/WO2018045758A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • 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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a data storage method and a data center.
  • cloud storage is a cloud computing system with data storage and management as its core. Users can connect to the cloud to access data through networkable terminals at any time and any place.
  • object storage is the core of cloud storage, also known as object-based storage.
  • the biggest feature of the object storage system is that the object name is a domain name address. Once the domain name is set to be public, everyone can access the object.
  • a multi-data center solution can be adopted.
  • each data center can process the client's business request, that is, the object can be uploaded to any data center, or can be downloaded to the same object from any data center. After the object is uploaded to any data center, it is necessary to ensure that the data of the object finally stored in each data center is the same data, so that the same data can be downloaded when the object is downloaded from any data center. Therefore, when there is data of the uploaded object in the object storage system, a round of resolution process is started. If accepted by most data centers, each data center saves the data of the object uploaded this time, thereby making any one of the data When the data center downloads the object, it can download the same data. However, reaching a round of resolutions requires multiple network interactions in various data centers, resulting in large network overhead.
  • the embodiment of the invention provides a data storage method and a data center, which can reduce network overhead.
  • a first aspect of the embodiments of the present invention provides a data storage method, which is applied to an object storage system including a plurality of data centers, and includes: when the data center stores the data of the object, the first version of the version number of the object in the local end is read. The second version of the history queue; the data center determines whether the version number of the data of the object stored in the first version history queue is greater than the version number in the second version history queue; if the version number in the second version history queue is greater than the version number, the data is The center determines that no optimistic lock conflict has occurred, and the data storage of the object stored this time is successful.
  • the version number includes a receiving time and a universal unique identifier UUID of the storage request for receiving data for storing the object sent by the client; the version number after the receiving time is greater than the version number of the receiving time, and the receiving time is the same.
  • the version number of the UUID is larger than the version number of the UUID.
  • the UUID is a Universally Unique Identifier (UUID), which is unique in a distributed system, that is, in each data center, and is identified by the current date, time, clock sequence, and globally unique IEEE machine. Number composition.
  • the first part of the UUID is related to time. For example, after a UUID is generated by the same data center, a UUID is generated after a few seconds, and the first part is different, and the others are the same. Even if different data centers receive the same two storage requests for the data of the object, the universal unique identifier is different. Therefore, the receiving time in the version number may be the local time of the data center that receives the storage request, and need not be Full The precise timing of the atomic clock determined by the precise synchronization of the ball time. This embodiment reduces the difficulty of implementing the data storage method and saves the cost of data storage because the data center does not strictly require the atomic clocks of the data centers to be synchronized with the global time to ensure the same time.
  • each storage request corresponds to a version number
  • the version number can be used to distinguish the old and new relationship of the data of the object corresponding to different storage requests
  • the version number of the data of the object stored in each data center in the object storage system is greater than
  • the existing version number of the object can be stored successfully, so that the data of the object stored in each data center is the latest data of the object received by the object storage system, and the data of the object in each data center is consistent.
  • the data center may receive the copy request sent by the other data center; The request extracts the data of the object and the first version history queue of the object; in response to the copy request, the data of the object is stored.
  • This embodiment can also synchronize the data of the objects received by other data centers into the data center.
  • the data center receives the storage request of the object before reading the second version history queue formed by the version number of the object existing in the local end;
  • the data center generates a version number of the data of the object to be stored for the storage request;
  • the data center adds the version number to the tail of the version history queue of the object, constitutes the first version history queue of the object;
  • the data center responds to the storage request, and stores The object's data, and sends a copy request to the other data center, the copy request carries the first version of the object's historical queue.
  • This embodiment can not only store the data of the object in the storage request received by the data center, but also send a copy request to other data centers, so that other data can also synchronously store the data of the object according to the copy request.
  • the data center is determined in the first version history queue
  • the version number of the data of the stored object is not greater than the version number in the history queue of the second version, and it can be determined that an optimistic lock conflict occurs, and the data storage of the object stored this time fails; then, the data center can compare the first version of the historical queue.
  • the third version history queue is merged with the version number in the second version history queue; the third version history queue is stored to update the version history queue of the local object.
  • the data center may be in an optimistic lock conflict, and the data of the object to be stored is determined to be expired data.
  • the first version of the historical queue and the local end may still be used.
  • the second version history queue formed by the existing version number of the object is merged to obtain a third version history queue to update the version history queue of the object in the local end.
  • the storage request triggers the data center storage data or the replication request triggers the data center to store the data
  • the data center determines that no optimistic lock conflict occurs
  • the first version history queue is the current latest version history queue, and the data center can
  • the first version history queue is stored as a version history queue for the object to be used when the data of the object is updated next time.
  • the data center compares the version number of the first version of the historical queue with the second version of the historical queue, and aligns the third version of the historical queue, which may be specifically: the order of the data center from the tail to the head, and determining the first version of the historical queue and the first Whether the first version number is the same in the second version history queue; if there is the first version number, the data center will match the first version history queue with the first version number in the second version history queue. All version numbers of the tail are sorted, and the third version history queue is merged; if the first version number is not present, the data center sorts the first version history queue and all version numbers in the second version history queue. The third version history queue is merged.
  • a second aspect of the embodiments of the present invention provides a data center, where the data center has a behavior function for implementing the method provided by the foregoing first aspect, and the function may be implemented by using hardware or by executing corresponding software by hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • FIG. 1 is a schematic diagram of an object storage system according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a data storage method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a data center disclosed in an embodiment of the present invention.
  • FIG. 4 is another schematic structural diagram of a data center according to an embodiment of the present invention.
  • FIG. 1 is a schematic diagram of an object storage system according to an embodiment of the present invention.
  • the object storage system may include multiple data centers.
  • two data centers DC1 and DC2 are taken as an example, and each data center may include a load balancing module (Load Balancing, LB), an object storage subsystem, and a KV (Key-Value) subsystem, wherein the load balancing subsystem is configured to allocate storage requests of client Client A and Client B to respective object storage subsystems to avoid storage of an object.
  • load balancing subsystem is configured to allocate storage requests of client Client A and Client B to respective object storage subsystems to avoid storage of an object.
  • each data center can receive a storage request uploaded by a client, and the data storage method provided by the embodiment of the present invention can be used in each data center of the object storage system, regardless of which data center is uploaded from the data storage system.
  • FIG. 2 is a data storage method according to an embodiment of the present invention. As shown in FIG. 2, the data storage method includes the following steps:
  • the data center stores the data of the object, and reads a second version history queue formed by the version number of the object existing in the local end;
  • the data center determines whether the version number of the data of the object stored in the first version history queue is greater than The version number in the second version of the historical queue; if it is greater than the version number in the second version history queue, step S103 is performed; if it is not greater than the version number in the second version history queue, the process ends.
  • the data center determines that an optimistic lock conflict is not generated, and the data storage of the object stored this time is successful.
  • the execution body of the steps S101 to S103 may also be an object storage subsystem of the data center or a server of the data center, etc., which is not limited by the embodiment of the present invention.
  • the version number includes a receiving time and a universal unique identification code UUID of the storage request for receiving the data of the storage object sent by the client; the version number after the receiving time is greater than the version number of the receiving time first.
  • the version number with a large UUID is larger than the version number with a smaller UUID.
  • the different storage requests of the object correspond to different data of the object, and the different data of the object corresponds to different version numbers. Therefore, the data of the object corresponding to each storage request can be distinguished by the version number, and different storage can be determined according to the version number. Request new and old relationships for different data of the corresponding object.
  • the UUID is a Universally Unique Identifier (UUID), which is unique in a distributed system, that is, in each data center, and is identified by the current date, time, clock sequence, and globally unique IEEE machine. Number composition.
  • the first part of the UUID is related to time. For example, after a UUID is generated by the same data center, a UUID is generated after a few seconds, and the first part is different, and the others are the same. Even if different data centers receive the same two storage requests for the data of the object, the universal unique identifier is different. Therefore, the receiving time in the version number may be the local time of the data center that receives the storage request, and need not be Precise timing with precise time synchronization of atomic clocks around the world. This embodiment reduces the difficulty of implementing the data storage method and saves the cost of data storage because the data center does not strictly require the atomic clocks of the data centers to be synchronized with the global time to ensure the same time.
  • the method may further include the following steps:
  • the data center receives the copy request sent by other data centers;
  • the data center extracts the data of the object from the copy request and the first version history queue of the object
  • the data center responds to the copy request and stores the data of the object.
  • the stored data comes from data synchronized by other data centers, thereby ensuring data consistency in each data center.
  • the data of the data center storage object may also be the data of the object corresponding to the storage request sent by the client to the data center, and may include the following steps:
  • the data center receives the storage request of the object
  • the data center generates a version number of the object for the storage request
  • the data center adds the version number to the end of the object's version history queue, forming the first version of the object. This historical queue;
  • the data center responds to the storage request, stores the data of the object, and sends a copy request to the other data center.
  • the copy request is used to synchronously write data of an object corresponding to the storage request to another data center, where the copy request carries a first version history queue of the object.
  • the version number includes a receiving time and a UUID of the storage request corresponding to the version number; the receiving time is a receiving time of the storage request corresponding to the data of the object to be stored in the data center.
  • the version history queue of the object when the data center stores the data of the object, if the object does not exist, the version history queue of the object is empty, NULL; if the object already exists, the version history queue of the object is not empty.
  • the version number generated by the data center for the storage request is V2. If the version history queue of the data center before the storage request is NULL, the first version history queue is NULL->V2; if the data center is in the storage The version history queue before the request is NULL->V1, then the first version history queue is NULL->V1->V2.
  • the version number in the version history queue located near the head is smaller than the version number located near the end of the queue, and the newly generated version number can be directly added to the tail of the version history pair column to form the first version history queue.
  • the data center when the data center receives the storage request, the data center generates a version number for the object to be stored, and adds the version number to the data center that has been stored or already exists.
  • the end of the version history queue of the object is formed; the second version history queue is a version history queue of the object stored or existing in the data center.
  • the data center DC1 may generate a version number of the data of the object to be stored for the storage request, and add the version number to the tail of the version history queue of the object in DC1 to form the first version.
  • the history queue when the data center DC2 receives the copy request sent by the DC1, the first version history queue can be extracted, and the second version history queue of the version number of the object already existing in the DC2 is read, and the DC2 is based on the first
  • the version history queue and the second version history queue store data of the object corresponding to the storage request.
  • the data storage method may further include the following steps:
  • the data center determines to generate an optimistic lock conflict, and the data storage of the object stored in the current storage fails;
  • the data center compares the version numbers of the first version history queue with the second version history queue, and merges and lists the third version history queue;
  • the data center stores the third version history queue to update the version history queue of the object in the local end.
  • the data center stores the third version history queue, so that when the data of the object is updated next time, the third version history queue is used as the version history queue of the object that already exists in the data center.
  • scenario 1 is: the data center DC1 receives the storage request of the object, and the generated version number is V1; if the version history queue of the object that already exists in DC1 is NULL, the first version history queue is NULL->V1.
  • the second version history queue read by DC1 is NULL, and DC1 determines the history of the first version in the column.
  • the version number V1 is greater than the NULL in the second version history queue. Therefore, DC1 determines that no optimistic lock conflict is generated, so DC1 can successfully store the data of the object corresponding to the version number V1.
  • the scenario 2 is: the data center DC1 receives the copy request sent by the data center DC2, and the copy request is used to synchronously write the data of the object corresponding to the storage request received by the DC2 to the DC1, where the copy request carries the object.
  • the first version history queue is NULL->V1
  • the version history queue of the object already existing by DC1 is NULL, wherein the version number V1 is generated by DC2 for the data of the object corresponding to the storage request it receives.
  • the second version history queue read by DC1 is NULL.
  • DC1 determines that the version number V1 in the first version history pair column is greater than the NULL value in the second version history queue. Therefore, DC1 determines that no optimistic lock conflict occurs. The data of the object corresponding to the version number V1 is successfully stored.
  • the scenario 3 is: the data center DC1 receives two storage requests of the same object, and the version numbers generated for the two storage requests are respectively V1 and V2, wherein the storage request receiving time corresponding to the version number V1 is received. Prior to the receiving time of the storage request corresponding to the version number V2, the version number V1 is smaller than the version number V2, and the version history queue of the object already existing by DC1 is NULL.
  • DC1 first stores the data of the object corresponding to the version number V1, and determines that the first version history queue is NULL->V1, and the read second version history queue is NULL, and DC1 determines the first version history pair column.
  • the medium version number V1 is greater than the NULL in the second version history queue. Therefore, the DC1 determines that the optimistic lock conflict is not generated, and the DC1 can successfully store the data of the object corresponding to the version number V1.
  • the DC1 stores the object corresponding to the version number V2.
  • the data determines that the first version history queue is NULL->V1->V2, and the read second version history queue is NULL->V1, and DC1 determines that the version number V2 in the first version history is greater than the second version history.
  • the version number V1 in the queue therefore, DC1 determines that no optimistic lock conflict is generated, and DC1 can successfully store the data of the object corresponding to the version number V2.
  • the data center DC1 receives the storage request of the object, and the generated version number is V3.
  • the version history queue of the object that already exists in DC1 is NULL->V1->V2, and the first version history queue is NULL->V1->V2->V3.
  • the second version history queue read by DC1 is NULL->V1->V2, and DC1 determines that the version number V3 in the first version history pair column is greater than each version number in the second version history queue, therefore, DC1 determines that no optimistic lock conflict is generated, and DC1 can successfully store the data of the object corresponding to version number V3.
  • the scenario 5 is: the data center DC1 receives the copy request sent by the data center DC2, and the copy request is used to synchronously write the data of the object corresponding to the storage request received by the DC2 to the DC1, where the copy request carries the object.
  • the first version history queue is NULL->V1->V2
  • the version history queue of the object already existing by DC1 is NULL->V1, wherein the version number V2 is generated by DC2 for the data of the object corresponding to the storage request it receives. .
  • the second version history queue read by DC1 is NULL->V1
  • DC1 determines that the version number V2 of the tail of the first version history column is greater than the V1 of the tail of the second version history queue, therefore, DC1 is determined.
  • the optimistic lock conflict is not generated, and DC1 can successfully store the data of the object corresponding to the version number V2.
  • scenario 6 is: the data center DC1 receives the storage request of the object, and the generated version number is V1; meanwhile, the data center DC2 receives the storage request of the same object, and the generated version number is V2, and the DC1 and DC2 are already
  • the existing version history queue of the object is NULL, and the version number V1 is greater than the version number V2 (ie, the data center DC1 and the data center DC2 receive the storage request at the same time, but the UUID is different in the version number generated by the two, V1 UUID is greater than the UUID of V2).
  • the first version history queue is NULL->V1
  • the second version history queue is NULL
  • the first version is determined according to the version number comparison rule.
  • the V1 in the history queue is larger than the NULL in the history queue of the second version, and it is determined that the optimistic lock conflict is not generated.
  • DC1 stores the data of the object corresponding to the version number V1 successfully.
  • the DC1 receives the copy request sent by the DC2, and stores the version number V2.
  • the data of the corresponding object is the NULL->V2 of the first version.
  • the history queue of the second version is NULL->V1 (that is, the data of the object corresponding to the successful version number V1 is stored by DC1).
  • the queue is the first version history queue NULL->V1 when storing the data of the object corresponding to the version number V1. Since V2 in the first version history queue is smaller than V1 in the second version history queue, it is determined that an optimistic lock conflict occurs, DC1 The data of the object corresponding to the version number V2 fails to be stored, and the data corresponding to the version number V2 is expired data. Therefore, the order of the DC1 from the tail to the head determines the first version of the historical queue and the second.
  • the same version number does not exist in the history queue; all the version numbers in the first version history queue and the second version history queue are sorted, that is, the version number V2 and the version number V1 are sorted; the version number V1 is greater than the version number V2, Therefore, the third version history queue is NULL->V2->V1, and DC1 stores the third version history queue to update the version history queue of the object to NULL->V2->V1.
  • scenario 7 is: the data center DC1 receives the storage request of the object, and the generated version number is V1; meanwhile, the data center DC2 receives the storage request of the same object, and the generated version number is V2, and the DC1 and DC2 have already been generated.
  • the existing version history queue of the object is NULL, and the version number V1 is smaller than the version number V2 (that is, although the data center DC1 and the data center DC2 receive the storage request at the same time, the UUID in the version number generated by the two is different, V1 UUID is less than the UUID of V2).
  • the first version history queue is NULL->V1
  • the second version history queue is NULL
  • the first version history queue has V1 greater than the second version.
  • NULL in the history queue determines that no optimistic lock conflict is generated.
  • DC1 stores the data of the object corresponding to version number V1 successfully.
  • DC1 receives the copy request sent by DC2, and stores the data of the object corresponding to version number V2.
  • the version history queue of the version is NULL->V2.
  • the history queue of the second version is NULL->V1 (that is, when the data of the object corresponding to the successful version number V1 is stored by DC1, the version history queue of the object is the storage version number V1.
  • the first version history queue of the corresponding object data is NULL->V1); V2 in the first version history queue is larger than V1 in the second version history queue, and it is determined that no optimistic lock conflict is generated, and DC1 will be the object corresponding to the version number V2.
  • the data was stored successfully.
  • DC1 storage data triggered by the storage request or the DC1 storage data triggered by the replication request if DC1 determines that no optimistic lock conflict is generated, it indicates that the first version history queue is the current latest version history queue, and DC1 can The first version history queue is stored as a version history queue for the object to be used when the data of the object is updated next time.
  • the data storage method shown in FIG. 2 can read the existing version of the object in the local end when storing the data of the object.
  • the second version of the history queue is configured by the data center; the data center determines whether the version number of the data stored in the first version of the historical queue is greater than the version number in the history queue of the second version; The version number, the data center determines that the optimistic lock conflict is not generated, and the stored data of the object is successfully stored. It can be seen that the version number of the data of the object stored in the present embodiment is greater than the version of the object that already exists. When the number is stored, the data of the object stored in this storage is successfully stored, and the network overhead is greatly reduced compared with the method that needs to achieve a round of resolution for storage.
  • each storage request corresponds to a version number
  • the version number can be used to distinguish the old and new relationship of the data of the object corresponding to different storage requests
  • the version number of the data of the object stored in each data center in the object storage system is greater than
  • the existing version number of the object can be stored successfully, so that the data of the object stored in each data center is the latest data of the object received by the object storage system, and the data of the object in each data center is consistent.
  • the embodiment of the present invention takes the object storage system in FIG. 1 as an example, and describes the data storage method in detail, which may include the following steps:
  • the client Client A sends a storage request to the data center DC1, and the storage request is used to store the data 1 of the object Obj;
  • DC1 receives the storage request, and the load balancing module 1 in DC1 allocates the storage request to the object storage subsystem 11 in DC1 for processing;
  • the object storage subsystem 11 generates a version number V1 of the data 1 of the object Obj for the storage request;
  • the object storage subsystem 11 reads the version history queue of the object Obj in DC1 to be NULL;
  • the object storage subsystem 11 adds the version number V1 to the tail of the version history queue of the object Obj, and the first version history queue constituting the object Obj is NULL->V1;
  • the object storage subsystem 11 calls the data 1 of the KV subsystem 1 storage object Obj in DC1, and sends a copy request to the data center DC2, the copy request carrying the first version history queue NULL->V1 and the data 1 of the object Obj;
  • the object storage subsystem 11 calls the data 1 of the KV subsystem 1 storage object Obj in DC1
  • the optimistic lock conflict returned by the KV subsystem 1 is not received, and the data 1 of the object Obj is determined to be successfully stored, and at this time, the object Obj of the DC1 is
  • the version history queue is NULL->V1;
  • the data center DC2 receives the copy request sent by the object storage subsystem 11, and the load balancing module 1 in DC2 allocates the copy request to the object storage subsystem 21 in DC2 for processing;
  • the object storage subsystem 21 extracts the data 1 of the object Obj from the copy request and the first version history queue of the object Obj is NULL->V1;
  • the object storage subsystem 21 calls the KV subsystem 2 in DC2 to respond to the copy request, and stores the data 1 of the object Obj;
  • the second version history queue formed by reading the version number of the object Obj already existing in the DC2 is NULL;
  • the KV subsystem 2 determines that the version number V1 of the data 1 of the object Obj in the first version history queue is greater than the empty second version history queue, and determines that no optimistic lock conflict is generated;
  • the object storage subsystem 21 does not receive the optimistic lock conflict returned by the KV subsystem 2, and determines that the data 1 of the object Obj is successfully stored, and at this time, the version history queue of the object Obj in DC2 is NULL->V1;
  • the client Client B sends a storage request to the data center DC2 for storing the data 2 of the object Obj; meanwhile, the client Client A sends a storage request to the data center DC1 for storing the object Obj.
  • DC2 receives the storage request, and the load balancing module 2 in DC2 allocates the storage request to the object storage subsystem 21 in DC2 for processing;
  • DC1 receives the storage request, and the load balancing module 1 in DC1 allocates the storage request to the object storage in DC1.
  • the object storage subsystem 21 generates a version number V2 of the data 2 of the object Obj for the storage request; the object storage subsystem 11 generates a version number V3 of the data 3 of the object Obj for the storage request; wherein the reception time in the version number V2 is The receiving time in the version number V3 is the same, but the UUID in the version number V2 is smaller than the UUID in the version number V3;
  • the object storage subsystem 21 reads the version history queue of the object Obj in DC2 as NULL->V1; the object storage subsystem 21 adds the version number V2 to the end of the version history queue of the object Obj, constituting the first version history of the object Obj
  • the queue is NULL->V1->V2; the object storage subsystem 11 reads the version history queue of the object Obj in DC1 to be NULL->V1; the object storage subsystem 11 adds the version number V3 to the team of the version history queue of the object Obj.
  • the first version of the historical queue constituting the object Obj is NULL->V1->V3;
  • the object storage subsystem 21 calls the data 2 of the KV subsystem 2 in the DC2 storage object Obj, and sends a copy request to the data center DC1, which carries the data of the first version history queue NULL->V1->V2 and the object Obj. 2; the object storage subsystem 11 calls the data 3 of the KV subsystem 1 storage object Obj in DC1, and sends a copy request to the data center DC2, the copy request carrying the first version history queue NULL->V1->V3 and the object Obj Data 3;
  • the object storage subsystem 21 calls the data 2 of the object Vb subsystem 2 in the DC2 storage object Obj
  • the optimistic lock conflict returned by the KV subsystem 2 is not received, and the data 2 of the object Obj is determined to be successfully stored, and at this time, the object Obj of the DC2 is
  • the version history queue is NULL->V1->V2; when the object storage subsystem 11 calls the data 3 of the KV subsystem 1 storage object Obj in DC1, the optimistic lock conflict returned by the KV subsystem 1 is not received, and the data of the object Obj is determined. 3
  • the version history queue of the object Obj in DC1 is NULL->V1->V3;
  • the data center DC2 receives the copy request sent by the object storage subsystem 11, the load balancing module 1 in DC2 assigns the copy request to the object storage subsystem 21 in DC2; the data center DC1 receives the copy request sent by the object storage subsystem 21. , the load balancing module 1 in DC1 assigns the copy request to the object storage subsystem in DC1 11 processing;
  • the object storage subsystem 21 extracts the data 3 of the object Obj from the copy request and the first version history queue of the object Obj is NULL->V1->V3; the object storage subsystem 11 extracts the data of the object Obj from the copy request 2 And the first version history queue of the object Obj is NULL->V1->V2;
  • the object storage subsystem 21 calls the KV subsystem 2 in DC2 to respond to the copy request, and stores the data 3 of the object Obj;
  • the object storage subsystem 11 calls the KV subsystem 1 in DC2 to respond to the copy request, and stores the data 2 of the object Obj;
  • the second version history queue formed by reading the version number of the object Obj already existing in DC2 is NULL->V1->V2
  • the KV subsystem 1 stores the data 2 of the object Obj Reading the second version history queue formed by the version number of the object Obj existing in DC1 is NULL->V1->V3;
  • the KV subsystem 2 determines that the version number V3 of the data 3 of the object Obj in the first version history queue is greater than the version number of the second version history queue NULL->V1->V2, and determines that no optimistic lock conflict is generated; the KV subsystem 1 determining that the version number V2 of the data 2 of the object Obj in the first version history queue is not greater than V3 of the second version history queue ULL->V1->V3, determining that an optimistic lock conflict is generated;
  • the object storage subsystem 21 does not receive the optimistic lock conflict returned by the KV subsystem 2, and determines that the data 3 of the object Obj is successfully stored, and at this time, the version history queue of the object Obj in DC2 is NULL->V1->V2->V3;
  • the object storage subsystem 11 receives the optimistic lock conflict returned by the KV subsystem 1, and determines that the data 2 storage of the object Obj fails.
  • the object storage subsystem 11 compares the first version history queue NULL->V1->V2 with the second.
  • the version number in the version history queue NULL->V1->V3 merges the third version history queue NULL->V1->V2->V3; the object storage subsystem 11 stores the third version history queue as the object Obj Version history queue in DC1.
  • the data of the object Obj finally stored in DC1 and DC2 is data 3; the version history queue of the object Obj finally stored is NULL->V1->V2->V3.
  • the data storage method does not need to perform network resolution between the data centers DC1 and DC2, and each data center can achieve consistent data of the stored objects, thereby reducing network overhead.
  • the receiving time of the storage request in the version number is the local time of the data center that receives the storage request, and it is not necessary to accurately time the atomic clock of the global time precision synchronization through GPS, thereby reducing the difficulty of implementing the solution. And cost.
  • FIG. 3 is a schematic structural diagram of a data center according to an embodiment of the present invention.
  • the data center may include the following modules:
  • the reading module 310 is configured to: when storing the data of the object, read the second version history queue formed by the version number of the object already existing in the local end;
  • the determining module 320 is configured to determine whether the version number of the data of the object stored in the first version history queue is greater than the version number in the second version history queue;
  • the determining module 330 is configured to determine, when the determining module 320 determines that the version number of the data of the object stored in the first version historical queue is greater than the version number in the historical queue of the second version, determining that no optimistic lock conflict occurs.
  • the stored data of the object is successfully stored;
  • the version number includes a receiving time and a universal unique identification code UUID of the storage request for receiving the data of the storage object sent by the client; the version number after the receiving time is greater than the version number of the receiving time first.
  • the version number with a large UUID is larger than the version number with a smaller UUID.
  • the different storage requests of the object correspond to different data of the object, and different storage requests also correspond to different version numbers. Therefore, the data of the object corresponding to each storage request can be distinguished by the version number, and different storage can be determined according to the version number. Request new and old relationships for different data of the corresponding object.
  • the UUID is a Universally Unique Identifier (UUID), which is unique in a distributed system, that is, in each data center, and is identified by the current date, time, clock sequence, and globally unique IEEE machine. Number composition.
  • the first part of the UUID is related to time. For example, after a UUID is generated by the same data center, a UUID is generated after a few seconds, and the first part is different, and the others are the same. Even if different data centers receive the same two storage requests for the data of the object, the universal unique identifier is different. Therefore, the receiving time in the version number may be the local time of the data center that receives the storage request, and need not be Precise timing with precise time synchronization of atomic clocks around the world. This embodiment reduces the difficulty of implementing the data storage method and saves the cost of data storage because the data center does not strictly require the atomic clocks of the data centers to be synchronized with the global time to ensure the same time.
  • the data center shown in FIG. 3 further includes:
  • the first receiving module 340 is configured to receive a copy request sent by another data center before the reading module 310 reads the second version history queue formed by the version number of the object existing in the local end;
  • the extracting module 350 is configured to extract data of the object and a first version history queue of the object from the copy request;
  • the first storage module 360 is configured to store data of the object in response to the copy request.
  • the data center shown in FIG. 3 further includes:
  • the second receiving module 370 is configured to receive a storage request of the object before the reading module 310 reads the second version history queue formed by the version number of the object existing in the local end;
  • a generating module 380 configured to generate, according to the storage request, a version number of the data of the object to be stored this time;
  • the adding module 390 is configured to add a version number to the tail of the version history queue of the object, and constitute a first version history queue of the object;
  • the second storage module 390a is configured to store the data of the object in response to the storage request, and send a copy request to the other data center, where the copy request carries the first version history queue of the object.
  • the first receiving module 340 and the second receiving module 370 may be the same receiving module and perform different operations.
  • the determining module 330 is further configured to: when the determining module 320 determines that the version number of the data of the object stored in the first version history queue is not greater than the version number in the history queue of the second version, Determining that an optimistic lock conflict is generated, and the data storage of the object stored this time fails;
  • data center shown in Figure 3 further includes:
  • the comparison module 390b is configured to compare the version numbers of the first version history queue and the second version history queue, and merge and arrange the third version history queue;
  • the third storage module 390c is further configured to store the third version history queue to update the version history queue of the object in the local end.
  • the first storage module 360, the second storage module 390a, and the third storage module 390c may be the same storage module, and respectively perform different operations.
  • the comparison module 390b may include the following units:
  • a determining unit configured to determine, from the tail of the team to the order of the head, whether the first version number is the same in the first version history queue and the second version history queue;
  • a merging unit configured to: when the determining unit determines that the first version of the historical queue and the second version of the historical queue have the same version number, the first version of the historical queue is the same as the first version of the second version of the historical queue All the version numbers of the number to the end of the team are sorted, and the third version history queue is merged; the merging unit is further configured to determine, in the determining unit, that the first version of the historical queue does not have the first version number in the second version history queue. The first version history queue is sorted with all version numbers in the second version history queue, and the third version history queue is merged.
  • the first version history queue is the current latest version history queue.
  • the data center may store the first version history queue as the version history queue of the object, so as to be used when the data of the object is updated next time.
  • the reading module can read the second version history queue formed by the version number of the object existing in the local end when storing the data of the object; the determining module can determine the first version history queue. Whether the version number of the data stored in the object is greater than the version number in the second version history queue; the determining module is configured to determine, in the determining module, the version of the data of the object stored in the first version history queue When the number is greater than the version number in the history queue of the second version, it is determined that the optimistic lock conflict is not generated, and the data storage of the object stored in this time is successful; it can be seen that the version number of the data of the object that can be stored in the embodiment of the present invention can be If the version number of the object is greater than the version number of the object, the data stored in the object is successfully stored.
  • each storage request corresponds to a version number
  • the version number can be used to distinguish the old and new relationship of the data of the object corresponding to different storage requests
  • the version number of the data of the object stored in each data center in the object storage system is greater than
  • the existing version number of the object can be stored successfully, so that the data of the object stored in each data center is the latest data of the object received by the object storage system, thereby ensuring the data of the object in each data center.
  • FIG. 5 is another schematic structural diagram of a data center according to an embodiment of the present invention.
  • the data center includes a processor 410, a memory 420, and a transceiver 430.
  • the transceiver 430 is configured to transmit and receive data with and from an external device.
  • the number of processors 410 in the data center can be one or more.
  • processor 410, memory 420, and transceiver 430 may be coupled by a bus system or other means.
  • the data center can be used to perform the method shown in Figure 2. For the meanings and examples of the terms involved in the embodiment, reference may be made to the corresponding method embodiments described above. I will not repeat them here.
  • the program code is stored in the memory 420, and the processor 410 is configured to call the program code stored in the memory 420 for performing the following operations:
  • the version number includes a receiving time and a universal unique identifier UUID of the storage request for receiving data for storing the object sent by the client; the version number after the receiving time is greater than the version number of the receiving time, and the receiving time is the same
  • the version number of the UUID is larger than the version number of the UUID.
  • the processor 410 is configured to call the program code stored in the memory 420, and before the data center reads the second version history queue formed by the version number of the object existing in the local end, the following operations may be performed:
  • the data of the object is stored in response to the copy request.
  • the processor 410 is configured to call the program code stored in the memory 420, and before performing the second version history queue formed by the version number of the object existing in the local end, the following operations may be performed:
  • data of the object is stored and a copy request is sent to other data centers via the transceiver 430, the copy request carrying a first version history queue of the object.
  • the processor 410 is configured to invoke the program code stored in the memory 420, and determine that the version number of the data of the object stored in the first version history queue is not greater than the second version history queue.
  • the version number in , you can also do the following:
  • the third version history queue is stored to update the version history queue of the object at the local end.
  • the processor 410 is configured to invoke the program code stored in the memory 420, compare the version numbers in the first version history queue and the second version history queue, and combine and arrange the third version history queue.
  • the processor 410 is configured to invoke the program code stored in the memory 420, compare the version numbers in the first version history queue and the second version history queue, and combine and arrange the third version history queue.
  • the first version history queue and all the version numbers in the second version history queue are sorted to merge the third version history queue.

Abstract

A data storage method and a data centre, the data storage method comprising: a data centre reads a second version history queue composed of version numbers stored by an object in the present terminal (S101); determining whether a version number of data of the object presently stored in a first version history queue is greater than the version number in the second version history queue (S102); if said version number is greater than the version number in the second version history queue, then the data centre determines that an optimistic locking conflict is not produced, and the present storage of the data of the object is successful (S103). Hence, when the version number of data of an object presently being stored is greater than a version number already stored by the object, the present method can successfully store the data of the object presently being stored, greatly reducing network overheads compared to methods requiring data centres to reach a resolution for storage.

Description

一种数据存储方法及数据中心Data storage method and data center 技术领域Technical field
本发明涉及通信技术领域,具体涉及一种数据存储方法及数据中心。The present invention relates to the field of communications technologies, and in particular, to a data storage method and a data center.
背景技术Background technique
目前,云存储是一个以数据存储和管理为核心的云计算系统,使用者可以在任何时候、任何地点,通过可连网的终端连接到云中存取数据。其中,对象存储是云存储的核心,也称为基于对象的存储,对象存储系统最大的特点是对象名称是一个域名地址,一旦该域名被设置为公开,所有人都可以访问该对象。为了解决对象存储系统的容灾及可用性等问题,可以采用多数据中心的方案。At present, cloud storage is a cloud computing system with data storage and management as its core. Users can connect to the cloud to access data through networkable terminals at any time and any place. Among them, object storage is the core of cloud storage, also known as object-based storage. The biggest feature of the object storage system is that the object name is a domain name address. Once the domain name is set to be public, everyone can access the object. In order to solve the problems of disaster recovery and availability of the object storage system, a multi-data center solution can be adopted.
多数据中心的对象存储系统中,每个数据中心都可以处理客户端的业务请求,即可以将对象上传到任一个数据中心,也可以从任一个数据中心下载到同一个对象。其中,对象上传到任一个数据中心后,要保证每个数据中心最终存储的该对象的数据为同样的数据,才能使得从任一个数据中心下载该对象时,都能下载到相同的数据。因此,当对象存储系统中有上传对象的数据时,会启动一轮决议过程,若被大多数数据中心接受,则各数据中心会保存本次上传的该对象的数据,从而,使得从任一个数据中心下载该对象时,都能下载到相同的数据。然而,达成一轮决议需要各个数据中心进行多次网络交互,导致网络开销大。In the multi-data center object storage system, each data center can process the client's business request, that is, the object can be uploaded to any data center, or can be downloaded to the same object from any data center. After the object is uploaded to any data center, it is necessary to ensure that the data of the object finally stored in each data center is the same data, so that the same data can be downloaded when the object is downloaded from any data center. Therefore, when there is data of the uploaded object in the object storage system, a round of resolution process is started. If accepted by most data centers, each data center saves the data of the object uploaded this time, thereby making any one of the data When the data center downloads the object, it can download the same data. However, reaching a round of resolutions requires multiple network interactions in various data centers, resulting in large network overhead.
发明内容Summary of the invention
本发明实施例提供了一种数据存储方法及数据中心,可以降低网络开销。The embodiment of the invention provides a data storage method and a data center, which can reduce network overhead.
本发明实施例第一方面提供一种数据存储方法,应用于包括多个数据中心的对象存储系统,包括:数据中心存储对象的数据时,读取本端中对象已存在的版本号构成的第二版本历史队列;数据中心判断第一版本历史队列中本次存储的对象的数据的版本号是否大于第二版本历史队列中的版本号;若大于第二版本历史队列中的版本号,则数据中心确定未产生乐观锁冲突,本次存储的对象的数据存储成功。A first aspect of the embodiments of the present invention provides a data storage method, which is applied to an object storage system including a plurality of data centers, and includes: when the data center stores the data of the object, the first version of the version number of the object in the local end is read. The second version of the history queue; the data center determines whether the version number of the data of the object stored in the first version history queue is greater than the version number in the second version history queue; if the version number in the second version history queue is greater than the version number, the data is The center determines that no optimistic lock conflict has occurred, and the data storage of the object stored this time is successful.
其中,版本号包括接收到客户端发送的用于存储对象的数据的存储请求的接收时间和通用唯一识别码UUID;接收时间在后的版本号大于接收时间在先的版本号,针对接收时间相同的版本号,UUID大的版本号大于UUID小的版本号。对象的不同存储请求对应对象的不同数据,不同的对象的数据对应不同的版本号,因此,可以通过版本号区别每一个存储请求对应的对象的数据,并且,可以根据该版本号确定不同存储请求对应的对象的不同数据的新旧关系。其中,UUID为通用唯一识别码(Universally Unique Identifier,UUID),该UUID在分布式系统中,即各个数据中心中都是唯一的,由当前的日期、时间、时钟序列以及全局唯一的IEEE机器识别号构成。其中,UUID的第一个部分与时间有关,例如,同一个数据中心生成一个UUID之后,过几秒又生成一个UUID,则第一个部分不同,其余相同。即使不同的数据中心接收到该对象的数据的两个存储请求的时间相同,但通用唯一识别码不同,因此,版本号中的接收时间可以为接收到存储请求的数据中心的本地时间,不必是全 球时间精准同步的原子钟确定的精准授时。该实施方式由于不严格要求各数据中心采用全球时间精准同步的原子钟保证时间一致,从而降低了数据存储方法的实现难度,节约数据存储的成本。The version number includes a receiving time and a universal unique identifier UUID of the storage request for receiving data for storing the object sent by the client; the version number after the receiving time is greater than the version number of the receiving time, and the receiving time is the same. The version number of the UUID is larger than the version number of the UUID. The different storage requests of the object correspond to different data of the object, and the data of different objects correspond to different version numbers. Therefore, the data of the object corresponding to each storage request can be distinguished by the version number, and different storage requests can be determined according to the version number. The old and new relationship of the different data of the corresponding object. The UUID is a Universally Unique Identifier (UUID), which is unique in a distributed system, that is, in each data center, and is identified by the current date, time, clock sequence, and globally unique IEEE machine. Number composition. The first part of the UUID is related to time. For example, after a UUID is generated by the same data center, a UUID is generated after a few seconds, and the first part is different, and the others are the same. Even if different data centers receive the same two storage requests for the data of the object, the universal unique identifier is different. Therefore, the receiving time in the version number may be the local time of the data center that receives the storage request, and need not be Full The precise timing of the atomic clock determined by the precise synchronization of the ball time. This embodiment reduces the difficulty of implementing the data storage method and saves the cost of data storage because the data center does not strictly require the atomic clocks of the data centers to be synchronized with the global time to ensure the same time.
可见,该发明实施例可以在本次存储的该对象的数据的版本号大于该对象已存在的版本号时,将本次存储的该对象的数据存储成功,与需要达成一轮决议进行存储的方法相比,大大降低了网络开销。另外,每个存储请求对应一个版本号,该版本号可用于区别不同存储请求对应的对象的数据的新旧关系,对象存储系统中每个数据中心在本次存储的该对象的数据的版本号大于该对象已存在的版本号时才能存储成功,使得每个数据中心每次存储的该对象的数据为对象存储系统接收的该对象的最新数据,保证了各数据中心中该对象的数据的一致。It can be seen that, in the embodiment of the present invention, when the version number of the data of the object stored in the current time is greater than the version number of the object already existing, the data of the object stored in the current storage is successfully stored, and a round of resolution is required to be stored. Compared to the method, the network overhead is greatly reduced. In addition, each storage request corresponds to a version number, and the version number can be used to distinguish the old and new relationship of the data of the object corresponding to different storage requests, and the version number of the data of the object stored in each data center in the object storage system is greater than The existing version number of the object can be stored successfully, so that the data of the object stored in each data center is the latest data of the object received by the object storage system, and the data of the object in each data center is consistent.
在第一方面的第一种可能的实现方式中,数据中心读取本端中对象已存在的版本号构成的第二版本历史队列之前,数据中心可以接收其他数据中心发送的复制请求;从复制请求中提取对象的数据以及对象的第一版本历史队列;响应复制请求,存储对象的数据。该实施方式可以将其他数据中心接收到的对象的数据也同步到本数据中心中。In a first possible implementation manner of the first aspect, before the data center reads the second version history queue formed by the version number of the object existing in the local end, the data center may receive the copy request sent by the other data center; The request extracts the data of the object and the first version history queue of the object; in response to the copy request, the data of the object is stored. This embodiment can also synchronize the data of the objects received by other data centers into the data center.
结合第一方面的实现方式,在第一方面的第二种可能的实现方式中,数据中心读取本端中对象已存在的版本号构成的第二版本历史队列之前,接收对象的存储请求;数据中心针对存储请求生成本次待存储的对象的数据的版本号;数据中心将版本号添加到对象的版本历史队列的队尾,构成对象的第一版本历史队列;数据中心响应存储请求,存储对象的数据,并向其他数据中心发送复制请求,复制请求携带对象的第一版本历史队列。该实施方式不仅可以将本数据中心接收到的存储请求中的对象的数据存储起来,还可以给其他数据中心发送复制请求,使得其他数据也可以根据复制请求同步存储该对象的数据。In conjunction with the implementation of the first aspect, in a second possible implementation manner of the first aspect, the data center receives the storage request of the object before reading the second version history queue formed by the version number of the object existing in the local end; The data center generates a version number of the data of the object to be stored for the storage request; the data center adds the version number to the tail of the version history queue of the object, constitutes the first version history queue of the object; the data center responds to the storage request, and stores The object's data, and sends a copy request to the other data center, the copy request carries the first version of the object's historical queue. This embodiment can not only store the data of the object in the storage request received by the data center, but also send a copy request to other data centers, so that other data can also synchronously store the data of the object according to the copy request.
结合第一方面的实现方式,或者第一方面的第一种或第二种可能的实现方式,在第一方面的第三种可能的实现方式中,数据中心在判断出第一版本历史队列中本次存储的对象的数据的版本号不大于第二版本历史队列中的版本号,可以确定产生乐观锁冲突,本次存储的对象的数据存储失败;然后,数据中心可以比较第一版本历史队列与第二版本历史队列中的版本号,合并排列出第三版本历史队列;存储第三版本历史队列以更新本端对象的版本历史队列。其中,数据中心可以在出现乐观锁冲突,确定本次存储的对象的数据为过期数据,但为了保证本数据中心及时更新该对象的版本历史队列,依旧可以将第一版本历史队列与本端该对象已存在的版本号构成的第二版本历史队列合并,得到第三版本历史队列,来更新本端中该对象的版本历史队列。With reference to the implementation of the first aspect, or the first or second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the data center is determined in the first version history queue The version number of the data of the stored object is not greater than the version number in the history queue of the second version, and it can be determined that an optimistic lock conflict occurs, and the data storage of the object stored this time fails; then, the data center can compare the first version of the historical queue. The third version history queue is merged with the version number in the second version history queue; the third version history queue is stored to update the version history queue of the local object. The data center may be in an optimistic lock conflict, and the data of the object to be stored is determined to be expired data. However, in order to ensure that the data center updates the version history queue of the object in time, the first version of the historical queue and the local end may still be used. The second version history queue formed by the existing version number of the object is merged to obtain a third version history queue to update the version history queue of the object in the local end.
相应地,无论是存储请求触发数据中心存储数据还是复制请求触发数据中心存储数据,若数据中心确定未产生乐观锁冲突,则表示第一版本历史队列为当前的最新的版本历史队列,数据中心可以存储该第一版本历史队列作为该对象的版本历史队列,以便于下次更新该对象的数据时使用。Correspondingly, whether the storage request triggers the data center storage data or the replication request triggers the data center to store the data, if the data center determines that no optimistic lock conflict occurs, the first version history queue is the current latest version history queue, and the data center can The first version history queue is stored as a version history queue for the object to be used when the data of the object is updated next time.
结合第一方面的第三种可能的实现方式中,在第一方面的第四种可能的实现方式中, 数据中心比较第一版本历史队列与第二版本历史队列中的版本号,合并排列出第三版本历史队列,可以具体为:数据中心从队尾向对头的顺序,确定第一版本历史队列与第二版本历史队列中是否存在第一个相同的版本号;若存在第一个相同的版本号,则数据中心将第一版本历史队列与第二版本历史队列中第一个相同的版本号到队尾的所有版本号进行排序,合并出第三版本历史队列;若不存在第一个相同的版本号,则数据中心将第一版本历史队列与第二版本历史队列中的所有版本号进行排序,合并出第三版本历史队列。In conjunction with the third possible implementation of the first aspect, in a fourth possible implementation of the first aspect, The data center compares the version number of the first version of the historical queue with the second version of the historical queue, and aligns the third version of the historical queue, which may be specifically: the order of the data center from the tail to the head, and determining the first version of the historical queue and the first Whether the first version number is the same in the second version history queue; if there is the first version number, the data center will match the first version history queue with the first version number in the second version history queue. All version numbers of the tail are sorted, and the third version history queue is merged; if the first version number is not present, the data center sorts the first version history queue and all version numbers in the second version history queue. The third version history queue is merged.
本发明实施例第二方面提供了一种数据中心,该数据中心具有实现上述第一方面提供的方法的行为功能,所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。A second aspect of the embodiments of the present invention provides a data center, where the data center has a behavior function for implementing the method provided by the foregoing first aspect, and the function may be implemented by using hardware or by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
附图说明DRAWINGS
施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The drawings used in the embodiments are briefly described. It is obvious that the drawings in the following description are only some embodiments of the present invention, and those skilled in the art, without any creative work, Other drawings can also be obtained from these figures.
图1是本发明实施例公开的一种对象存储系统的示意图;1 is a schematic diagram of an object storage system according to an embodiment of the present invention;
图2是本发明实施例公开的一种数据存储方法的流程示意图;2 is a schematic flowchart of a data storage method according to an embodiment of the present invention;
图3是本发明实施例公开的数据中心的一种结构示意图;3 is a schematic structural diagram of a data center disclosed in an embodiment of the present invention;
图4是本发明实施例公开的数据中心的另一结构示意图。FIG. 4 is another schematic structural diagram of a data center according to an embodiment of the present invention.
具体实施方式detailed description
为了便于理解本发明实施例,下面先对本发明实施例的应用场景进行描述。请参阅图1,图1是本发明实施例公开的一种对象存储系统的示意图。如图1所示,本发明实施例中,对象存储系统可以包括多个数据中心,本发明实施例以两个数据中心DC1、DC2为例,每个数据中心可以包括负载均衡模块(Load Balancing,LB)、对象存储子系统以及KV(Key-Value)子系统,其中,负载均衡子系统用于将客户端Client A、Client B的存储请求分别分配对各个对象存储子系统,避免某个对象存储子系统的负载过大;对象存储子系统负责为对象的数据分配版本号并将对象的多个版本号进行排序;KV子系统负责将对象的数据存储或写入到磁盘中。如图1所示,每个数据中心都可以接收客户端上传的存储请求,无论存储请求从哪个数据中心上传,对象存储系统中各数据中心都可以采用本发明实施例提供的数据存储方法,存储该对象的数据并降低网络开销。以下分别进行详细说明。In order to facilitate the understanding of the embodiments of the present invention, the application scenarios of the embodiments of the present invention are described below. Please refer to FIG. 1. FIG. 1 is a schematic diagram of an object storage system according to an embodiment of the present invention. As shown in FIG. 1 , in the embodiment of the present invention, the object storage system may include multiple data centers. In the embodiment of the present invention, two data centers DC1 and DC2 are taken as an example, and each data center may include a load balancing module (Load Balancing, LB), an object storage subsystem, and a KV (Key-Value) subsystem, wherein the load balancing subsystem is configured to allocate storage requests of client Client A and Client B to respective object storage subsystems to avoid storage of an object. The load on the subsystem is too large; the object storage subsystem is responsible for assigning the version number to the object's data and sorting the multiple version numbers of the object; the KV subsystem is responsible for storing or writing the object's data to disk. As shown in FIG. 1 , each data center can receive a storage request uploaded by a client, and the data storage method provided by the embodiment of the present invention can be used in each data center of the object storage system, regardless of which data center is uploaded from the data storage system. The object's data and reduces network overhead. The details are described below separately.
请参阅图2,图2是本发明实施例公开的一种数据存储方法,如图2所示,该数据存储方法包括以下步骤:Referring to FIG. 2, FIG. 2 is a data storage method according to an embodiment of the present invention. As shown in FIG. 2, the data storage method includes the following steps:
S101、数据中心存储对象的数据时,读取本端中该对象已存在的版本号构成的第二版本历史队列;S101. The data center stores the data of the object, and reads a second version history queue formed by the version number of the object existing in the local end;
S102、数据中心判断第一版本历史队列中本次存储的该对象的数据的版本号是否大于 第二版本历史队列中的版本号;若大于第二版本历史队列中的版本号,则执行步骤S103;若不大于第二版本历史队列中的版本号,则结束本流程。S102. The data center determines whether the version number of the data of the object stored in the first version history queue is greater than The version number in the second version of the historical queue; if it is greater than the version number in the second version history queue, step S103 is performed; if it is not greater than the version number in the second version history queue, the process ends.
S103、数据中心确定未产生乐观锁冲突,本次存储的该对象的数据存储成功。S103. The data center determines that an optimistic lock conflict is not generated, and the data storage of the object stored this time is successful.
本发明实施例中,步骤S101至S103的执行主体也可以为数据中心的对象存储子系统或者数据中心的服务器等,本发明实施例不做限定。In the embodiment of the present invention, the execution body of the steps S101 to S103 may also be an object storage subsystem of the data center or a server of the data center, etc., which is not limited by the embodiment of the present invention.
本发明实施例中,版本号包括接收到客户端发送的用于存储对象的数据的存储请求的接收时间和通用唯一识别码UUID;接收时间在后的版本号大于接收时间在先的版本号,针对接收时间相同的版本号,UUID大的版本号大于UUID小的版本号。其中,对象的不同存储请求对应对象的不同数据,对象的不同数据对应不同的版本号,因此,可以通过版本号区别每一个存储请求对应的对象的数据,并且,可以根据该版本号确定不同存储请求对应的对象的不同数据的新旧关系。其中,UUID为通用唯一识别码(Universally Unique Identifier,UUID),该UUID在分布式系统中,即各个数据中心中都是唯一的,由当前的日期、时间、时钟序列以及全局唯一的IEEE机器识别号构成。其中,UUID的第一个部分与时间有关,例如,同一个数据中心生成一个UUID之后,过几秒又生成一个UUID,则第一个部分不同,其余相同。即使不同的数据中心接收到该对象的数据的两个存储请求的时间相同,但通用唯一识别码不同,因此,版本号中的接收时间可以为接收到存储请求的数据中心的本地时间,不必是全球时间精准同步的原子钟确定的精准授时。该实施方式由于不严格要求各数据中心采用全球时间精准同步的原子钟保证时间一致,从而降低了数据存储方法的实现难度,节约数据存储的成本。In the embodiment of the present invention, the version number includes a receiving time and a universal unique identification code UUID of the storage request for receiving the data of the storage object sent by the client; the version number after the receiving time is greater than the version number of the receiving time first. For the version number with the same receiving time, the version number with a large UUID is larger than the version number with a smaller UUID. The different storage requests of the object correspond to different data of the object, and the different data of the object corresponds to different version numbers. Therefore, the data of the object corresponding to each storage request can be distinguished by the version number, and different storage can be determined according to the version number. Request new and old relationships for different data of the corresponding object. The UUID is a Universally Unique Identifier (UUID), which is unique in a distributed system, that is, in each data center, and is identified by the current date, time, clock sequence, and globally unique IEEE machine. Number composition. The first part of the UUID is related to time. For example, after a UUID is generated by the same data center, a UUID is generated after a few seconds, and the first part is different, and the others are the same. Even if different data centers receive the same two storage requests for the data of the object, the universal unique identifier is different. Therefore, the receiving time in the version number may be the local time of the data center that receives the storage request, and need not be Precise timing with precise time synchronization of atomic clocks around the world. This embodiment reduces the difficulty of implementing the data storage method and saves the cost of data storage because the data center does not strictly require the atomic clocks of the data centers to be synchronized with the global time to ensure the same time.
可选地,数据中心读取本端中对象已存在的版本号构成的第二版本历史队列之前,还可以包括以下步骤:Optionally, before the data center reads the second version history queue formed by the version number of the object existing in the local end, the method may further include the following steps:
11)数据中心接收其他数据中心发送的复制请求;11) The data center receives the copy request sent by other data centers;
12)数据中心从该复制请求中提取对象的数据以及该对象的第一版本历史队列;12) the data center extracts the data of the object from the copy request and the first version history queue of the object;
13)数据中心响应该复制请求,存储该对象的数据。13) The data center responds to the copy request and stores the data of the object.
该实施方式中,存储的数据来自其他数据中心同步的数据,从而保证各数据中心的数据一致。In this embodiment, the stored data comes from data synchronized by other data centers, thereby ensuring data consistency in each data center.
可选地,数据中心存储对象的数据也可以为客户端向本数据中心发送的存储请求所对应的对象的数据,可以包括以下步骤:Optionally, the data of the data center storage object may also be the data of the object corresponding to the storage request sent by the client to the data center, and may include the following steps:
21)数据中心接收对象的存储请求;21) the data center receives the storage request of the object;
22)数据中心针对该存储请求生成该对象的版本号;22) the data center generates a version number of the object for the storage request;
23)数据中心将该版本号添加到该对象的版本历史队列的队尾,构成该对象的第一版 本历史队列;23) The data center adds the version number to the end of the object's version history queue, forming the first version of the object. This historical queue;
24)数据中心响应该存储请求,存储该对象的数据,并向其他数据中心发送复制请求。24) The data center responds to the storage request, stores the data of the object, and sends a copy request to the other data center.
其中,该复制请求用于将存储请求对应的对象的数据同步写入到其他数据中心,该复制请求携带对象的第一版本历史队列。其中,版本号包括该版本号对应的存储请求的接收时间和UUID;该接收时间是本数据中心待存储的对象的数据所对应的存储请求的接收时间。The copy request is used to synchronously write data of an object corresponding to the storage request to another data center, where the copy request carries a first version history queue of the object. The version number includes a receiving time and a UUID of the storage request corresponding to the version number; the receiving time is a receiving time of the storage request corresponding to the data of the object to be stored in the data center.
本发明实施例中,数据中心在存储对象的数据时,若没有该对象,则该对象的版本历史队列为空,NULL;若已经存在该对象,则该对象的版本历史队列不为空。举例来说,数据中心针对该存储请求生成的版本号为V2,若数据中心在该存储请求之前的版本历史队列为NULL,那么第一版本历史队列为NULL->V2;若数据中心在该存储请求之前的版本历史队列为NULL->V1,那么第一版本历史队列为NULL->V1->V2。另外,版本历史队列中位于靠近对头的版本号小于位于靠近队尾的版本号,新生成的版本号可以直接添加到版本历史对列的队尾,构成第一版本历史队列。In the embodiment of the present invention, when the data center stores the data of the object, if the object does not exist, the version history queue of the object is empty, NULL; if the object already exists, the version history queue of the object is not empty. For example, the version number generated by the data center for the storage request is V2. If the version history queue of the data center before the storage request is NULL, the first version history queue is NULL->V2; if the data center is in the storage The version history queue before the request is NULL->V1, then the first version history queue is NULL->V1->V2. In addition, the version number in the version history queue located near the head is smaller than the version number located near the end of the queue, and the newly generated version number can be directly added to the tail of the version history pair column to form the first version history queue.
本发明实施例中,第一版本历史队列为数据中心在接收到存储请求时,生成针对待存储的对象的数据的版本号后,将该版本号添加到该数据中心已存储的或者已存在的该对象的版本历史队列的队尾而构成的;第二版本历史队列是数据中心各自存储的或已存在的该对象的版本历史队列。例如,数据中心DC1接收到存储请求时,可以生成针对该存储请求待存储的对象的数据的版本号,并将该版本号添加到DC1中该对象的版本历史队列的队尾,构成第一版本历史队列;数据中心DC2接收到DC1发送的复制请求时,可以提取出第一版本历史队列,并读取DC2中已存在的该对象的版本号构成的第二版本历史队列,DC2根据该第一版本历史队列和第二版本历史队列存储该存储请求对应的该对象的数据。In the embodiment of the present invention, when the data center receives the storage request, the data center generates a version number for the object to be stored, and adds the version number to the data center that has been stored or already exists. The end of the version history queue of the object is formed; the second version history queue is a version history queue of the object stored or existing in the data center. For example, when receiving the storage request, the data center DC1 may generate a version number of the data of the object to be stored for the storage request, and add the version number to the tail of the version history queue of the object in DC1 to form the first version. The history queue; when the data center DC2 receives the copy request sent by the DC1, the first version history queue can be extracted, and the second version history queue of the version number of the object already existing in the DC2 is read, and the DC2 is based on the first The version history queue and the second version history queue store data of the object corresponding to the storage request.
本发明实施例中,若数据中心判断出第一版本历史队列中本次存储的对象的数据的版本号不大于第二版本历史队列中的版本号,该数据存储方法还可以包括以下步骤:In the embodiment of the present invention, if the data center determines that the version number of the data of the object stored in the first version of the history queue is not greater than the version number in the history queue of the second version, the data storage method may further include the following steps:
31)数据中心确定产生乐观锁冲突,所述本次存储的所述对象的数据存储失败;31) the data center determines to generate an optimistic lock conflict, and the data storage of the object stored in the current storage fails;
32)数据中心比较第一版本历史队列与第二版本历史队列中的版本号,合并排列出第三版本历史队列;32) The data center compares the version numbers of the first version history queue with the second version history queue, and merges and lists the third version history queue;
33)数据中心存储第三版本历史队列以更新本端中该对象的版本历史队列。33) The data center stores the third version history queue to update the version history queue of the object in the local end.
该实施方式中,数据中心存储该第三版本历史队列,以便于下次更新该对象的数据时,将该第三版本历史队列作为该对象在该数据中心中已存在的版本历史队列。In this implementation manner, the data center stores the third version history queue, so that when the data of the object is updated next time, the third version history queue is used as the version history queue of the object that already exists in the data center.
举例来说,场景1为:数据中心DC1接收到对象的存储请求,生成的版本号为V1;DC1已经存在的该对象的版本历史队列为NULL,则第一版本历史队列为NULL->V1。For example, scenario 1 is: the data center DC1 receives the storage request of the object, and the generated version number is V1; if the version history queue of the object that already exists in DC1 is NULL, the first version history queue is NULL->V1.
针对场景1,DC1读取的第二版本历史队列为NULL,DC1判断出第一版本历史对列中 版本号V1大于第二版本历史队列中的NULL,因此,DC1确定未产生乐观锁冲突,故DC1可以将版本号V1对应的该对象的数据存储成功。For scenario 1, the second version history queue read by DC1 is NULL, and DC1 determines the history of the first version in the column. The version number V1 is greater than the NULL in the second version history queue. Therefore, DC1 determines that no optimistic lock conflict is generated, so DC1 can successfully store the data of the object corresponding to the version number V1.
举例来说,场景2为:数据中心DC1接收到数据中心DC2发送的复制请求,该复制请求用于将DC2接收的存储请求对应的对象的数据同步写入到DC1,该复制请求携带该对象的第一版本历史队列为NULL->V1,DC1已经存在的该对象的版本历史队列为NULL,其中,版本号V1为DC2针对其接收的存储请求对应的对象的数据生成的。For example, the scenario 2 is: the data center DC1 receives the copy request sent by the data center DC2, and the copy request is used to synchronously write the data of the object corresponding to the storage request received by the DC2 to the DC1, where the copy request carries the object. The first version history queue is NULL->V1, and the version history queue of the object already existing by DC1 is NULL, wherein the version number V1 is generated by DC2 for the data of the object corresponding to the storage request it receives.
针对场景2,DC1读取的第二版本历史队列为NULL,DC1判断出第一版本历史对列中版本号V1大于第二版本历史队列中的NULL,因此,DC1确定未产生乐观锁冲突,可以将版本号V1对应的该对象的数据存储成功。For scene 2, the second version history queue read by DC1 is NULL. DC1 determines that the version number V1 in the first version history pair column is greater than the NULL value in the second version history queue. Therefore, DC1 determines that no optimistic lock conflict occurs. The data of the object corresponding to the version number V1 is successfully stored.
举例来说,场景3为:数据中心DC1接收到同一个对象的两个存储请求,针对这两个存储请求生成的版本号分别为V1、V2,其中,版本号V1对应的存储请求的接收时间先于版本号V2对应的存储请求的接收时间,因此版本号V1小于版本号V2,DC1已经存在的该对象的版本历史队列为NULL。For example, the scenario 3 is: the data center DC1 receives two storage requests of the same object, and the version numbers generated for the two storage requests are respectively V1 and V2, wherein the storage request receiving time corresponding to the version number V1 is received. Prior to the receiving time of the storage request corresponding to the version number V2, the version number V1 is smaller than the version number V2, and the version history queue of the object already existing by DC1 is NULL.
针对该场景3,DC1先存储版本号V1对应的该对象的数据,确定第一版本历史队列为NULL->V1,读取的第二版本历史队列为NULL,DC1判断出第一版本历史对列中版本号V1大于第二版本历史队列中的NULL,因此,DC1确定未产生乐观锁冲突,DC1可以将版本号V1对应的该对象的数据存储成功;其次,DC1存储版本号V2对应的该对象的数据,确定第一版本历史队列为NULL->V1->V2,读取的第二版本历史队列为NULL->V1,DC1判断出第一版本历史对列中版本号V2大于第二版本历史队列中的版本号V1,因此,DC1确定未产生乐观锁冲突,DC1可以将版本号V2对应的该对象的数据存储成功。For the scenario 3, DC1 first stores the data of the object corresponding to the version number V1, and determines that the first version history queue is NULL->V1, and the read second version history queue is NULL, and DC1 determines the first version history pair column. The medium version number V1 is greater than the NULL in the second version history queue. Therefore, the DC1 determines that the optimistic lock conflict is not generated, and the DC1 can successfully store the data of the object corresponding to the version number V1. Second, the DC1 stores the object corresponding to the version number V2. The data determines that the first version history queue is NULL->V1->V2, and the read second version history queue is NULL->V1, and DC1 determines that the version number V2 in the first version history is greater than the second version history. The version number V1 in the queue, therefore, DC1 determines that no optimistic lock conflict is generated, and DC1 can successfully store the data of the object corresponding to the version number V2.
举例来说,场景4为:数据中心DC1接收到对象的存储请求,生成的版本号为V3,DC1已经存在的该对象的版本历史队列为NULL->V1->V2,则第一版本历史队列为NULL->V1->V2->V3。For example, in scenario 4, the data center DC1 receives the storage request of the object, and the generated version number is V3. The version history queue of the object that already exists in DC1 is NULL->V1->V2, and the first version history queue is NULL->V1->V2->V3.
针对场景4,DC1读取的第二版本历史队列为NULL->V1->V2,DC1判断出第一版本历史对列中的版本号V3大于第二版本历史队列中的各版本号,因此,DC1确定未产生乐观锁冲突,DC1可以将版本号V3对应的该对象的数据存储成功。For scenario 4, the second version history queue read by DC1 is NULL->V1->V2, and DC1 determines that the version number V3 in the first version history pair column is greater than each version number in the second version history queue, therefore, DC1 determines that no optimistic lock conflict is generated, and DC1 can successfully store the data of the object corresponding to version number V3.
举例来说,场景5为:数据中心DC1接收到数据中心DC2发送的复制请求,该复制请求用于将DC2接收的存储请求对应的对象的数据同步写入到DC1,该复制请求携带该对象的第一版本历史队列为NULL->V1->V2,DC1已经存在的该对象的版本历史队列为NULL->V1,其中,版本号V2为DC2针对其接收的存储请求对应的对象的数据生成的。For example, the scenario 5 is: the data center DC1 receives the copy request sent by the data center DC2, and the copy request is used to synchronously write the data of the object corresponding to the storage request received by the DC2 to the DC1, where the copy request carries the object. The first version history queue is NULL->V1->V2, and the version history queue of the object already existing by DC1 is NULL->V1, wherein the version number V2 is generated by DC2 for the data of the object corresponding to the storage request it receives. .
针对场景5,DC1读取的第二版本历史队列为NULL->V1,DC1判断出第一版本历史对列的队尾的版本号V2大于第二版本历史队列中队尾的V1,因此,DC1确定未产生乐观锁冲突,DC1可以将版本号V2对应的该对象的数据存储成功。 For scenario 5, the second version history queue read by DC1 is NULL->V1, and DC1 determines that the version number V2 of the tail of the first version history column is greater than the V1 of the tail of the second version history queue, therefore, DC1 is determined. The optimistic lock conflict is not generated, and DC1 can successfully store the data of the object corresponding to the version number V2.
举例来说,场景6为:数据中心DC1接收到对象的存储请求,生成的版本号为V1;同时,数据中心DC2接收到同一对象的存储请求,生成的版本号为V2,DC1和DC2中已经存在的该对象的版本历史队列均为NULL,并且版本号V1大于版本号V2(即,数据中心DC1和数据中心DC2虽然同时接收到存储请求,但两者生成的版本号中UUID不同,V1的UUID大于V2的UUID)。For example, scenario 6 is: the data center DC1 receives the storage request of the object, and the generated version number is V1; meanwhile, the data center DC2 receives the storage request of the same object, and the generated version number is V2, and the DC1 and DC2 are already The existing version history queue of the object is NULL, and the version number V1 is greater than the version number V2 (ie, the data center DC1 and the data center DC2 receive the storage request at the same time, but the UUID is different in the version number generated by the two, V1 UUID is greater than the UUID of V2).
针对上述场景6,首先,DC1在存储版本号V1对应的对象的数据时,第一版本历史队列为NULL->V1,第二版本历史队列为NULL,根据版本号比较规则,判断出第一版本历史队列中V1大于第二版本历史队列中的NULL,确定未产生乐观锁冲突,DC1将版本号V1对应的对象的数据存储成功;其次,DC1接收到DC2发送的复制请求,在存储版本号V2对应的对象的数据时,第一版本历史队列为NULL->V2,此时第二版本历史队列为NULL->V1(即DC1存储成功版本号V1对应的对象的数据时,该对象的版本历史队列就为存储版本号V1对应的对象的数据时的第一版本历史队列NULL->V1),由于第一版本历史队列中V2小于第二版本历史队列中的V1,确定产生乐观锁冲突,DC1将版本号V2对应的对象的数据存储失败,版本号V2对应的数据为过期数据,因此,DC1从队尾向对头的顺序,确定第一版本历史队列与第二版本历史队列中不存在相同的版本号;将第一版本历史队列与第二版本历史队列中的所有版本号进行排序,即对版本号V2和版本号V1排序;版本号V1大于版本号V2,故第三版本历史队列为NULL->V2->V1,DC1存储该第三版本历史队列将本端该对象的版本历史队列更新为NULL->V2->V1。For the scenario 6 above, first, when DC1 stores the data of the object corresponding to the version number V1, the first version history queue is NULL->V1, and the second version history queue is NULL, and the first version is determined according to the version number comparison rule. The V1 in the history queue is larger than the NULL in the history queue of the second version, and it is determined that the optimistic lock conflict is not generated. DC1 stores the data of the object corresponding to the version number V1 successfully. Secondly, the DC1 receives the copy request sent by the DC2, and stores the version number V2. The data of the corresponding object is the NULL->V2 of the first version. The history queue of the second version is NULL->V1 (that is, the data of the object corresponding to the successful version number V1 is stored by DC1). The queue is the first version history queue NULL->V1 when storing the data of the object corresponding to the version number V1. Since V2 in the first version history queue is smaller than V1 in the second version history queue, it is determined that an optimistic lock conflict occurs, DC1 The data of the object corresponding to the version number V2 fails to be stored, and the data corresponding to the version number V2 is expired data. Therefore, the order of the DC1 from the tail to the head determines the first version of the historical queue and the second. The same version number does not exist in the history queue; all the version numbers in the first version history queue and the second version history queue are sorted, that is, the version number V2 and the version number V1 are sorted; the version number V1 is greater than the version number V2, Therefore, the third version history queue is NULL->V2->V1, and DC1 stores the third version history queue to update the version history queue of the object to NULL->V2->V1.
举例来说,场景7为:数据中心DC1接收到对象的存储请求,生成的版本号为V1;同时,数据中心DC2接收到同一对象的存储请求,生成的版本号为V2,DC1和DC2中已经存在的该对象的版本历史队列均为NULL,并且版本号V1小于版本号V2(即,虽然数据中心DC1和数据中心DC2同时接收到存储请求,但两者生成的版本号中UUID不同,V1的UUID小于V2的UUID)。For example, scenario 7 is: the data center DC1 receives the storage request of the object, and the generated version number is V1; meanwhile, the data center DC2 receives the storage request of the same object, and the generated version number is V2, and the DC1 and DC2 have already been generated. The existing version history queue of the object is NULL, and the version number V1 is smaller than the version number V2 (that is, although the data center DC1 and the data center DC2 receive the storage request at the same time, the UUID in the version number generated by the two is different, V1 UUID is less than the UUID of V2).
针对上述场景7,首先,DC1在存储版本号V1对应的对象的数据时,第一版本历史队列为NULL->V1,第二版本历史队列为NULL,第一版本历史队列中V1大于第二版本历史队列中的NULL,确定未产生乐观锁冲突,DC1将版本号V1对应的对象的数据存储成功;其次,DC1接收到DC2发送的复制请求,在存储版本号V2对应的对象的数据时,第一版本历史队列为NULL->V2,此时第二版本历史队列为NULL->V1(即DC1在存储成功版本号V1对应的对象的数据时,该对象的版本历史队列就为存储版本号V1对应的对象的数据时的第一版本历史队列NULL->V1);第一版本历史队列中V2大于第二版本历史队列中的V1,确定未产生乐观锁冲突,DC1将版本号V2对应的对象的数据存储成功。For the scenario 7 above, first, when DC1 stores the data of the object corresponding to the version number V1, the first version history queue is NULL->V1, the second version history queue is NULL, and the first version history queue has V1 greater than the second version. NULL in the history queue determines that no optimistic lock conflict is generated. DC1 stores the data of the object corresponding to version number V1 successfully. Secondly, DC1 receives the copy request sent by DC2, and stores the data of the object corresponding to version number V2. The version history queue of the version is NULL->V2. In this case, the history queue of the second version is NULL->V1 (that is, when the data of the object corresponding to the successful version number V1 is stored by DC1, the version history queue of the object is the storage version number V1. The first version history queue of the corresponding object data is NULL->V1); V2 in the first version history queue is larger than V1 in the second version history queue, and it is determined that no optimistic lock conflict is generated, and DC1 will be the object corresponding to the version number V2. The data was stored successfully.
需要注意的是,无论是存储请求触发的DC1存储数据还是复制请求触发的DC1存储数据,若DC1确定未产生乐观锁冲突,则表示第一版本历史队列为当前的最新的版本历史队列,DC1可以存储该第一版本历史队列作为该对象的版本历史队列,以便于下次更新该对象的数据时使用。It should be noted that whether the DC1 storage data triggered by the storage request or the DC1 storage data triggered by the replication request, if DC1 determines that no optimistic lock conflict is generated, it indicates that the first version history queue is the current latest version history queue, and DC1 can The first version history queue is stored as a version history queue for the object to be used when the data of the object is updated next time.
图2所示的数据存储方法在存储对象的数据时,可以读取本端中该对象已存在的版本 号构成的第二版本历史队列;数据中心判断第一版本历史队列中本次存储的该对象的数据的版本号是否大于第二版本历史队列中的版本号;若大于第二版本历史队列中的版本号,则数据中心确定未产生乐观锁冲突,本次存储的该对象的数据存储成功;可见,该发明实施例可以在本次存储的该对象的数据的版本号大于该对象已存在的版本号时,将本次存储的该对象的数据存储成功,与需要达成一轮决议进行存储的方法相比,大大降低了网络开销。另外,每个存储请求对应一个版本号,该版本号可用于区别不同存储请求对应的对象的数据的新旧关系,对象存储系统中每个数据中心在本次存储的该对象的数据的版本号大于该对象已存在的版本号时才能存储成功,使得每个数据中心每次存储的该对象的数据为对象存储系统接收的该对象的最新数据,保证了各数据中心中该对象的数据的一致。The data storage method shown in FIG. 2 can read the existing version of the object in the local end when storing the data of the object. The second version of the history queue is configured by the data center; the data center determines whether the version number of the data stored in the first version of the historical queue is greater than the version number in the history queue of the second version; The version number, the data center determines that the optimistic lock conflict is not generated, and the stored data of the object is successfully stored. It can be seen that the version number of the data of the object stored in the present embodiment is greater than the version of the object that already exists. When the number is stored, the data of the object stored in this storage is successfully stored, and the network overhead is greatly reduced compared with the method that needs to achieve a round of resolution for storage. In addition, each storage request corresponds to a version number, and the version number can be used to distinguish the old and new relationship of the data of the object corresponding to different storage requests, and the version number of the data of the object stored in each data center in the object storage system is greater than The existing version number of the object can be stored successfully, so that the data of the object stored in each data center is the latest data of the object received by the object storage system, and the data of the object in each data center is consistent.
本发明实施例以图1中的对象存储系统为例,对数据存储方法进行详细阐述,可以包括以下步骤:The embodiment of the present invention takes the object storage system in FIG. 1 as an example, and describes the data storage method in detail, which may include the following steps:
客户端Client A向数据中心DC1发送存储请求,该存储请求用于存储对象Obj的数据1;The client Client A sends a storage request to the data center DC1, and the storage request is used to store the data 1 of the object Obj;
DC1接收到存储请求,DC1中负载均衡模块1将该存储请求分配给DC1中对象存储子系统11处理;DC1 receives the storage request, and the load balancing module 1 in DC1 allocates the storage request to the object storage subsystem 11 in DC1 for processing;
对象存储子系统11针对该存储请求生成对象Obj的数据1的版本号V1;The object storage subsystem 11 generates a version number V1 of the data 1 of the object Obj for the storage request;
对象存储子系统11读取DC1中对象Obj的版本历史队列为NULL;The object storage subsystem 11 reads the version history queue of the object Obj in DC1 to be NULL;
对象存储子系统11将版本号V1添加到对象Obj的版本历史队列的队尾,构成对象Obj的第一版本历史队列为NULL->V1;The object storage subsystem 11 adds the version number V1 to the tail of the version history queue of the object Obj, and the first version history queue constituting the object Obj is NULL->V1;
对象存储子系统11调用DC1中KV子系统1存储对象Obj的数据1,并向数据中心DC2发送复制请求,该复制请求中携带第一版本历史队列NULL->V1以及对象Obj的数据1;The object storage subsystem 11 calls the data 1 of the KV subsystem 1 storage object Obj in DC1, and sends a copy request to the data center DC2, the copy request carrying the first version history queue NULL->V1 and the data 1 of the object Obj;
对象存储子系统11调用DC1中KV子系统1存储对象Obj的数据1时,未收到KV子系统1返回的乐观锁冲突,确定对象Obj的数据1存储成功,并且此时DC1中对象Obj的版本历史队列为NULL->V1;When the object storage subsystem 11 calls the data 1 of the KV subsystem 1 storage object Obj in DC1, the optimistic lock conflict returned by the KV subsystem 1 is not received, and the data 1 of the object Obj is determined to be successfully stored, and at this time, the object Obj of the DC1 is The version history queue is NULL->V1;
数据中心DC2接收到对象存储子系统11发送的复制请求,DC2中负载均衡模块1将该复制请求分配给DC2中对象存储子系统21处理;The data center DC2 receives the copy request sent by the object storage subsystem 11, and the load balancing module 1 in DC2 allocates the copy request to the object storage subsystem 21 in DC2 for processing;
对象存储子系统21从复制请求中提取出对象Obj的数据1以及对象Obj的第一版本历史队列为NULL->V1;The object storage subsystem 21 extracts the data 1 of the object Obj from the copy request and the first version history queue of the object Obj is NULL->V1;
对象存储子系统21调用DC2中KV子系统2响应复制请求,存储对象Obj的数据1; The object storage subsystem 21 calls the KV subsystem 2 in DC2 to respond to the copy request, and stores the data 1 of the object Obj;
KV子系统2存储对象Obj的数据1时,读取DC2中对象Obj已存在的版本号构成的第二版本历史队列为NULL;When the KV subsystem 2 stores the data 1 of the object Obj, the second version history queue formed by reading the version number of the object Obj already existing in the DC2 is NULL;
KV子系统2判断出第一版本历史队列中对象Obj的数据1的版本号V1大于空的第二版本历史队列,确定未产生乐观锁冲突;The KV subsystem 2 determines that the version number V1 of the data 1 of the object Obj in the first version history queue is greater than the empty second version history queue, and determines that no optimistic lock conflict is generated;
对象存储子系统21未收到KV子系统2返回的乐观锁冲突,确定对象Obj的数据1存储成功,并且此时DC2中对象Obj的版本历史队列为NULL->V1;The object storage subsystem 21 does not receive the optimistic lock conflict returned by the KV subsystem 2, and determines that the data 1 of the object Obj is successfully stored, and at this time, the version history queue of the object Obj in DC2 is NULL->V1;
此时,客户端Client B向数据中心DC2发送存储请求,该存储请求用于存储对象Obj的数据2;同时,客户端Client A向数据中心DC1发送存储请求,该存储请求用于存储对象Obj的数据3;At this time, the client Client B sends a storage request to the data center DC2 for storing the data 2 of the object Obj; meanwhile, the client Client A sends a storage request to the data center DC1 for storing the object Obj. Data 3;
DC2接收到存储请求,DC2中负载均衡模块2将该存储请求分配给DC2中对象存储子系统21处理;DC1接收到存储请求,DC1中负载均衡模块1将该存储请求分配给DC1中对象存储子系统11处理;DC2 receives the storage request, and the load balancing module 2 in DC2 allocates the storage request to the object storage subsystem 21 in DC2 for processing; DC1 receives the storage request, and the load balancing module 1 in DC1 allocates the storage request to the object storage in DC1. System 11 processing;
对象存储子系统21针对该存储请求生成对象Obj的数据2的版本号V2;对象存储子系统11针对该存储请求生成对象Obj的数据3的版本号V3;其中,版本号V2中的接收时间与版本号V3中的接收时间相同,但版本号V2中的UUID小于版本号V3中的UUID;The object storage subsystem 21 generates a version number V2 of the data 2 of the object Obj for the storage request; the object storage subsystem 11 generates a version number V3 of the data 3 of the object Obj for the storage request; wherein the reception time in the version number V2 is The receiving time in the version number V3 is the same, but the UUID in the version number V2 is smaller than the UUID in the version number V3;
对象存储子系统21读取DC2中对象Obj的版本历史队列为NULL->V1;对象存储子系统21将版本号V2添加到对象Obj的版本历史队列的队尾,构成对象Obj的第一版本历史队列为NULL->V1->V2;对象存储子系统11读取DC1中对象Obj的版本历史队列为NULL->V1;对象存储子系统11将版本号V3添加到对象Obj的版本历史队列的队尾,构成对象Obj的第一版本历史队列为NULL->V1->V3;The object storage subsystem 21 reads the version history queue of the object Obj in DC2 as NULL->V1; the object storage subsystem 21 adds the version number V2 to the end of the version history queue of the object Obj, constituting the first version history of the object Obj The queue is NULL->V1->V2; the object storage subsystem 11 reads the version history queue of the object Obj in DC1 to be NULL->V1; the object storage subsystem 11 adds the version number V3 to the team of the version history queue of the object Obj. At the end, the first version of the historical queue constituting the object Obj is NULL->V1->V3;
对象存储子系统21调用DC2中KV子系统2存储对象Obj的数据2,并向数据中心DC1发送复制请求,该复制请求中携带第一版本历史队列NULL->V1->V2以及对象Obj的数据2;对象存储子系统11调用DC1中KV子系统1存储对象Obj的数据3,并向数据中心DC2发送复制请求,该复制请求中携带第一版本历史队列NULL->V1->V3以及对象Obj的数据3;The object storage subsystem 21 calls the data 2 of the KV subsystem 2 in the DC2 storage object Obj, and sends a copy request to the data center DC1, which carries the data of the first version history queue NULL->V1->V2 and the object Obj. 2; the object storage subsystem 11 calls the data 3 of the KV subsystem 1 storage object Obj in DC1, and sends a copy request to the data center DC2, the copy request carrying the first version history queue NULL->V1->V3 and the object Obj Data 3;
对象存储子系统21调用DC2中KV子系统2存储对象Obj的数据2时,未收到KV子系统2返回的乐观锁冲突,确定对象Obj的数据2存储成功,并且此时DC2中对象Obj的版本历史队列为NULL->V1->V2;对象存储子系统11调用DC1中KV子系统1存储对象Obj的数据3时,未收到KV子系统1返回的乐观锁冲突,确定对象Obj的数据3存储成功,并且此时DC1中对象Obj的版本历史队列为NULL->V1->V3;When the object storage subsystem 21 calls the data 2 of the object Vb subsystem 2 in the DC2 storage object Obj, the optimistic lock conflict returned by the KV subsystem 2 is not received, and the data 2 of the object Obj is determined to be successfully stored, and at this time, the object Obj of the DC2 is The version history queue is NULL->V1->V2; when the object storage subsystem 11 calls the data 3 of the KV subsystem 1 storage object Obj in DC1, the optimistic lock conflict returned by the KV subsystem 1 is not received, and the data of the object Obj is determined. 3 The storage is successful, and the version history queue of the object Obj in DC1 is NULL->V1->V3;
数据中心DC2接收到对象存储子系统11发送的复制请求,DC2中负载均衡模块1将该复制请求分配给DC2中对象存储子系统21处理;数据中心DC1接收到对象存储子系统21发送的复制请求,DC1中负载均衡模块1将该复制请求分配给DC1中对象存储子系统 11处理;The data center DC2 receives the copy request sent by the object storage subsystem 11, the load balancing module 1 in DC2 assigns the copy request to the object storage subsystem 21 in DC2; the data center DC1 receives the copy request sent by the object storage subsystem 21. , the load balancing module 1 in DC1 assigns the copy request to the object storage subsystem in DC1 11 processing;
对象存储子系统21从复制请求中提取出对象Obj的数据3以及对象Obj的第一版本历史队列为NULL->V1->V3;对象存储子系统11从复制请求中提取出对象Obj的数据2以及对象Obj的第一版本历史队列为NULL->V1->V2;The object storage subsystem 21 extracts the data 3 of the object Obj from the copy request and the first version history queue of the object Obj is NULL->V1->V3; the object storage subsystem 11 extracts the data of the object Obj from the copy request 2 And the first version history queue of the object Obj is NULL->V1->V2;
对象存储子系统21调用DC2中KV子系统2响应复制请求,存储对象Obj的数据3;对象存储子系统11调用DC2中KV子系统1响应复制请求,存储对象Obj的数据2;The object storage subsystem 21 calls the KV subsystem 2 in DC2 to respond to the copy request, and stores the data 3 of the object Obj; the object storage subsystem 11 calls the KV subsystem 1 in DC2 to respond to the copy request, and stores the data 2 of the object Obj;
KV子系统2存储对象Obj的数据3时,读取DC2中对象Obj已存在的版本号构成的第二版本历史队列为NULL->V1->V2;KV子系统1存储对象Obj的数据2时,读取DC1中对象Obj已存在的版本号构成的第二版本历史队列为NULL->V1->V3;When the KV subsystem 2 stores the data 3 of the object Obj, the second version history queue formed by reading the version number of the object Obj already existing in DC2 is NULL->V1->V2; when the KV subsystem 1 stores the data 2 of the object Obj Reading the second version history queue formed by the version number of the object Obj existing in DC1 is NULL->V1->V3;
KV子系统2判断出第一版本历史队列中对象Obj的数据3的版本号V3大于其第二版本历史队列NULL->V1->V2中的版本号,确定未产生乐观锁冲突;KV子系统1判断出第一版本历史队列中对象Obj的数据2的版本号V2不大于其第二版本历史队列ULL->V1->V3中的V3,确定产生乐观锁冲突;The KV subsystem 2 determines that the version number V3 of the data 3 of the object Obj in the first version history queue is greater than the version number of the second version history queue NULL->V1->V2, and determines that no optimistic lock conflict is generated; the KV subsystem 1 determining that the version number V2 of the data 2 of the object Obj in the first version history queue is not greater than V3 of the second version history queue ULL->V1->V3, determining that an optimistic lock conflict is generated;
对象存储子系统21未收到KV子系统2返回的乐观锁冲突,确定对象Obj的数据3存储成功,并且此时DC2中对象Obj的版本历史队列为NULL->V1->V2->V3;对象存储子系统11收到KV子系统1返回的乐观锁冲突,确定对象Obj的数据2存储失败,此时,对象存储子系统11比较第一版本历史队列NULL->V1->V2与第二版本历史队列NULL->V1->V3中的版本号,合并排列出第三版本历史队列NULL->V1->V2->V3;对象存储子系统11存储该第三版本历史队列作为对象Obj在DC1中的版本历史队列。The object storage subsystem 21 does not receive the optimistic lock conflict returned by the KV subsystem 2, and determines that the data 3 of the object Obj is successfully stored, and at this time, the version history queue of the object Obj in DC2 is NULL->V1->V2->V3; The object storage subsystem 11 receives the optimistic lock conflict returned by the KV subsystem 1, and determines that the data 2 storage of the object Obj fails. At this time, the object storage subsystem 11 compares the first version history queue NULL->V1->V2 with the second. The version number in the version history queue NULL->V1->V3 merges the third version history queue NULL->V1->V2->V3; the object storage subsystem 11 stores the third version history queue as the object Obj Version history queue in DC1.
可见,DC1和DC2中最终存储的对象Obj的数据均为数据3;最终存储的该对象Obj的版本历史队列均为NULL->V1->V2->V3。该数据存储方法不必在数据中心DC1和DC2之间进行网络决议,各数据中心就可以实现所存储的对象的数据一致,降低了网络开销。另外,该实施方式中版本号中存储请求的接收时间为接收到存储请求的数据中心的本地时间,而不必是通过GPS实现全球时间精准同步的原子钟的精准授时,从而,降低了方案的实施难度及成本。It can be seen that the data of the object Obj finally stored in DC1 and DC2 is data 3; the version history queue of the object Obj finally stored is NULL->V1->V2->V3. The data storage method does not need to perform network resolution between the data centers DC1 and DC2, and each data center can achieve consistent data of the stored objects, thereby reducing network overhead. In addition, in this embodiment, the receiving time of the storage request in the version number is the local time of the data center that receives the storage request, and it is not necessary to accurately time the atomic clock of the global time precision synchronization through GPS, thereby reducing the difficulty of implementing the solution. And cost.
请参阅图3,图3是本发明实施例公开的一种数据中心的结构示意图,该数据中心可以包括以下模块:Please refer to FIG. 3. FIG. 3 is a schematic structural diagram of a data center according to an embodiment of the present invention. The data center may include the following modules:
读取模块310,用于在存储对象的数据时,读取本端中该对象已存在的版本号构成的第二版本历史队列;The reading module 310 is configured to: when storing the data of the object, read the second version history queue formed by the version number of the object already existing in the local end;
判断模块320,用于判断第一版本历史队列中本次存储的所述对象的数据的版本号是否大于第二版本历史队列中的版本号; The determining module 320 is configured to determine whether the version number of the data of the object stored in the first version history queue is greater than the version number in the second version history queue;
确定模块330,用于在判断模块320判断出第一版本历史队列中本次存储的该对象的数据的版本号大于第二版本历史队列中的版本号时,确定未产生乐观锁冲突,本次存储的所述对象的数据存储成功;The determining module 330 is configured to determine, when the determining module 320 determines that the version number of the data of the object stored in the first version historical queue is greater than the version number in the historical queue of the second version, determining that no optimistic lock conflict occurs. The stored data of the object is successfully stored;
本发明实施例中,版本号包括接收到客户端发送的用于存储对象的数据的存储请求的接收时间和通用唯一识别码UUID;接收时间在后的版本号大于接收时间在先的版本号,针对接收时间相同的版本号,UUID大的版本号大于UUID小的版本号。其中,对象的不同存储请求对应对象的不同数据,不同存储请求还对应不同的版本号,因此,可以通过版本号区别每一个存储请求对应的对象的数据,并且,可以根据该版本号确定不同存储请求对应的对象的不同数据的新旧关系。其中,UUID为通用唯一识别码(Universally Unique Identifier,UUID),该UUID在分布式系统中,即各个数据中心中都是唯一的,由当前的日期、时间、时钟序列以及全局唯一的IEEE机器识别号构成。其中,UUID的第一个部分与时间有关,例如,同一个数据中心生成一个UUID之后,过几秒又生成一个UUID,则第一个部分不同,其余相同。即使不同的数据中心接收到该对象的数据的两个存储请求的时间相同,但通用唯一识别码不同,因此,版本号中的接收时间可以为接收到存储请求的数据中心的本地时间,不必是全球时间精准同步的原子钟确定的精准授时。该实施方式由于不严格要求各数据中心采用全球时间精准同步的原子钟保证时间一致,从而降低了数据存储方法的实现难度,节约数据存储的成本。In the embodiment of the present invention, the version number includes a receiving time and a universal unique identification code UUID of the storage request for receiving the data of the storage object sent by the client; the version number after the receiving time is greater than the version number of the receiving time first. For the version number with the same receiving time, the version number with a large UUID is larger than the version number with a smaller UUID. The different storage requests of the object correspond to different data of the object, and different storage requests also correspond to different version numbers. Therefore, the data of the object corresponding to each storage request can be distinguished by the version number, and different storage can be determined according to the version number. Request new and old relationships for different data of the corresponding object. The UUID is a Universally Unique Identifier (UUID), which is unique in a distributed system, that is, in each data center, and is identified by the current date, time, clock sequence, and globally unique IEEE machine. Number composition. The first part of the UUID is related to time. For example, after a UUID is generated by the same data center, a UUID is generated after a few seconds, and the first part is different, and the others are the same. Even if different data centers receive the same two storage requests for the data of the object, the universal unique identifier is different. Therefore, the receiving time in the version number may be the local time of the data center that receives the storage request, and need not be Precise timing with precise time synchronization of atomic clocks around the world. This embodiment reduces the difficulty of implementing the data storage method and saves the cost of data storage because the data center does not strictly require the atomic clocks of the data centers to be synchronized with the global time to ensure the same time.
本发明实施例中,图3所示的数据中心还包括:In the embodiment of the present invention, the data center shown in FIG. 3 further includes:
第一接收模块340,用于在读取模块310读取本端中对象已存在的版本号构成的第二版本历史队列之前,接收其他数据中心发送的复制请求;The first receiving module 340 is configured to receive a copy request sent by another data center before the reading module 310 reads the second version history queue formed by the version number of the object existing in the local end;
提取模块350,用于从复制请求中提取对象的数据以及该对象的第一版本历史队列;The extracting module 350 is configured to extract data of the object and a first version history queue of the object from the copy request;
第一存储模块360,用于响应该复制请求,存储该对象的数据。The first storage module 360 is configured to store data of the object in response to the copy request.
本发明实施例中,图3所示的数据中心还包括:In the embodiment of the present invention, the data center shown in FIG. 3 further includes:
第二接收模块370,用于在读取模块310读取本端中对象已存在的版本号构成的第二版本历史队列之前,接收对象的存储请求;The second receiving module 370 is configured to receive a storage request of the object before the reading module 310 reads the second version history queue formed by the version number of the object existing in the local end;
生成模块380,用于针对存储请求生成本次待存储的所述对象的数据的版本号;a generating module 380, configured to generate, according to the storage request, a version number of the data of the object to be stored this time;
添加模块390,用于将版本号添加到对象的版本历史队列的队尾,构成该对象的第一版本历史队列;The adding module 390 is configured to add a version number to the tail of the version history queue of the object, and constitute a first version history queue of the object;
第二存储模块390a,用于响应存储请求,存储对象的数据,并向其他数据中心发送复制请求,复制请求携带所述对象的第一版本历史队列。The second storage module 390a is configured to store the data of the object in response to the storage request, and send a copy request to the other data center, where the copy request carries the first version history queue of the object.
本发明实施例中,第一接收模块340和第二接收模块370可以为同一个接收模块,执行不同的操作。 In the embodiment of the present invention, the first receiving module 340 and the second receiving module 370 may be the same receiving module and perform different operations.
本发明实施例中,确定模块330,还用于在判断模块320判断出第一版本历史队列中本次存储的所述对象的数据的版本号不大于第二版本历史队列中的版本号时,确定产生乐观锁冲突,本次存储的所述对象的数据存储失败;In the embodiment of the present invention, the determining module 330 is further configured to: when the determining module 320 determines that the version number of the data of the object stored in the first version history queue is not greater than the version number in the history queue of the second version, Determining that an optimistic lock conflict is generated, and the data storage of the object stored this time fails;
进而,图3所示的数据中心还包括:Furthermore, the data center shown in Figure 3 further includes:
比较模块390b,用于比较第一版本历史队列与第二版本历史队列中的版本号,合并排列出第三版本历史队列;The comparison module 390b is configured to compare the version numbers of the first version history queue and the second version history queue, and merge and arrange the third version history queue;
第三存储模块390c,还用于存储第三版本历史队列以更新本端中该对象的版本历史队列。The third storage module 390c is further configured to store the third version history queue to update the version history queue of the object in the local end.
本发明实施例中,第一存储模块360、第二存储模块390a及第三存储模块390c可以为同一个存储模块,分别执行不同的操作。In the embodiment of the present invention, the first storage module 360, the second storage module 390a, and the third storage module 390c may be the same storage module, and respectively perform different operations.
本发明实施例中,比较模块390b可以包括以下单元:In the embodiment of the present invention, the comparison module 390b may include the following units:
确定单元,用于从队尾向对头的顺序,确定第一版本历史队列与第二版本历史队列中是否存在第一个相同的版本号;a determining unit, configured to determine, from the tail of the team to the order of the head, whether the first version number is the same in the first version history queue and the second version history queue;
合并单元,用于在确定单元确定第一版本历史队列与第二版本历史队列中存在第一个相同的版本号时,将第一版本历史队列与第二版本历史队列中第一个相同的版本号到队尾的所有版本号进行排序,合并出第三版本历史队列;合并单元,还用于在确定单元确定第一版本历史队列与第二版本历史队列中不存在第一个相同的版本号,将第一版本历史队列与第二版本历史队列中的所有版本号进行排序,合并出第三版本历史队列。a merging unit, configured to: when the determining unit determines that the first version of the historical queue and the second version of the historical queue have the same version number, the first version of the historical queue is the same as the first version of the second version of the historical queue All the version numbers of the number to the end of the team are sorted, and the third version history queue is merged; the merging unit is further configured to determine, in the determining unit, that the first version of the historical queue does not have the first version number in the second version history queue. The first version history queue is sorted with all version numbers in the second version history queue, and the third version history queue is merged.
需要注意的是,无论是存储请求触发的数据中心存储数据还是复制请求触发的数据中心存储数据,若数据中心确定未产生乐观锁冲突,则表示第一版本历史队列为当前的最新的版本历史队列,数据中心可以存储该第一版本历史队列作为该对象的版本历史队列,以便于下次更新该对象的数据时使用。It should be noted that whether the data center storage data triggered by the storage request or the data center storage data triggered by the replication request, if the data center determines that no optimistic lock conflict occurs, the first version history queue is the current latest version history queue. The data center may store the first version history queue as the version history queue of the object, so as to be used when the data of the object is updated next time.
图3所示的数据中心中,读取模块可以在存储对象的数据时,读取本端中该对象已存在的版本号构成的第二版本历史队列;判断模块,可以判断第一版本历史队列中本次存储的该对象的数据的版本号是否大于第二版本历史队列中的版本号;确定模块,用于在判断模块判断出第一版本历史队列中本次存储的该对象的数据的版本号大于第二版本历史队列中的版本号时,确定未产生乐观锁冲突,本次存储的该对象的数据存储成功;可见,该发明实施例可以在本次存储的该对象的数据的版本号大于该对象已存在的版本号时,将本次存储的该对象的数据存储成功,与需要达成一轮决议进行存储的方法相比,大大降低了网络开销。另外,每个存储请求对应一个版本号,该版本号可用于区别不同存储请求对应的对象的数据的新旧关系,对象存储系统中每个数据中心在本次存储的该对象的数据的版本号大于该对象已存在的版本号时才能存储成功,使得每个数据中心每次存储的该对象的数据为对象存储系统接收的该对象的最新数据,从而保证了各数据中心中该对象的数据的一 致。In the data center shown in FIG. 3, the reading module can read the second version history queue formed by the version number of the object existing in the local end when storing the data of the object; the determining module can determine the first version history queue. Whether the version number of the data stored in the object is greater than the version number in the second version history queue; the determining module is configured to determine, in the determining module, the version of the data of the object stored in the first version history queue When the number is greater than the version number in the history queue of the second version, it is determined that the optimistic lock conflict is not generated, and the data storage of the object stored in this time is successful; it can be seen that the version number of the data of the object that can be stored in the embodiment of the present invention can be If the version number of the object is greater than the version number of the object, the data stored in the object is successfully stored. Compared with the method that needs to achieve a round of resolution for storage, the network overhead is greatly reduced. In addition, each storage request corresponds to a version number, and the version number can be used to distinguish the old and new relationship of the data of the object corresponding to different storage requests, and the version number of the data of the object stored in each data center in the object storage system is greater than The existing version number of the object can be stored successfully, so that the data of the object stored in each data center is the latest data of the object received by the object storage system, thereby ensuring the data of the object in each data center. To.
本发明实施例和所述的方法实施例基于同一构思,其中的实施方式带来的技术效果也相同,具体过程可参照上述方法实施例的描述。The embodiments of the present invention and the method embodiments are based on the same concept, and the technical effects brought by the embodiments are also the same. For the specific process, reference may be made to the description of the foregoing method embodiments.
请参阅图5,图5是本发明实施例公开的数据中心的另一结构示意图,在本发明实施例中,数据中心包括处理器410、存储器420和收发器430。收发器430用于与外部设备之间收发数据。数据中心中的处理器410的数量可以是一个或多个。本发明的一些实施例中,处理器410、存储器420和收发器430可通过总线系统或其他方式连接。数据中心可以用于执行图2所示的方法。关于本实施例涉及的术语的含义以及举例,可以参考上述对应的方法实施例。此处不再赘述。Referring to FIG. 5, FIG. 5 is another schematic structural diagram of a data center according to an embodiment of the present invention. In the embodiment of the present invention, the data center includes a processor 410, a memory 420, and a transceiver 430. The transceiver 430 is configured to transmit and receive data with and from an external device. The number of processors 410 in the data center can be one or more. In some embodiments of the invention, processor 410, memory 420, and transceiver 430 may be coupled by a bus system or other means. The data center can be used to perform the method shown in Figure 2. For the meanings and examples of the terms involved in the embodiment, reference may be made to the corresponding method embodiments described above. I will not repeat them here.
其中,存储器420中存储程序代码,处理器410用于调用存储器420中存储的程序代码,用于执行以下操作:The program code is stored in the memory 420, and the processor 410 is configured to call the program code stored in the memory 420 for performing the following operations:
存储对象的数据时,读取本端中所述对象已存在的版本号构成的第二版本历史队列;When storing the data of the object, reading the second version history queue formed by the version number of the object existing in the local end;
判断第一版本历史队列中本次存储的所述对象的数据的版本号是否大于所述第二版本历史队列中的版本号;Determining whether a version number of the data of the object stored in the first version history queue is greater than a version number in the second version history queue;
若大于所述第二版本历史队列中的版本号,则确定未产生乐观锁冲突,所述本次存储的所述对象的数据存储成功;If it is greater than the version number in the second version history queue, it is determined that an optimistic lock conflict is not generated, and the data storage of the object stored in the current storage is successful;
所述版本号包括接收到客户端发送的用于存储对象的数据的存储请求的接收时间和通用唯一识别码UUID;接收时间在后的版本号大于接收时间在先的版本号,针对接收时间相同的版本号,UUID大的版本号大于UUID小的版本号。The version number includes a receiving time and a universal unique identifier UUID of the storage request for receiving data for storing the object sent by the client; the version number after the receiving time is greater than the version number of the receiving time, and the receiving time is the same The version number of the UUID is larger than the version number of the UUID.
本发明实施例中,处理器410用于调用存储器420中存储的程序代码,数据中心读取本端中所述对象已存在的版本号构成的第二版本历史队列之前,还可以执行以下操作:In the embodiment of the present invention, the processor 410 is configured to call the program code stored in the memory 420, and before the data center reads the second version history queue formed by the version number of the object existing in the local end, the following operations may be performed:
通过收发器430接收其他数据中心发送的复制请求;Receiving a copy request sent by another data center through the transceiver 430;
从所述复制请求中提取对象的数据以及所述对象的第一版本历史队列;Extracting data of the object and the first version history queue of the object from the copy request;
响应所述复制请求,存储所述对象的数据。The data of the object is stored in response to the copy request.
本发明实施例中,处理器410用于调用存储器420中存储的程序代码,读取本端中所述对象已存在的版本号构成的第二版本历史队列之前,还可以执行以下操作:In the embodiment of the present invention, the processor 410 is configured to call the program code stored in the memory 420, and before performing the second version history queue formed by the version number of the object existing in the local end, the following operations may be performed:
接收对象的存储请求;Receiving a storage request of the object;
针对所述存储请求生成本次待存储的所述对象的数据的版本号; Generating a version number of the data of the object to be stored this time for the storage request;
将所述版本号添加到所述对象的版本历史队列的队尾,构成所述对象的第一版本历史队列;Adding the version number to the tail of the version history queue of the object to form a first version history queue of the object;
响应所述存储请求,存储所述对象的数据,并通过收发器430向其他数据中心发送复制请求,所述复制请求携带所述对象的第一版本历史队列。In response to the storage request, data of the object is stored and a copy request is sent to other data centers via the transceiver 430, the copy request carrying a first version history queue of the object.
本发明实施例中,处理器410用于调用存储器420中存储的程序代码,在判断出第一版本历史队列中本次存储的所述对象的数据的版本号不大于所述第二版本历史队列中的版本号,还可以执行以下操作:In the embodiment of the present invention, the processor 410 is configured to invoke the program code stored in the memory 420, and determine that the version number of the data of the object stored in the first version history queue is not greater than the second version history queue. The version number in , you can also do the following:
确定产生乐观锁冲突,所述本次存储的所述对象的数据存储失败;Determining that an optimistic lock conflict is generated, and the data storage of the object stored this time fails;
比较所述第一版本历史队列与所述第二版本历史队列中的版本号,合并排列出第三版本历史队列;Comparing the version numbers of the first version history queue and the second version history queue, and arranging the third version history queues;
存储所述第三版本历史队列以更新本端所述对象的版本历史队列。The third version history queue is stored to update the version history queue of the object at the local end.
本发明实施例中,处理器410用于调用存储器420中存储的程序代码,比较所述第一版本历史队列与所述第二版本历史队列中的版本号,合并排列出第三版本历史队列,可以具体为:In the embodiment of the present invention, the processor 410 is configured to invoke the program code stored in the memory 420, compare the version numbers in the first version history queue and the second version history queue, and combine and arrange the third version history queue. Can be specifically:
从队尾向对头的顺序,确定所述第一版本历史队列与所述第二版本历史队列中是否存在第一个相同的版本号;Determining, from the tail of the team to the order of the head, whether the first version number is the same in the first version history queue and the second version history queue;
若存在第一个相同的版本号,则将所述第一版本历史队列与所述第二版本历史队列中所述第一个相同的版本号到队尾的所有版本号进行排序,合并出第三版本历史队列;If there is a first identical version number, sorting the first version history queue with the first version number of the first version in the second version history queue to all version numbers at the end of the queue, and merging the same Three version history queue;
若不存在第一个相同的版本号,则将所述第一版本历史队列与所述第二版本历史队列中的所有版本号进行排序,合并出第三版本历史队列。If the first version number is not the same, the first version history queue and all the version numbers in the second version history queue are sorted to merge the third version history queue.
以上对本发明实施例公开的一种数据存储方法及数据中心进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。 The data storage method and the data center disclosed in the embodiments of the present invention are described in detail above. The principles and implementation manners of the present invention are described in the following. The description of the above embodiments is only used to help understand the present invention. The method and its core idea; at the same time, those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. In summary, the content of the specification should not be understood as Limitations of the invention.

Claims (10)

  1. 一种数据存储方法,应用于包括多个数据中心的对象存储系统,其特征在于,包括:A data storage method is applied to an object storage system including a plurality of data centers, and includes:
    数据中心存储对象的数据时,读取本端中所述对象已存在的版本号构成的第二版本历史队列;When the data center stores the data of the object, the second version history queue formed by the version number of the object existing in the local end is read;
    所述数据中心判断第一版本历史队列中本次存储的所述对象的数据的版本号是否大于所述第二版本历史队列中的版本号;Determining, by the data center, whether a version number of the data of the object stored in the first version history queue is greater than a version number in the second version history queue;
    若大于所述第二版本历史队列中的版本号,则所述数据中心确定未产生乐观锁冲突,所述本次存储的所述对象的数据存储成功;If the version number is greater than the version number in the second version history queue, the data center determines that an optimistic lock conflict is not generated, and the data storage of the object stored in the current storage is successful;
    所述版本号包括接收到客户端发送的用于存储对象的数据的存储请求的接收时间和通用唯一识别码UUID;接收时间在后的版本号大于接收时间在先的版本号,针对接收时间相同的版本号,UUID大的版本号大于UUID小的版本号。The version number includes a receiving time and a universal unique identifier UUID of the storage request for receiving data for storing the object sent by the client; the version number after the receiving time is greater than the version number of the receiving time, and the receiving time is the same The version number of the UUID is larger than the version number of the UUID.
  2. 根据权利要求1所述的方法,其特征在于,所述数据中心读取本端中所述对象已存在的版本号构成的第二版本历史队列之前,所述方法还包括:The method according to claim 1, wherein the method further comprises: before the data center reads the second version history queue formed by the version number of the object that exists in the local end, the method further includes:
    所述数据中心接收其他数据中心发送的复制请求;The data center receives a copy request sent by another data center;
    从所述复制请求中提取对象的数据以及所述对象的第一版本历史队列;Extracting data of the object and the first version history queue of the object from the copy request;
    响应所述复制请求,存储所述对象的数据。The data of the object is stored in response to the copy request.
  3. 根据权利要求1所述的方法,其特征在于,所述数据中心读取本端中所述对象已存在的版本号构成的第二版本历史队列之前,所述方法还包括:The method according to claim 1, wherein the method further comprises: before the data center reads the second version history queue formed by the version number of the object that exists in the local end, the method further includes:
    数据中心接收对象的存储请求;The data center receives a storage request of the object;
    所述数据中心针对所述存储请求生成本次待存储的所述对象的数据的版本号;Generating, by the data center, a version number of the data of the object to be stored this time for the storage request;
    所述数据中心将所述版本号添加到所述对象的版本历史队列的队尾,构成所述对象的第一版本历史队列;The data center adds the version number to the tail of the version history queue of the object, and constitutes a first version history queue of the object;
    所述数据中心响应所述存储请求,存储所述对象的数据,并向其他数据中心发送复制请求,所述复制请求携带所述对象的第一版本历史队列。The data center stores the data of the object in response to the storage request, and sends a copy request to another data center, the copy request carrying a first version history queue of the object.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,若所述数据中心判断出第一版本历史队列中本次存储的所述对象的数据的版本号不大于所述第二版本历史队列中的版本号,所述方法还包括:The method according to any one of claims 1 to 3, wherein if the data center determines that the version number of the data of the object stored in the first version history queue is not greater than the second version The version number in the history queue, the method further includes:
    所述数据中心确定产生乐观锁冲突,所述本次存储的所述对象的数据存储失败; The data center determines that an optimistic lock conflict is generated, and the data storage of the object that is stored this time fails;
    所述数据中心比较所述第一版本历史队列与所述第二版本历史队列中的版本号,合并排列出第三版本历史队列;Comparing, by the data center, the version numbers in the first version history queue and the second version history queue, and arranging the third version history queues;
    所述数据中心存储所述第三版本历史队列以更新本端所述对象的版本历史队列。The data center stores the third version history queue to update a version history queue of the object at the local end.
  5. 根据权利要求4所述的方法,其特征在于,所述数据中心比较所述第一版本历史队列与所述第二版本历史队列中的版本号,合并排列出第三版本历史队列,包括:The method according to claim 4, wherein the data center compares the version numbers in the first version history queue and the second version history queue, and aligns the third version history queues, including:
    所述数据中心从队尾向对头的顺序,确定所述第一版本历史队列与所述第二版本历史队列中是否存在第一个相同的版本号;Determining, in the order of the data center from the tail to the head, whether the first version number is the same in the first version history queue and the second version history queue;
    若存在第一个相同的版本号,则所述数据中心将所述第一版本历史队列与所述第二版本历史队列中所述第一个相同的版本号到队尾的所有版本号进行排序,合并出第三版本历史队列;If there is a first identical version number, the data center sorts the first version history queue and the first version number in the second version history queue to all version numbers at the end of the queue. , merge the third version of the historical queue;
    若不存在第一个相同的版本号,则所述数据中心将所述第一版本历史队列与所述第二版本历史队列中的所有版本号进行排序,合并出第三版本历史队列。If the first version number is not the same, the data center sorts the first version history queue and all the version numbers in the second version history queue to merge the third version history queue.
  6. 一种数据中心,其特征在于,包括:A data center characterized by comprising:
    读取模块,用于在存储对象的数据时,读取本端中所述对象已存在的版本号构成的第二版本历史队列;a reading module, configured to read a second version history queue formed by a version number of the object existing in the local end when storing data of the object;
    判断模块,用于判断第一版本历史队列中本次存储的所述对象的数据的版本号是否大于所述第二版本历史队列中的版本号;a judging module, configured to determine whether a version number of the data of the object stored in the first version history queue is greater than a version number in the second version history queue;
    确定模块,用于在所述判断模块判断出第一版本历史队列中本次存储的所述对象的数据的版本号大于所述第二版本历史队列中的版本号时,确定未产生乐观锁冲突,所述本次存储的所述对象的数据存储成功;a determining module, configured to determine, when the determining module determines that the version number of the data of the object stored in the first version history queue is greater than the version number in the second version history queue, determining that no optimistic lock conflict occurs The data storage of the object stored in the current storage is successful;
    所述版本号包括接收到客户端发送的用于存储对象的数据的存储请求的接收时间和通用唯一识别码UUID;接收时间在后的版本号大于接收时间在先的版本号,针对接收时间相同的版本号,UUID大的版本号大于UUID小的版本号。The version number includes a receiving time and a universal unique identifier UUID of the storage request for receiving data for storing the object sent by the client; the version number after the receiving time is greater than the version number of the receiving time, and the receiving time is the same The version number of the UUID is larger than the version number of the UUID.
  7. 根据权利要求6所述的数据中心,其特征在于,还包括:The data center according to claim 6, further comprising:
    第一接收模块,用于在所述读取模块读取本端中所述对象已存在的版本号构成的第二版本历史队列之前,接收其他数据中心发送的复制请求;a first receiving module, configured to receive a copy request sent by another data center before the reading module reads the second version history queue formed by the version number of the object that exists in the local end;
    提取模块,用于从所述复制请求中提取对象的数据以及所述对象的第一版本历史队列;An extracting module, configured to extract data of the object and the first version history queue of the object from the copy request;
    第一存储模块,用于响应所述复制请求,存储所述对象的数据。 And a first storage module, configured to store data of the object in response to the copy request.
  8. 根据权利要求6所述的数据中心,其特征在于,还包括:The data center according to claim 6, further comprising:
    第二接收模块,用于在所述读取模块读取本端中所述对象已存在的版本号构成的第二版本历史队列之前,接收对象的存储请求;a second receiving module, configured to receive a storage request of the object before the reading module reads the second version history queue formed by the version number of the object that exists in the local end;
    生成模块,用于针对所述存储请求生成本次待存储的所述对象的数据的版本号;a generating module, configured to generate, for the storage request, a version number of data of the object to be stored this time;
    添加模块,用于将所述版本号添加到所述对象的版本历史队列的队尾,构成所述对象的第一版本历史队列;Adding a module, configured to add the version number to a tail of a version history queue of the object, and constitute a first version history queue of the object;
    第二存储模块,用于响应所述存储请求,存储所述对象的数据,并向其他数据中心发送复制请求,所述复制请求携带所述对象的第一版本历史队列。And a second storage module, configured to store data of the object in response to the storage request, and send a copy request to another data center, where the copy request carries a first version history queue of the object.
  9. 根据权利要求6至8任一项所述的数据中心,其特征在于,A data center according to any one of claims 6 to 8, characterized in that
    所述确定模块,还用于在所述判断模块判断出第一版本历史队列中本次存储的所述对象的数据的版本号不大于所述第二版本历史队列中的版本号时,确定产生乐观锁冲突,所述本次存储的所述对象的数据存储失败;The determining module is further configured to: when the determining module determines that the version number of the data of the object stored in the first version history queue is not greater than the version number in the second version history queue, Optimistic lock conflict, the data storage of the object stored this time fails;
    所述数据中心还包括:The data center also includes:
    比较模块,用于比较所述第一版本历史队列与所述第二版本历史队列中的版本号,合并排列出第三版本历史队列;a comparison module, configured to compare the version numbers of the first version history queue and the second version history queue, and align the third version history queues;
    第三存储模块,用于存储所述第三版本历史队列以更新本端所述对象的版本历史队列。And a third storage module, configured to store the third version history queue to update a version history queue of the object at the local end.
  10. 根据权利要求9所述的数据中心,其特征在于,所述比较模块包括:The data center of claim 9 wherein said comparing module comprises:
    确定单元,用于从队尾向对头的顺序,确定所述第一版本历史队列与所述第二版本历史队列中是否存在第一个相同的版本号;a determining unit, configured to determine, from an end of the queue to the head, whether the first version number is the same in the first version history queue and the second version history queue;
    合并单元,用于在所述确定单元确定所述第一版本历史队列与所述第二版本历史队列中存在第一个相同的版本号时,将所述第一版本历史队列与所述第二版本历史队列中所述第一个相同的版本号到队尾的所有版本号进行排序,合并出第三版本历史队列;a merging unit, configured to: when the determining unit determines that the first version history queue and the second version history queue have the same version number, the first version history queue and the second The first identical version number in the version history queue is sorted to all version numbers at the end of the queue, and the third version history queue is merged;
    所述合并单元,还用于在所述确定单元确定所述第一版本历史队列与所述第二版本历史队列中不存在第一个相同的版本号,将所述第一版本历史队列与所述第二版本历史队列中的所有版本号进行排序,合并出第三版本历史队列。 The merging unit is further configured to: determine, by the determining unit, that the first version history queue and the second version history queue do not have a first version number, and the first version history queue and the All version numbers in the second version history queue are sorted, and the third version history queue is merged.
PCT/CN2017/081340 2016-09-08 2017-04-21 Data storage method and data centre WO2018045758A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610810735.X 2016-09-08
CN201610810735.XA CN106484321A (en) 2016-09-08 2016-09-08 A kind of date storage method and data center

Publications (1)

Publication Number Publication Date
WO2018045758A1 true WO2018045758A1 (en) 2018-03-15

Family

ID=58273617

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/081340 WO2018045758A1 (en) 2016-09-08 2017-04-21 Data storage method and data centre

Country Status (2)

Country Link
CN (1) CN106484321A (en)
WO (1) WO2018045758A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901420A (en) * 2020-07-28 2020-11-06 深圳市康冠科技股份有限公司 Data synchronization method, device and system
CN114598559A (en) * 2021-07-22 2022-06-07 湖南亚信软件有限公司 Data processing method and device, electronic equipment and computer readable storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484321A (en) * 2016-09-08 2017-03-08 华为数字技术(成都)有限公司 A kind of date storage method and data center
CN107153912A (en) * 2017-04-11 2017-09-12 广州市食蚁兽网络技术有限公司 One kind growth intelligent data analysis system
CN108769172A (en) * 2018-05-21 2018-11-06 杭州有赞科技有限公司 A kind of method of data synchronization and system
CN109088913B (en) * 2018-06-29 2021-05-11 华为技术有限公司 Method for requesting data and load balancing server
CN109032527B (en) * 2018-07-27 2021-07-27 深圳华大北斗科技有限公司 Data processing method, storage medium and computer device
CN109634526B (en) * 2018-12-11 2022-04-22 浪潮(北京)电子信息产业有限公司 Data operation method based on object storage and related device
CN110597673B (en) * 2019-09-25 2021-04-30 腾讯科技(深圳)有限公司 Disaster recovery method, device and equipment of storage system and computer readable storage medium
CN111400283B (en) * 2020-03-19 2024-02-06 中国建设银行股份有限公司 Data processing method, system, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279857A (en) * 2010-06-11 2011-12-14 阿里巴巴集团控股有限公司 Method and system for realizing data reproduction
CN102622284A (en) * 2012-02-21 2012-08-01 上海交通大学 Data asynchronous replication method directing to mass storage system
CN104753987A (en) * 2013-12-26 2015-07-01 北京东方通科技股份有限公司 Distributed session management method and system
US20160140194A1 (en) * 2014-11-13 2016-05-19 Bigtera Limited Data migration system and data migration method thereof
CN106484321A (en) * 2016-09-08 2017-03-08 华为数字技术(成都)有限公司 A kind of date storage method and data center

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7296125B2 (en) * 2001-11-29 2007-11-13 Emc Corporation Preserving a snapshot of selected data of a mass storage system
JP5967195B2 (en) * 2012-05-15 2016-08-10 日本電気株式会社 Distributed data management device and distributed data operation device
CN103220336B (en) * 2013-03-21 2016-01-27 中国科学院计算技术研究所 The implementation method of vector clock and system in a kind of file synchronization
CN103561095A (en) * 2013-11-04 2014-02-05 金蝶软件(中国)有限公司 Data synchronous method and node and storage service cluster

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279857A (en) * 2010-06-11 2011-12-14 阿里巴巴集团控股有限公司 Method and system for realizing data reproduction
CN102622284A (en) * 2012-02-21 2012-08-01 上海交通大学 Data asynchronous replication method directing to mass storage system
CN104753987A (en) * 2013-12-26 2015-07-01 北京东方通科技股份有限公司 Distributed session management method and system
US20160140194A1 (en) * 2014-11-13 2016-05-19 Bigtera Limited Data migration system and data migration method thereof
CN106484321A (en) * 2016-09-08 2017-03-08 华为数字技术(成都)有限公司 A kind of date storage method and data center

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901420A (en) * 2020-07-28 2020-11-06 深圳市康冠科技股份有限公司 Data synchronization method, device and system
CN111901420B (en) * 2020-07-28 2023-06-16 深圳市康冠科技股份有限公司 Data synchronization method, device and system
CN114598559A (en) * 2021-07-22 2022-06-07 湖南亚信软件有限公司 Data processing method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN106484321A (en) 2017-03-08

Similar Documents

Publication Publication Date Title
WO2018045758A1 (en) Data storage method and data centre
AU2018348323C1 (en) Function-as-a-service (FaaS) platform in blockchain networks
CN106815218B (en) Database access method and device and database system
KR102340296B1 (en) System and method for supporting common transaction identifier (xid) optimization and transaction affinity based on resource manager (rm) instance awareness in a transactional environment
US20230106118A1 (en) Distributed processing of transactions in a network using timestamps
US11514077B2 (en) Replication event ordering using an external data store
CN111258976A (en) Distributed lock implementation method, system, device and storage medium
CN107580032B (en) Data processing method, device and equipment
AU2018348327B2 (en) Utilizing nonce table to resolve concurrent blockchain transaction failure
WO2023045617A1 (en) Transaction data processing method and apparatus, device and medium
US20170193070A1 (en) System and method for a distributed replication lock for active-active geo-redundant systems
CN110888858A (en) Database operation method and device, storage medium and electronic device
CN113010549A (en) Data processing method based on remote multi-active system, related equipment and storage medium
CN111475583B (en) Transaction processing method and device
CN107025257B (en) Transaction processing method and device
US20210081433A1 (en) Global table management operations for multi-region replicated tables
US20180123791A1 (en) Highly available and reliable secret distribution infrastructure
US10467143B1 (en) Event-driven cache
CN107967265B (en) File access method, data server and file access system
CN111857979A (en) Information management method, system, storage medium and equipment of distributed system
CN114205367B (en) Method, device and medium for synchronizing data of superior and subordinate platforms
US11290318B2 (en) Disaster recovery of cloud resources
CN113297168B (en) Data migration method and device in distributed system
US10061607B2 (en) System and method for providing single group multiple branches based on instance awareness
EP4088195A1 (en) Processing delete requests based on change feed of updates

Legal Events

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

Ref document number: 17847932

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17847932

Country of ref document: EP

Kind code of ref document: A1