Data synchronization methods, devices, equipment and storage media
By judging the consistency of the descriptive information of data objects during the data synchronization process, the problem of resource waste caused by multiple synchronizations of data objects is solved, and efficient data synchronization between the source storage server and the target storage server is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-01
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, data objects are modified again after a synchronization task is generated following the completion of operations on the source storage server, resulting in multiple synchronizations of the data objects and wasting resources.
By obtaining the identifier and description information of the data object, the second description information of the data object is queried from the source storage server. It is then determined whether the first description information and the second description information are the same. If they are different, the synchronization task is deleted; if they are the same, the data object is synchronized to the target storage server.
This avoids resource waste caused by multiple synchronizations of data objects and ensures data consistency between the source storage server and the target storage server.
Smart Images

Figure CN115729942B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data storage technology, and in particular to a data synchronization method, apparatus, device, and storage medium. Background Technology
[0002] To ensure data object storage consistency, after the source storage server completes its operations on the data object, the same operations need to be performed on the target storage server to synchronize the data object between the two servers. In related technologies, after the source storage server completes its operations on the data object, a synchronization task including the data object's identifier is generated, and data synchronization is performed based on this identifier. However, this data synchronization method does not consider the problem of the data object being modified again after the synchronization task is generated, requiring a new synchronization task to be generated. This results in the data object being synchronized multiple times, wasting synchronization resources. Summary of the Invention
[0003] To solve the above-mentioned technical problems, or at least partially solve them, embodiments of this disclosure provide a data synchronization method, apparatus, device, and storage medium.
[0004] On the one hand, this disclosure provides a data synchronization method, including:
[0005] A synchronization task for a data object is obtained from a pre-established task queue. The synchronization task includes the identifier of the data object and the first description information of the data object.
[0006] Based on the identifier of the data object, obtain the second description information of the data object from the source storage server;
[0007] If the first description information and the second description information are the same, the data object is synchronized from the source storage server to the target storage server based on the identifier of the data object; or, if the first description information and the second description information are different, the synchronization task is deleted.
[0008] Optionally, the synchronization task may also include task type information;
[0009] Before obtaining the second description information of the data object from the source storage server based on the identifier of the data object, the method: determines the task type of the synchronization task based on the task type information;
[0010] In response to the synchronization task being of type write or modify, the step of obtaining the second description information of the data object from the source storage server based on the identifier of the data object is executed.
[0011] Optionally, the method further includes: in response to the synchronization task being a deletion task, sending an identifier and deletion instruction of the data object to the target storage server, so that the target storage server deletes the data object and synchronizes the data object from the source storage server to the target storage server.
[0012] Optionally, the synchronization task of retrieving data objects from a pre-established task queue includes:
[0013] Obtain multiple synchronization tasks from the pre-established task queue;
[0014] Determine whether the plurality of synchronization tasks includes a first synchronization task with the same first description information;
[0015] If a first synchronization task with the same first description information is included, then one of the first synchronization tasks is retained, and the rest of the first synchronization tasks are deleted.
[0016] Optionally, the synchronization task may also include information on task importance;
[0017] Before obtaining the second description information of the data object from the source storage server based on the identifier of the data object, the method further includes: determining the order of processing the plurality of synchronous tasks according to the task importance information.
[0018] Optionally, the synchronization task further includes sorting information characterizing the generation order of the synchronization task;
[0019] The step of synchronizing the data object from the source storage server to the target storage server includes: sending the sorting information to the target storage server.
[0020] On the other hand, this disclosure provides a data synchronization device, including:
[0021] A synchronization task acquisition unit is used to acquire a synchronization task of a data object from a pre-established task queue. The synchronization task includes the identifier of the data object and the first description information of the data object.
[0022] The second description information acquisition unit is used to acquire the second description information of the data object from the source storage server based on the identifier of the data object;
[0023] A data object synchronization unit is configured to synchronize the data object from the source storage server to the target storage server based on the identifier of the data object when the first description information and the second description information are the same; or, when the first description information and the second description information are different, delete the synchronization task.
[0024] Optionally, the synchronization task acquisition unit includes:
[0025] A multi-task acquisition subunit is used to acquire multiple synchronous tasks from the pre-established task queue;
[0026] The determination subunit is used to determine whether the plurality of synchronization tasks includes a first synchronization task with the same first description information;
[0027] The deletion subunit is used to retain one of the first synchronization tasks and delete the rest of the first synchronization tasks if they have the same first description information.
[0028] Optionally, the synchronization task further includes task importance information; the device further includes: a sorting unit, used to determine the order in which the plurality of synchronization tasks are processed according to the task importance information.
[0029] Optionally, the synchronization task further includes sorting information characterizing the generation order of the synchronization task; the data object synchronization unit is also used to send the sorting information to the target storage server.
[0030] In another aspect, this disclosure provides a computer device, including:
[0031] A memory and a processor, wherein the memory stores a computer program that, when executed by the processor, implements the method described above.
[0032] In another aspect, this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described above.
[0033] The technical solution provided in this disclosure has the following advantages compared with the prior art:
[0034] Using the data synchronization method, apparatus, device, and readable storage medium provided in this disclosure, the synchronization task includes an identifier and first description information of a data object. After obtaining the synchronization task, based on the identifier of the data object, the second description information of the data object is queried from the source storage server, and it is determined whether the first description information and the second description information are the same. If the first description information and the second description information are different, the currently processed synchronization task is not executed and it is deleted. If the first description information and the second description information are the same, the data object is synchronized from the source storage server to the target storage server.
[0035] If the first description information and the second description information are different, it proves that after the source storage server performed the operation on the data object and generated the current synchronization task, it performed the operation on the aforementioned data object again and generated the subsequent synchronization task. At this time, the previous synchronization task will be deleted to avoid resource consumption caused by executing multiple synchronization tasks for the data object. Attached Figure Description
[0036] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0037] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a schematic diagram of the architecture of a data synchronization system used in some embodiments of this disclosure;
[0039] Figure 2 This is a flowchart of a data synchronization method provided in some embodiments of this disclosure;
[0040] Figure 3 This is a flowchart of a data synchronization method provided in some other embodiments of this disclosure;
[0041] Figure 4 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of the present disclosure;
[0042] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Detailed Implementation
[0043] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0044] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0045] Figure 1 This is a schematic diagram of the architecture of a data synchronization system used in some embodiments of this disclosure. For example... Figure 1 As shown, the data synchronization system 10 includes a source storage server 11, a task queue server 12, a target storage server 14, and a synchronization server 13 for performing data synchronization tasks.
[0046] Source storage server 11 is used to receive client ( Figure 1 The operation command (not shown) is sent to the source storage server 11 to perform storage, modification, or deletion of the data object. After the source storage server 11 performs an operation on a certain data object, it generates a corresponding synchronization task and sends it to the task queue server 12. The synchronization task can instruct the synchronization server 13 which data objects to synchronize and what kind of synchronization processing to perform, such as writing, modifying, or deleting.
[0047] The task queue server 12 is used to store and manage task queues, which are pre-established queues used to store synchronization tasks. After receiving a synchronization task sent from the source storage server 11, the task queue server 12 stores the synchronization task in the task queue.
[0048] Synchronization server 13 is used to retrieve synchronization tasks from the task queue in real time and execute them to ensure the consistency of data in source storage server 11 and target storage server 14.
[0049] The target storage server 14 is used to back up data objects in the source storage server 11. After receiving synchronization information sent by the synchronization server 13, the target storage server 14 performs data synchronization according to the synchronization information. In this embodiment of the disclosure, the target storage server 14 can be a server located in the same region as the source storage server 11, or it can be a server located in a different region.
[0050] In this embodiment of the disclosure, the source storage server 11, the target storage server 14, the task queue server 12, and the synchronization server 13 can all be cloud servers or server clusters.
[0051] It should be noted that, Figure 1 This is merely a schematic diagram of a data synchronization system applied in an embodiment of this disclosure. In other embodiments of this disclosure, the data synchronization system may also adopt other types of architectures; for example, in one embodiment, the functions of the aforementioned task queue server 12 and synchronization server 13 are integrated into the source storage server 11.
[0052] Figure 2 This is a flowchart of a data synchronization method provided in some embodiments of this disclosure, such as... Figure 2 As shown, the data synchronization method provided in this embodiment includes steps S101-S105.
[0053] Step S101: Obtain the synchronization task of the data object from the pre-established task queue. The synchronization task includes at least the identifier of the data object and the first description information of the data object.
[0054] The identifier of a data object is a globally unique symbol used to represent the data object to be synchronized. The first descriptive information describes the data object's modification time or characteristics of its data content. For example, the first descriptive information may include the data object's last modification time or its signature.
[0055] In some embodiments of this disclosure, the synchronization server can send requests to the task queue server in real time, requesting the task queue server to send synchronization tasks for data objects to the synchronization server. For example, after completing the processing of the previous synchronization task, the synchronization server can send a request to the task queue server to send the next synchronization task to the synchronization server. In other embodiments of this disclosure, the synchronization server can passively receive synchronization tasks sent by the task queue server.
[0056] Step S102: Based on the identifier of the data object, obtain the second description information of the data object from the source storage server.
[0057] The second descriptive information is stored in the source storage server and is used to represent the modification time of the data object or the characteristics of the data content of the data object. For example, when the first descriptive information is specifically the last modification time of the data object, the corresponding second descriptive information is also specifically including the last modification time of the data object; or when the first descriptive information is specifically the signature of the data object, the corresponding second descriptive information is also specifically including the signature of the data object.
[0058] Step S103: Determine whether the first description information and the second description information are the same; if yes, proceed to step S104; if no, proceed to step S105.
[0059] If the first description information is the same as the second description information, it proves that the data object stored in the source storage server was not modified after the source storage server generated the synchronization task; if the first description information is different from the second description information, it proves that after the source storage server generated the synchronization task, the source storage server received another operation on the data object, causing the data object to be rewritten.
[0060] S104: Synchronize the data object from the source storage server to the target storage server.
[0061] Step 105: Delete the synchronization task.
[0062] If the first description information and the second description information are different, it proves that the source storage server has performed the operation on the data object and generated the current synchronization task. Therefore, the current synchronization task is deleted, and the subsequent synchronization task is executed in subsequent operations to avoid resource consumption caused by executing multiple synchronization tasks for the data object.
[0063] Figure 3 This is a flowchart of a data synchronization method provided in some other embodiments of this disclosure. For example... Figure 3 As shown, when the synchronization task includes information about the task type, the data synchronization method provided in this embodiment includes steps S201-S206.
[0064] Step S201: Obtain the synchronization task of the data object from the pre-established task queue. The synchronization task includes the identifier of the data object, the first description information of the data object, and the task type information.
[0065] The identifier of a data object is a globally unique symbol used to represent the data object to be synchronized. The first descriptive information describes the data object's rewrite time or data content characteristics. For example, the first descriptive information may include the data object's last modification time or its signature. The task type information indicates the type of synchronization task; the task type can be a write task, a modify task, or a delete task.
[0066] Step S202: Determine the type of the synchronization task based on the task type information.
[0067] Step S203: In response to the synchronization task being a write task or a modify task, obtain the second description information of the data object from the source storage server based on the identifier of the data object.
[0068] If the synchronization task is a write task, it is determined that the data object was written to the source storage server before the synchronization task was generated. If the synchronization task is a modify task, it is determined that the data object was modified before the synchronization task was generated. In the case of a write or modify task, the data object is likely still stored in the source storage server. Therefore, based on the data object's identifier, the second description information of the data object is obtained from the source storage server.
[0069] Step S204: Determine whether the first description information and the second description information are the same; if yes, proceed to step S205; if no, proceed to step S206.
[0070] If the first description information is the same as the second description information, it proves that the data object stored in the source storage server was not modified after the source storage server generated the synchronization task; if the first description information is different from the second description information, it proves that after the source storage server generated the synchronization task, the source storage server received another operation on the data object, causing the data object to be rewritten.
[0071] Step S205: Synchronize the data object from the source storage server to the target storage server.
[0072] Step S206: Delete the synchronization task.
[0073] In some other embodiments of this disclosure, the data synchronization method may include step S207 in addition to the aforementioned steps S201-S206.
[0074] Step S207: In response to the synchronization task being a deletion task, send the identifier of the data object and a deletion instruction to the target storage server so that the target storage server deletes the data object and synchronizes the data object from the source storage server to the target storage server.
[0075] If the synchronization task is a deletion task, it means that the source storage server no longer stores the data object. In this case, the synchronization server does not need to query the source storage server to determine the storage status of the data object, but directly generates a deletion command.
[0076] After generating a deletion command, the synchronization server can send the data object's identifier and the deletion command to the target storage server, so that the target storage server can delete the corresponding data object, thereby achieving data synchronization between the source storage server and the target storage server.
[0077] When the synchronization task includes a task type, if the synchronization task type is a deletion task, the synchronization server directly generates a deletion command and sends it to the target storage server, without performing the interaction steps with the source storage server. This reduces the number of interactions between the synchronization server and the source storage server, thus reducing resource overhead.
[0078] In some embodiments of this disclosure, the synchronization task of obtaining data objects from a pre-established task queue in step S201 may include steps S2011-S2014.
[0079] Step S2011: Obtain multiple synchronization tasks from the pre-established task queue.
[0080] In this embodiment of the disclosure, after the synchronization task server stores multiple unexecuted synchronization tasks in the task queue, it sends these multiple synchronization tasks to the synchronization server, so that the synchronization server can obtain multiple synchronization tasks. If the task queue has completed the multiple synchronization tasks sent by the synchronization task server, it can send corresponding request information to the task queue server to request the synchronization task server to send a new batch of synchronization tasks.
[0081] Step S2012: Determine whether the multiple synchronization tasks include a first synchronization task with the same first description information; if yes, proceed to step S2013; if no, proceed to step S2014.
[0082] In some embodiments of this disclosure, the first descriptive information may specifically be a signature of a data object.
[0083] Step S2013: Keep one of the first synchronization tasks and delete the rest of the first synchronization tasks.
[0084] Step S2014: Retain all synchronization tasks.
[0085] In practical applications, due to errors such as accidental operations, users may repeatedly perform the same operation on a data object multiple times within a short period, causing the source storage server to generate multiple identical synchronization tasks. For example, a user might repeatedly perform a rewrite operation on a data object multiple times within a short period, and the rewrite content would be the same across all operations. In this case, the source storage server would generate multiple identical first synchronization tasks, each with the task type of a rewrite task. If all of these first synchronization tasks are executed, it consumes significant computing and transmission resources.
[0086] In some embodiments of this disclosure, to avoid wasting resources by executing the same first synchronization task, after acquiring multiple synchronization tasks, the first description information in the synchronization tasks is compared. If the first description information in the synchronization tasks is the same, the synchronization task is determined to be the first synchronization task. In this case, only one first synchronization task can be retained, while the others can be deleted. In specific implementations of this disclosure, the first synchronization task that comes first can be deleted, and the last first synchronization task can be retained.
[0087] In some embodiments of this disclosure, the synchronization task also includes task importance information, which indicates the degree of importance of the synchronization task.
[0088] In cases where the synchronization task includes information on task importance, and multiple synchronization tasks are retrieved from a pre-established data queue during step S201, the data synchronization method provided in some embodiments of this disclosure may include step S208 in addition to the aforementioned steps S201-S207. Step S208 may be executed before step S202.
[0089] Step S208: Determine the order in which to process multiple synchronous tasks based on the task importance information.
[0090] In some embodiments of this disclosure, multiple synchronization tasks are sorted according to the importance of the tasks, which can ensure that the more important synchronization tasks are executed first, thereby achieving fast synchronization of more important data objects between the source storage server and the target storage server.
[0091] In practical applications, determining the processing order of multiple synchronization tasks based on task importance information can be achieved by placing the synchronization tasks into one of several preset priority queues. Subsequently, the synchronization tasks are processed according to the priority of each priority queue, thereby achieving synchronization of the corresponding data objects between the source and target storage servers.
[0092] In some embodiments of this disclosure, in addition to the identifier of the data object, the synchronization task may also include sorting information indicating the generation order of the synchronization tasks. Correspondingly, when performing the aforementioned steps S104 and S205, the following step may also be included: sending the sorting information to the target storage server.
[0093] By sending the ordering information of the synchronization tasks to the target storage server, the target storage server can determine whether to perform the corresponding data synchronization operation based on the ordering information, thus avoiding inconsistencies in the data objects stored on the source and target storage servers due to incorrect execution order.
[0094] In a specific application, the source storage server performs two rewrite operations on a certain data object and generates corresponding synchronization tasks. The sorting information for these synchronization tasks is 01 and 02, respectively. The synchronization server then sends the two data objects with the same identifier but different sorting information to the target storage server, one after the other, according to the synchronization tasks. Due to data transmission routing, the data object corresponding to the synchronization task with sorting 02 is transmitted to the target storage server first and stored there. Upon receiving the data object corresponding to the synchronization task with sorting 01, the target storage server can directly discard this data object to be synchronized, thus avoiding synchronization errors caused by storing the data object again.
[0095] Figure 4 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of this disclosure. Figure 4 As shown, the data synchronization device 400 provided in this embodiment includes a synchronization task acquisition unit 401, a second description information acquisition unit 402, and a data object synchronization unit 403.
[0096] The synchronization task acquisition unit 401 is used to acquire the synchronization task of the data object from the pre-established task queue. The synchronization task includes the identifier of the data object and the first description information of the data object.
[0097] The second description information acquisition unit 402 is used to acquire the second description information of the data object from the source storage server based on the identifier of the data object.
[0098] The data object synchronization unit 403 is used to synchronize the data object from the source storage server to the target storage server based on the identifier of the data object when the first description information and the second description information are the same, or to delete the synchronization task when the first description information and the second description information are different.
[0099] In some embodiments of this disclosure, the synchronization task further includes task type information; the apparatus also includes a task type determination unit. The task type determination unit is used to determine the task type of the synchronization task based on the task type information.
[0100] Correspondingly, when the type of the synchronization task is a write task or a modification task, the second description information acquisition unit 402 acquires the second description information of the data object from the source storage server based on the identifier of the data object.
[0101] When the task type is a deletion task, the data object synchronization unit 403 sends the identifier of the data object and the deletion instruction to the target storage server so that the target storage server deletes the data object and synchronizes the data object from the source storage server to the target storage server.
[0102] In some embodiments of this disclosure, the synchronization task acquisition unit 401 includes a multi-task acquisition subunit, a judgment subunit, and a deletion subunit. The multi-task acquisition subunit is used to acquire multiple synchronization tasks from a pre-established task queue. The judgment subunit is used to determine whether the multiple synchronization tasks include a first synchronization task with the same first description information. The deletion subunit is used to, if there are first synchronization tasks with the same first description information, retain one of the first synchronization tasks and delete the rest.
[0103] In some embodiments of this disclosure, the synchronization task also includes information on task importance; the data synchronization device further includes a sorting unit, which is used to determine the order in which multiple synchronization tasks are processed according to the information on task importance.
[0104] In some embodiments of this disclosure, the synchronization task further includes sorting information characterizing the generation order of the synchronization task; the data object synchronization unit 403 is also used to send the sorting information to the target storage server.
[0105] This disclosure also provides a computer device, which includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, can implement the data synchronization method of any of the above embodiments.
[0106] Example, Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. See below for details. Figure 5 It shows a schematic diagram of the structure suitable for implementing the computer device 500 in the embodiments of this disclosure. Figure 5 The computer device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0107] like Figure 5 As shown, the computer device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory ROM 502 or a program loaded from a storage device 508 into a random access memory RAM 503. The RAM 503 also stores various programs and data required for the operation of the computer device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0108] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows computer device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 A computer device 500 with various devices is shown; however, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or included alternatively.
[0109] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0110] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0111] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0112] The aforementioned computer-readable medium may be included in the aforementioned computer device; or it may exist independently and not assembled into the computer device.
[0113] The aforementioned computer-readable medium carries one or more programs that, when executed by the computer device, cause the computer device to: retrieve a synchronization task for a data object from a pre-established task queue, the synchronization task including an identifier of the data object and first description information; retrieve second description information of the data object from a source storage server based on the identifier of the data object; synchronize the data object from the source storage server to a target storage server based on the identifier of the data object if the first description information and the second description information are the same; or, delete the synchronization task if the first description information and the second description information are different.
[0114] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0116] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0117] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0118] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include, based on electrical connections of one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0119] This disclosure also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the methods of any of the above method embodiments. The execution method and beneficial effects are similar, and will not be described again here.
[0120] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0121] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data synchronization method, characterized by, The method comprises: obtaining a synchronization task of a data object from a pre-established task queue, the synchronization task comprising an identification of the data object and first description information of the data object, the first description information being information used to describe a data object rewrite time or a data object data content feature; obtaining second description information of the data object from a source storage server based on the identification of the data object; in response to the first description information and the second description information being the same, synchronizing the data object from the source storage server to a target storage server; or in response to the first description information and the second description information being different, deleting the synchronization task; the obtaining of the synchronization task of the data object from the pre-established task queue comprises: obtaining a plurality of synchronization tasks from the pre-established task queue; determining whether the plurality of synchronization tasks comprises a first synchronization task having the same first description information; if the first synchronization task having the same first description information is included, retaining one of the first synchronization tasks and deleting the remaining first synchronization tasks.
2. The method of claim 1, wherein, The synchronization task further comprises information of a task type; before the obtaining of the second description information of the data object from the source storage server based on the identification of the data object, the method further comprises determining a type of the synchronization task based on the information of the task type; in response to the type of the synchronization task being a write task or a modification task, performing the step of obtaining the second description information of the data object from the source storage server based on the identification of the data object.
3. The method of claim 2, wherein, The method further comprises: in response to the task type of the synchronization task being a deletion task, sending the identification of the data object and a deletion instruction to the target storage server, so that the target storage server deletes the data object and synchronizes the data object from the source storage server to the target storage server.
4. The method of claim 1, wherein, The synchronization task further comprises information of a task importance; before the obtaining of the second description information of the data object from the source storage server based on the identification of the data object, the method further comprises determining an order of processing the plurality of synchronization tasks according to the information of the task importance.
5. The method of claim 1, wherein, The synchronization task further comprises ordering information representing a generation order of the synchronization task; the synchronizing of the data object from the source storage server to the target storage server comprises sending the ordering information to the target storage server.
6. A data synchronization apparatus, characterized by comprising: The method comprises: a synchronization task obtaining unit configured to obtain a synchronization task of a data object from a pre-established task queue, the synchronization task comprising an identification of the data object and first description information of the data object, the first description information being information used to describe a data object rewrite time or a data object data content feature; a second description information obtaining unit configured to obtain second description information of the data object from a source storage server based on the identification of the data object; a data object synchronization unit, configured to synchronize the data object from the source storage server to a target storage server based on the identifier of the data object if the first description information and the second description information are the same, or delete the synchronization task if the first description information and the second description information are not the same; the synchronization task acquisition unit comprises: a multi-task acquisition subunit, configured to acquire multiple synchronization tasks from the pre-established task queue; a judgment subunit, configured to judge whether the multiple synchronization tasks include first synchronization tasks with the same first description information; a deletion subunit, configured to retain one of the first synchronization tasks and delete the remaining first synchronization tasks if the first synchronization tasks with the same first description information are included.
7. The apparatus of claim 6, wherein, the synchronization task acquisition unit comprises: a multi-task acquisition subunit, configured to acquire multiple synchronization tasks from the pre-established task queue; a judgment subunit, configured to judge whether the multiple synchronization tasks include first synchronization tasks with the same first description information; a deletion subunit, configured to retain one of the first synchronization tasks and delete the remaining first synchronization tasks if the first synchronization tasks with the same first description information are included.
8. A computer device, comprising: comprise: a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method in any one of claims 1-5 is implemented.
9. A computer-readable storage medium, characterized in that, the storage medium stores a computer program, and when the computer program is executed by the processor, the method in any one of claims 1-5 is implemented.
Citation Information
Patent Citations
Data synchronizing method and device
CN106503158A
Data synchronization method and device, computer equipment and storage medium
CN112818054A