Data synchronization method and electronic device

By generating and comparing the directory tree summary data of the primary storage node and the mirror storage node, the problem of high traversal overhead caused by full scan comparison is solved, and efficient location and synchronization of metadata synchronization is achieved.

CN122633780APending Publication Date: 2026-08-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611139783.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

In existing technologies, metadata synchronization uses a full scan comparison method, which results in high traversal overhead and low synchronization efficiency.

Method used

By acquiring the directory tree metadata information of the primary storage node and the mirror storage node, summary data is generated, and hierarchical summary comparison is performed to determine the target objects to be synchronized and execute the data synchronization operation.

Benefits of technology

It achieves precise location and synchronization of differing objects, reduces invalid data traversal and comparison operations, and improves the efficiency of metadata synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122633780A_ABST
    Figure CN122633780A_ABST
Patent Text Reader

Abstract

The application discloses a data synchronization method and electronic equipment, and relates to the technical field of data processing. The method comprises the following steps: obtaining metadata information of a first directory tree of a master storage node and metadata information of a second directory tree of a mirror storage node, and generating first summary data and second summary data according to the metadata information of the first directory tree and the metadata information of the second directory tree. Further, the first summary data and the second summary data are compared according to a preset hierarchical order, and based on comparison results in which the summary data is different in a target comparison result, a target object to be synchronized is determined, and a synchronization operation is performed, so that accurate positioning and synchronization of a difference object are realized. Through hierarchical comparison of the summary data, the specific target object with metadata difference can be quickly positioned, invalid data traversal and comparison operations are reduced, and the efficiency of metadata synchronization is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to data synchronization methods and electronic devices. Background Technology

[0002] With the rapid development of technologies such as high-performance computing, artificial intelligence training, and massive data processing, the scale and directory hierarchy of metadata stored and managed in distributed file systems have increased dramatically. Metadata synchronization, which ensures metadata redundancy and consistency during failover, directly impacts the business continuity and availability of the storage system due to its efficiency and resource consumption. Currently, metadata synchronization typically employs a full scan comparison method, resulting in high traversal overhead and low synchronization efficiency. Summary of the Invention

[0003] This application provides a data synchronization method and electronic device to at least solve the problem in related technologies where full scanning and comparison of metadata leads to high traversal overhead and low synchronization efficiency during the synchronization process.

[0004] In a first aspect, this application provides a data synchronization method, applied to a processor, the method comprising:

[0005] In response to receiving a data synchronization request, the metadata information of the first directory tree of the primary storage node and the metadata information of the second directory tree of the mirror storage node are obtained; wherein, the directory tree includes multiple hierarchical objects;

[0006] First summary data and second summary data are generated based on the metadata information of the first directory tree and the metadata information of the second directory tree; the first summary data includes summary data corresponding to each level of objects in the first directory tree; the second summary data includes summary data corresponding to each level of objects in the second directory tree.

[0007] The first and second summary data are compared in a preset hierarchical order to obtain the target comparison result; the target comparison result includes the comparison result of whether the first and second summary data are the same under the same hierarchical object.

[0008] Based on the comparison results where the summary data is different in the target comparison results, the target objects to be synchronized are determined, and the data synchronization operation is performed.

[0009] Secondly, this application also provides a data synchronization device, which is located in a processor and includes:

[0010] The acquisition module is used to respond to a received data synchronization request by acquiring the metadata information of the first directory tree of the primary storage node and the metadata information of the second directory tree of the mirror storage node; wherein, the directory tree includes multiple hierarchical objects;

[0011] The generation module is used to generate first summary data and second summary data based on the metadata information of the first directory tree and the metadata information of the second directory tree; the first summary data includes summary data corresponding to each level object in the first directory tree; the second summary data includes summary data corresponding to each level object in the second directory tree.

[0012] The comparison module is used to compare the first summary data and the second summary data according to a preset hierarchical order to obtain a target comparison result; the target comparison result includes the comparison result of whether the first summary data and the second summary data are the same under the same hierarchical object.

[0013] The determination module is used to identify the target objects to be synchronized based on the comparison results where the summary data is different in the target comparison results;

[0014] The execution module is used to perform data synchronization operations.

[0015] Thirdly, this application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the data synchronization method provided in the first aspect when executing the computer program.

[0016] Fourthly, this application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the data synchronization method provided in the first aspect.

[0017] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the data synchronization method provided in the first aspect.

[0018] The data synchronization method and electronic device provided in this application, upon receiving a data synchronization request, acquires the metadata information of the first directory tree of the primary storage node and the metadata information of the second directory tree of the mirror storage node, and generates first and second summary data based on the metadata information of the first and second directory trees. The summary data includes summary data corresponding to objects at each level in the directory tree. Therefore, the consistency state of metadata can be quantified into a hierarchical summary data structure, providing a basis for subsequently determining the differing objects corresponding to the differences in metadata between the primary and mirror storage nodes. Furthermore, the first and second summary data are compared according to a preset hierarchical order. Based on the comparison results showing differences in summary data, the target object to be synchronized is determined, and a synchronization operation is performed, thereby achieving precise location and synchronization of the differing object. Compared to using a full scan, hierarchical summary comparison can quickly locate specific target objects with metadata differences. It precisely limits the scope of directory tree traversal and metadata comparison to the actual target object paths with metadata differences, reducing invalid data traversal and comparison operations. It also ensures the accuracy of locating target objects with metadata differences between the primary storage node and the mirror storage node, as well as the efficiency of system resource utilization, thereby improving the efficiency of metadata synchronization. Attached Figure Description

[0019] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is an application scenario diagram of the data synchronization method provided in the embodiments of this application;

[0021] Figure 2 A schematic flowchart illustrating a data synchronization method provided in an embodiment of this application;

[0022] Figure 3 A flowchart illustrating a data synchronization method provided in another embodiment of this application;

[0023] Figure 4 A flowchart illustrating a data synchronization method provided in yet another embodiment of this application;

[0024] Figure 5 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of this application;

[0025] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0027] It should be noted that, in the description of this application, 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. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0028] With the rapid development of technologies such as high-performance computing, artificial intelligence training, and massive data processing, the scale and directory hierarchy of metadata stored and managed in distributed file systems have increased dramatically. Metadata synchronization, which ensures metadata redundancy and consistency during failover, directly impacts the business continuity and availability of the storage system due to its efficiency and resource consumption. Currently, metadata synchronization typically employs a full scan comparison method, resulting in high traversal overhead and low synchronization efficiency.

[0029] Therefore, when facing the aforementioned technical issues, instead of using a full traversal comparison to determine the differing objects between the mirror storage node and the primary storage node, upon receiving a data synchronization request, the metadata information of the primary storage node's first directory tree and the mirror storage node's second directory tree are obtained. First and second summary data are then generated based on the metadata information of the first and second directory trees. The summary data includes summary data corresponding to objects at each level of the directory tree. Thus, the consistency state of metadata can be quantified into a hierarchical summary data structure, providing a basis for subsequently determining the differing objects corresponding to the differences in metadata between the primary and mirror storage nodes. Furthermore, the first and second summary data are compared according to a preset hierarchical order. Based on the comparison results showing differences in summary data, the target objects to be synchronized are determined, and synchronization operations are performed, thereby achieving precise location and synchronization of the differing objects. Compared to using a full scan, hierarchical summary comparison can quickly locate specific target objects with metadata differences. It precisely limits the scope of directory tree traversal and metadata comparison to the actual target object paths with metadata differences, reducing invalid data traversal and comparison operations. It also ensures the accuracy of locating target objects with metadata differences between the primary storage node and the mirror storage node, as well as the efficiency of system resource utilization, thereby improving the efficiency of metadata synchronization.

[0030] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0031] Figure 1 This diagram illustrates an application scenario for the data synchronization method provided in this application. For example... Figure 1As shown, the application scenario provided in this embodiment includes: server 10 and client 20. Server 10 includes processor 101. The data synchronization method is applied to processor 101. The primary storage node and the mirror storage node are located in different servers 10. Processor 101 can be deployed in the server where the primary storage node is located, or in the server where the mirror storage node is located, or in a separate server. Processor 101 connects to at least one group of primary storage nodes and mirror storage nodes, and communicates with the primary storage nodes and mirror storage nodes respectively. Users can trigger a data synchronization request on the operation interface provided by client 20 and send it to processor 101. After receiving the data synchronization request sent by client 20, processor 101 obtains the metadata information of the first directory tree of the primary storage node and the metadata information of the second directory tree of the mirror storage node. The directory tree includes multiple hierarchical objects. Processor 101 generates first digest data and second digest data based on the metadata information of the first directory tree and the second directory tree. The first digest data includes the digest data corresponding to each hierarchical object in the first directory tree. The second digest data includes the digest data corresponding to each hierarchical object in the second directory tree. Further, the processor 101 compares the first and second summary data according to a preset hierarchical order to obtain a target comparison result. The target comparison result includes a comparison of whether the first and second summary data are identical within the same hierarchical object. Further, based on the comparison results showing that the summary data are different, the target object to be synchronized is determined, a data synchronization operation is performed, and the data synchronization result is sent to the client 20 after the operation.

[0032] Figure 2 This is a schematic flowchart of a data synchronization method provided in an embodiment of this application, as shown below. Figure 2 As shown. The data synchronization method provided in this embodiment is applied to a processor. The data synchronization method provided in this embodiment specifically includes the following steps:

[0033] S201: In response to receiving a data synchronization request, obtain the metadata information of the first directory tree of the primary storage node and the metadata information of the second directory tree of the mirror storage node.

[0034] The directory tree includes multiple levels.

[0035] Among them, a data synchronization request refers to an instruction or signal that triggers metadata synchronization between the primary storage node and the mirror storage node.

[0036] Optionally, data synchronization requests can be generated by events such as the primary storage node and / or mirror storage node coming back online, periodic consistency checks, or manual triggering by the administrator.

[0037] In this context, the primary storage node refers to the storage device or service node used to store and maintain the primary copy of metadata in a distributed file system, while the mirror storage node refers to the storage node that performs a mirror backup of the primary storage node.

[0038] The directory tree refers to the hierarchical relationship between directories and files organized in a tree structure in the file system. The directory tree includes multiple hierarchical objects.

[0039] The hierarchy objects include file objects and directory objects. File objects correspond to specific files in the directory tree, and directory objects correspond to specific directories in the directory tree.

[0040] In a directory tree, the subset of any directory node that is rooted and contains that directory object and all its descendant objects is called the subtree corresponding to that directory object.

[0041] The subtree of the root directory refers to the subtree that is rooted in the root directory of the directory tree and contains all objects in the entire directory tree.

[0042] In this context, a non-root directory subtree refers to a subtree that takes any non-root directory object (excluding the root directory) as its root and includes that directory object and all its descendant objects.

[0043] Metadata information refers to data that describes the attributes of objects at each level in the directory tree, including but not limited to node identification information, size, permissions, modification timestamps, metadata version numbers, and parent-child relationship information between nodes.

[0044] It is understandable that the first directory tree and the second directory tree are the directory trees maintained by the primary storage node and the mirror storage node respectively under the same path structure.

[0045] Specifically, in this embodiment, after receiving a data synchronization request, the processor establishes communication connections with the main storage node and the mirror storage node respectively, and reads the metadata information of the first directory tree and the second directory tree.

[0046] S202: Generate first summary data and second summary data based on the metadata information of the first directory tree and the metadata information of the second directory tree.

[0047] The first summary data includes summary data corresponding to each level of objects in the first directory tree. The second summary data includes summary data corresponding to each level of objects in the second directory tree.

[0048] Summary data refers to compressed data obtained by calculation based on metadata information, used to characterize the consistency status of objects at the corresponding level.

[0049] Specifically, in this embodiment, for each level object in the directory tree, the metadata information of the object itself and the metadata information of the sub-objects included under the object are obtained, and a preset summary generation algorithm is used to aggregate and calculate the metadata information of the object and its sub-objects to generate summary data corresponding to the level object.

[0050] S203: Compare the first summary data and the second summary data according to a preset hierarchical order to obtain the target comparison result.

[0051] The target comparison results include a comparison of whether the first summary data and the second summary data are the same under the same hierarchical object.

[0052] Optionally, the preset hierarchical order refers to the pre-defined hierarchical reading order of the summary data.

[0053] Specifically, in this embodiment, starting from the top-level root directory of the directory tree, the summary data corresponding to the root directory in the first summary data is compared with the summary data corresponding to the root directory under the same path in the second summary data. If the summary data are the same, it is determined that the data of the entire directory tree corresponding to the root directory is consistent, and the target comparison result is that the summary data of the root directory are the same. If the summary data are different, the summary data of each sub-object at the next level is compared layer by layer down the directory tree until the lowest level object with different summary data is located, and the target comparison result indicating the level object with metadata differences and its path is obtained.

[0054] S204: Based on the comparison results where the summary data is different in the target comparison results, determine the target object to be synchronized and perform data synchronization operation.

[0055] The target object to be synchronized refers to the hierarchical object with metadata differences indicated in the target comparison results, that is, the specific file or directory that needs to be synchronized with the mirror storage node.

[0056] Among them, data synchronization operation refers to the operation of synchronizing the original metadata of the target object to be synchronized in the primary storage node to the corresponding target object in the mirror storage node.

[0057] The data synchronization operation uses the primary storage node as the sole data source and executes unidirectionally to the mirror storage node.

[0058] Specifically, in this embodiment, the processor reads the target objects whose summary data is different from the target comparison results, determines the target objects that have metadata differences and need to be synchronized, and performs data synchronization operation on the corresponding target objects in the mirror storage node.

[0059] Specifically, upon receiving a data synchronization request, the system acquires the metadata information of the first directory tree of the primary storage node and the second directory tree of the mirror storage node, and generates first and second summary data based on the metadata information of the first and second directory trees. The summary data includes summary data corresponding to objects at each level of the directory tree. Therefore, the consistency state of metadata can be quantified into a hierarchical summary data structure, providing a basis for subsequently determining the differing objects corresponding to the differences in metadata between the primary and mirror storage nodes. Furthermore, the first and second summary data are compared according to a preset hierarchical order. Based on the comparison results showing differences in summary data, the target objects to be synchronized are determined, and synchronization operations are performed, thereby achieving precise location and synchronization of the differing objects. Compared to using a full scan, hierarchical summary comparison can quickly locate specific target objects with metadata differences. It precisely limits the scope of directory tree traversal and metadata comparison to the actual target object paths with metadata differences, reducing invalid data traversal and comparison operations. It also ensures the accuracy of locating target objects with metadata differences between the primary storage node and the mirror storage node, as well as the efficiency of system resource utilization, thereby improving the efficiency of metadata synchronization.

[0060] As an optional implementation, based on any of the above embodiments, it further includes:

[0061] Upon receiving confirmation that data synchronization is complete, retrieve the updated metadata information of the second directory tree;

[0062] Generate third summary data based on the metadata information of the updated second directory tree;

[0063] Compare the third summary data with the first summary data;

[0064] Since the third digest data and the first digest data are the same, it is determined that the mirror storage node synchronization was successful.

[0065] In response to the discrepancy between the third and first summary data, it was determined that the mirror storage node synchronization failed, and the steps to determine the target object to be synchronized were re-executed.

[0066] Among them, data synchronization completion means that the data synchronization operation for all target objects to be synchronized has been completed.

[0067] The updated second directory tree refers to the directory tree in the mirror storage node after this data synchronization operation. Since the synchronization operation has written, deleted, updated attributes, or adjusted paths for some target objects, the metadata information of the second directory tree in the mirror storage node has changed. Therefore, it is necessary to re-acquire the updated metadata information to reflect the latest state after synchronization.

[0068] Understandably, since the primary storage node acts as a data source during synchronization, and its data remains unchanged during the synchronization operation, the first summary data represents the current metadata status of the primary storage node.

[0069] It is understandable that comparing the third digest data with the first digest data means comparing the digest data corresponding to the latest metadata information after the mirror storage node is synchronized with the digest data corresponding to the primary storage node, in order to verify whether the synchronization operation has truly achieved metadata consistency between the primary storage node and the mirror storage node.

[0070] Specifically, in this embodiment, after receiving the signal indicating that data synchronization is complete, the processor establishes a communication connection with the mirror storage node and rereads the metadata information of the updated second directory tree corresponding to the mirror storage node. Then, it uses a preset digest generation algorithm to generate third digest data based on the updated metadata information of the second directory tree.

[0071] Specifically, in this embodiment, the processor compares the summary data corresponding to each level of objects in the third summary data with the summary data of the corresponding level of objects under the same path in the first summary data, following a top-down hierarchical order. If the third summary data and the first summary data are identical from the root directory to each level of objects, the data synchronization operation is confirmed to be successfully completed, a synchronization success confirmation record is generated, and the synchronization process ends. If there is any difference between the third summary data and the first summary data, the synchronization operation is determined to be incompletely unsuccessful. Therefore, the target objects with metadata differences are located again by comparing the summary data, a new target synchronization task is generated, and the data synchronization operation and data synchronization completion verification steps are executed again.

[0072] In response to the fact that the third digest data and the first digest data are the same, and after confirming that the mirror storage node has been successfully synchronized, the processor deletes the cached metadata information of the primary storage node and the mirror storage node, and saves the digest data generated by this digest comparison and the corresponding log generated by the comparison result.

[0073] Specifically, after data synchronization is complete, the updated metadata information of the second directory tree is obtained, and a third summary data is generated. The third summary data is compared with the first summary data. If the summary data is the same, the metadata synchronization is confirmed to be successful. If the summary data differs, the metadata synchronization is determined to have failed, and the difference location process is re-entered. By setting up summary re-verification, the integrity of the synchronization operation loop is ensured. When the synchronization result does not meet expectations, a new round of target object location and metadata synchronization is automatically triggered, effectively preventing metadata inconsistencies caused by intermediate state loss or partial execution failure during the synchronization process, thus improving the reliability of the synchronization system.

[0074] As an optional implementation, based on one of the above embodiments, generating first digest data and second digest data based on the metadata information of the first directory tree and the metadata information of the second directory tree includes:

[0075] Obtain the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree;

[0076] A preset summary generation algorithm is used to generate first summary data and second summary data based on the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree.

[0077] The metadata information corresponding to each level of objects refers to the metadata information of all objects contained in each level of the directory tree. The directory tree includes multiple levels, and each level corresponds to a set of objects at the same depth in the directory tree.

[0078] For example, the root directory corresponds to the first level at the top, the direct subdirectories and subfiles under the root directory correspond to the second level, and so on.

[0079] Specifically, in this embodiment, the processor obtains metadata information corresponding to each level of objects in the first directory tree and the second directory tree from a preset database. For each level of objects in the first directory tree, the processor uses the object's own metadata information as input and calls a preset digest generation algorithm to calculate the digest data corresponding to that node. The digest data of all level objects together constitute the first digest data. For the second directory tree, the processor uses the same preset digest generation algorithm and calculation logic to generate the second digest data.

[0080] It is understandable that, since both the first and second summary data are generated using the same preset summary generation algorithm, the summary data corresponding to objects at the same level under the same path should be completely identical, provided that the metadata of the primary storage node and the mirror storage node is consistent.

[0081] The preset summary generation algorithm is pre-defined.

[0082] Optionally, the preset digest generation algorithm can be a cyclic redundancy check, a secure hash algorithm, etc., and this embodiment does not limit it.

[0083] For example, the default digest generation algorithm is a hash algorithm.

[0084] It is understandable that identical metadata information input into a preset digest generation algorithm will generate identical digest data. However, if the input metadata information contains differences in any field or sub-object, the generated digest data will differ, assuming the algorithm collision probability is negligible. Furthermore, since the digest data of each level object is calculated by aggregating its own metadata and the metadata of all its sub-objects, changes to the sub-object's metadata will propagate upwards along the directory tree path, causing the digest data of all ancestor level objects of that sub-object to change synchronously. Therefore, when the digest data of two level objects on the same path are identical, it can be determined that the metadata information of the two level objects on the same path, as well as the sub-objects included under that level object, is identical. When the digest data of two level objects on the same path are inconsistent, it can be determined that their corresponding metadata sets differ, and the inconsistency in the metadata information can be confirmed without traversing and comparing all original metadata fields.

[0085] Specifically, by acquiring the metadata information corresponding to each level in the first directory tree and the metadata information corresponding to each level in the second directory tree, and using a preset digest generation algorithm, first and second digest data are generated based on the metadata information corresponding to each level. Therefore, the metadata status of objects at each level in the directory tree can be uniformly quantified into comparable hierarchical digest data. Through the generation and comparison of hierarchical digest data, the consistency of the entire subtree can be determined through a single digest comparison in the subsequent comparison stage, providing a data foundation for determining the differences between the primary storage node and the mirror storage node.

[0086] As an optional implementation, based on any of the above embodiments, a preset digest generation algorithm is used to generate first digest data and second digest data based on the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree, including:

[0087] For generating the first summary data, obtain the metadata information of each level object in the first directory tree and the metadata information of the sub-objects included under the corresponding level object;

[0088] A preset summary generation algorithm is used to generate summary data for each level of objects in the first directory tree based on the metadata information of each level of objects and the metadata information of the sub-objects included under the corresponding level of objects;

[0089] For generating the second summary data, obtain the metadata information of each level object in the second directory tree and the metadata information of the sub-objects included under the corresponding level object;

[0090] A preset summary generation algorithm is used to generate summary data for each level of the second directory tree based on the metadata information of each level of the objects and the metadata information of the sub-objects included under the corresponding level of the objects.

[0091] The summary data of any hierarchical object is used to uniquely identify the metadata information of the hierarchical object and its sub-objects. When the metadata information of a sub-object changes, the summary data of each parent hierarchical object on the path to which the sub-object belongs also changes.

[0092] It is understandable that the metadata information corresponding to each level of object includes the metadata information of the corresponding level object itself, as well as the metadata information of the child objects included under that level object.

[0093] The sub-objects included under the hierarchical object refer to the next level objects in the directory tree that belong to the hierarchical object. Sub-objects can include sub-file objects and sub-directory objects.

[0094] The metadata information of a hierarchical object refers to the attribute data of the hierarchical object itself. The metadata information of the child objects included under the hierarchical object refers to the attribute data of each child object contained in the hierarchical object.

[0095] Understandably, for a file object, since it does not contain sub-objects, its summary data is generated solely based on the file object's own metadata. For a directory object, its summary data is generated by aggregating the directory object's own metadata and the metadata of all its sub-objects.

[0096] Specifically, in this embodiment, for each level object in the first directory tree, the processor determines whether the current level object is a file object. If it is a file object, the processor obtains the file object's own metadata information and uses a preset digest generation algorithm to calculate and generate digest data corresponding to the file object. If it is a directory object, the processor obtains the directory object's own metadata information and the metadata information of all its sub-objects. The processor combines the directory object's own metadata information and the metadata information of each sub-object according to a preset combination rule and uses a preset digest generation algorithm to calculate and generate digest data corresponding to the directory object. By calculating the digest data layer by layer from bottom to top, the processor generates digest data corresponding to each level object in the first directory tree. The digest data of each level object together constitute the first digest data.

[0097] It is understandable that the second summary data of the second directory tree is generated using the same preset summary generation algorithm and processing logic as the first summary data, so it will not be elaborated here.

[0098] Optionally, the preset combination rules are pre-defined.

[0099] For example, all fields in the directory's own metadata are concatenated into a single string in a preset fixed order. The metadata of all sub-objects is then sorted alphabetically by their names, and the metadata fields of each sub-object are concatenated sequentially. The resulting strings are then joined together using a delimiter to form the final summary input string. A hash value is calculated on the summary input string to obtain the summary data for the directory.

[0100] It is understandable that both the first and second summary data are generated using the same preset summary generation algorithm and the same preset combination rules. In the first and second summary data, the summary data corresponding to objects at the same level along the same path represents the overall consistency status of that node and its subordinate subtrees in the primary and mirror storage nodes, respectively. If the summary data of objects at the same level along the same path is the same, it indicates that all sub-object data within the scope of that node and its subordinate subtrees in the primary and mirror storage nodes are consistent, therefore, further object-by-object comparison of that subtree is unnecessary.

[0101] Specifically, by acquiring metadata information for each level of objects and their sub-objects in the first and second directory trees respectively, and using a preset digest generation algorithm to generate digest data for each level of objects in the main storage node and mirror storage node, the metadata status of each object and its subordinate subtrees in the directory tree can be compressed into a single digest value, generating a hierarchical digest data structure. Based on this hierarchical digest data structure, the digest data of higher-level objects can completely represent the consistency status of all descendant objects within the entire subtree rooted at that level. This allows for the consistency determination of the entire subtree to be completed through a single digest comparison during the location of target objects with differing metadata, significantly reducing the metadata reading and comparison operations for invalid level objects.

[0102] As an optional implementation, based on any of the above embodiments, the first summary data and the second summary data are compared according to a preset hierarchical order to obtain a target comparison result, including:

[0103] Following a top-down hierarchical order, the summary data corresponding to each level of the first summary data in the first directory tree is compared one by one with the summary data of the corresponding level of the second summary data in the second directory tree under the same path to obtain the target comparison result.

[0104] Among them, the comparison results where the summary data corresponding to any level object is the same are used to indicate that the metadata information of the level object corresponding to the mirror storage node and the metadata information of the sub-objects included under the current level object are consistent with the corresponding metadata information in the main storage node.

[0105] The top-down hierarchical order refers to the order in which summary data is compared layer by layer from the root directory of the directory tree.

[0106] In this context, "same path" refers to the location where the directory paths of hierarchical objects in the first directory tree and the second directory tree are completely identical.

[0107] For example, the hierarchical object with the path " / A / B" in the first directory tree and the hierarchical object with the path " / A / B" in the second directory tree are the corresponding hierarchical objects under the same path.

[0108] Here, corresponding level objects refer to objects at the same level under the same path. Since the first directory tree and the second directory tree are mirror images of each other in structure, level objects under the same path should be at the same level depth.

[0109] One-to-one comparison refers to comparing the summary data of a certain level object under a certain path in the first summary data with the summary data of the same level object under the same path in the second summary data one by one to determine whether the two are the same.

[0110] Specifically, in this embodiment, the processor starts from the root directory of the first directory tree and the second directory tree, obtains the corresponding summary data for comparison. If the summary data of the root directory is the same, it is determined that the data of the entire directory tree corresponding to the primary storage node and the mirror storage node is consistent, and the target comparison result is that the summary data of the root directory is the same, and the process ends. If the summary data of the root directory is different, it enters the next level of the root directory and continues to compare. Based on the comparison results of each level, the path information of the level objects with differences is recorded to obtain the target comparison result.

[0111] Specifically, by following a top-down hierarchical order, the summary data corresponding to each level of objects in the first summary data is compared one by one with the summary data of the corresponding level of objects along the same path in the second summary data. Therefore, differences can be located layer by layer downwards from the top of the directory tree. When the summary data of a certain level of object matches, it can be determined that the data of the primary storage node and the mirror storage node are completely consistent within the entire subtree rooted at that level of object, eliminating the need to continue performing summary data comparison operations on each sub-object within that subtree. By only probing down the paths where the summary data differs, the scope of the comparison operation matches the actual paths of the level objects with differences, reducing the number of summary data comparisons for level objects with no differences and improving the efficiency of difference location.

[0112] As an optional implementation, based on any of the above embodiments, the first summary data and the second summary data are compared according to a preset hierarchical order to obtain a target comparison result, including:

[0113] Starting from the first subtree level, compare the summary data of the first subtree level in the first summary data with the summary data of the first subtree level under the same path in the second summary data;

[0114] If they are the same, generate a target comparison result with the same summary data corresponding to the first subtree level, determine that the data of the main storage node and the mirror storage node are the same, and stop the summary data comparison operation;

[0115] If they are different, a comparison result is generated for the first subtree level where the summary data is different. This determines that there is a difference between the data in the mirror storage node and the data in the main storage node. The summary data comparison operation is then performed to obtain the target comparison result.

[0116] The directory tree hierarchy, from top to bottom, includes the first subtree level, the second subtree level, the directory level, and the file level.

[0117] The first subtree level is the top level of the directory tree, corresponding to the root directory. The second subtree level is the next level below the first subtree level, corresponding to the subtrees of each non-root directory in the directory tree. The directory level is the next level below the second subtree level, and includes at least one directory-level hierarchy object.

[0118] In this hierarchy, a directory-level object corresponds to a single directory itself and its direct child objects. The file-level object is the lowest level of the directory tree and corresponds to a single file object.

[0119] It is understandable that a hierarchical object is a specific entity unit with a unique path under each level.

[0120] The first subtree level summary data is the summary of the subtree corresponding to the root directory of the directory tree. The subtree summary corresponding to the root directory refers to the summary data of metadata information of all descendant objects in the entire directory tree, with the root directory as the root.

[0121] Since the root directory is the top level of the entire directory tree, its corresponding subtree summary data can represent the overall consistency status of all metadata in the primary storage node or mirror storage node.

[0122] The second subtree level summary data consists of the subtree summaries of each non-root directory in the directory tree. A non-root directory subtree summary refers to the summary data of all descendant objects within a given non-root directory.

[0123] The directory-level summary data is a summary of the attributes of a single directory and the collection status of its direct subfiles and subdirectories.

[0124] Among them, file-level summary data is a summary of the metadata status of a single file.

[0125] It is understandable that the summary data at each level is generated recursively from bottom to top, and the higher-level summary data is calculated by combining the lower-level summary data.

[0126] Specifically, in this embodiment, the processor performs a summary data comparison operation starting from the first subtree level. It obtains the subtree summary data corresponding to the root directory in the first summary data and the subtree summary data corresponding to the root directory under the same path in the second summary data, and compares them. If the subtree summary data corresponding to the root directory in the first summary data is the same as the subtree summary data corresponding to the root directory in the second summary data, it indicates that the metadata of the entire directory tree rooted at the root directory is the same in both the primary storage node and the mirror storage node, and there are no target objects with different metadata. Therefore, the target comparison result is generated as the summary data corresponding to the first subtree level being the same, thus determining that the data in the primary storage node and the mirror storage node are the same, and the summary data comparison operation stops, without needing to further compare the summary data at lower levels. If they are different, it indicates that at least one node in the directory tree rooted at the root directory has different metadata between the primary storage node and the mirror storage node, and the comparison result for the current level is that the summary data is different. Further, the processor continues to perform the summary data comparison operation at the next lower level to further locate the specific difference nodes and obtain the target comparison result.

[0127] Specifically, the directory tree is divided into four levels from top to bottom: first subtree level, second subtree level, directory level, and file level, with summary data comparison starting from the first subtree level. Therefore, in the initial stage of the comparison process, a single comparison of the root directory subtree summary is sufficient to determine the overall consistency between the primary storage node and the mirror storage node. When the summary data corresponding to the root directory subtree is the same, the metadata consistency of the entire directory tree can be directly confirmed, and the comparison process can be terminated immediately without consuming additional computational and input / output resources to traverse lower-level objects, thus reducing the use of computational resources.

[0128] As an optional implementation, based on any of the above embodiments, a summary data comparison operation is further performed to obtain the target comparison result, including:

[0129] Traverse the summary data of each level downwards in sequence. For the current level being traversed, compare the summary data of the level corresponding to the first summary data with the summary data of the level corresponding to the same path in the second summary data.

[0130] If they are the same, generate a comparison result showing that the summary data of the corresponding level object being traversed is the same, determine that the data of the corresponding level object being traversed and the sub-objects included in the level are consistent, and stop comparing the summary data of the sub-objects included in the corresponding level object being traversed.

[0131] If they are different, generate a comparison result showing that the summary data of the corresponding level object being traversed is different. If it is determined that there is data inconsistency in the sub-objects under the corresponding level object being traversed, continue to enter the next level of the corresponding level object being traversed to perform the summary data comparison operation until all level objects are traversed.

[0132] Record the comparison results at each level to obtain the target comparison result.

[0133] It is understandable that each level may include at least one corresponding level object.

[0134] In this embodiment, when the summary data corresponding to the root directory subtree of the first subtree level are different, the process continues to traverse downwards from the second subtree level, sequentially entering the second subtree level, directory level, and file level, and comparing the summary data of the corresponding objects in each level.

[0135] Specifically, in this embodiment, the summary data corresponding to each non-root directory subtree in the second subtree level of the first summary data, and the summary data corresponding to each non-root directory subtree in the second subtree level under the same path in the second summary data are obtained. The summary data of the corresponding subtrees under the same path are compared one by one. For subtrees with the same summary data, the traversal is not continued downward, and the corresponding level comparison results with the same summary data are generated. For subtrees with different summary data, the process continues to the directory level included under the subtree with different summary data, and the summary data corresponding to each directory under that subtree is compared.

[0136] Similarly, during directory-level comparison, if the summary data of a directory is the same, the comparison of summary data for file-level objects within that directory is stopped. If the summary data of a directory is different, the process continues to the file level, comparing the summary data of each file within that directory to locate the specific file with discrepancies. This process proceeds layer by layer down the difference path until the file level is reached, completing the comparison of objects along all difference paths.

[0137] Furthermore, in this embodiment, after completing the comparison of summary data at each level, the file-level objects with different summary data at each level are summarized, and the complete path information and level of each differing object are recorded to form the target comparison result.

[0138] Understandably, by traversing level by level, pruning operations are directly performed on subtrees with the same summary data, thus avoiding a full traversal of all objects in the entire directory tree.

[0139] Specifically, by sequentially traversing the summary data of each level downwards, the summary data of the corresponding level being traversed is compared. When the comparison result shows that the summary data is the same, it is determined that the metadata of the corresponding level and sub-objects of the primary storage node and the mirror storage node are consistent, and the downward comparison stops. When the comparison result shows that the summary data is different, the comparison operation continues to the next level, thereby reducing the number of summary data comparisons for indistinguishable objects and improving the execution efficiency of difference location.

[0140] As an optional implementation, based on any of the above embodiments, the target object to be synchronized is determined based on the comparison results where the summary data is different in the target comparison results, including:

[0141] In response to comparison results that include different summary data, the hierarchical objects at the file level whose summary data differ from the comparison results are identified as the target objects to be synchronized.

[0142] Among them, the presence of data inconsistency in the target comparison results means that after comparing the summary data at each level, the target comparison results show that there is at least one object with inconsistent data between the primary storage node and the mirror storage node.

[0143] Understandably, when the summary data at the directory level and above differs, the processor will continue to the next level for comparison. Therefore, the final data differences will all be reflected in the file-level summary data comparison results. The file level is the lowest level for difference localization. Objects whose summary data differs at the file level are the final targets for data synchronization.

[0144] Specifically, in this embodiment, based on the target comparison results, information on objects whose summary data at the file level differs is extracted from the target comparison results, and these objects are identified as target objects to be synchronized.

[0145] The object information includes the complete path and identification information of hierarchical objects that do not match the summary data in the comparison results.

[0146] Specifically, by responding to the presence of data differences in the target comparison results, the corresponding nodes in the file-level comparison results that show inconsistent data are identified as the target objects to be synchronized. This ensures that the target objects to be synchronized accurately correspond to the files that actually have differences, thereby avoiding invalid synchronization operations and improving the accuracy of data synchronization.

[0147] As an optional implementation, based on any of the above embodiments, performing data synchronization operations includes:

[0148] Retrieve the first raw data corresponding to the target object to be synchronized in the primary storage node;

[0149] Obtain the second raw data corresponding to the target object to be synchronized in the mirror storage node;

[0150] The type of data difference is determined based on the first and second original data;

[0151] Generate target synchronization tasks based on data difference types;

[0152] The target synchronization task performs data synchronization operations on the target objects to be synchronized in the mirror storage node.

[0153] The first raw data refers to the complete metadata information of the target object to be synchronized, currently stored on the primary storage node. For file nodes, the first raw data includes all metadata information of that file. For directory nodes, the first raw data includes the metadata information of the directory itself, as well as the metadata information and hierarchical relationship information of all child objects under that directory.

[0154] The second raw data refers to the current metadata information stored on the mirror storage node under the path corresponding to the target object to be synchronized.

[0155] Among them, data difference types include at least one of the following types: missing mirror copy type, redundant mirror copy type, inconsistent attribute type, inconsistent extended attribute type, orphan object type, and abnormal hierarchy relationship type.

[0156] The "Missing Mirror Copy" type indicates that the target object exists in the first original data but not in the second original data.

[0157] Among them, the redundant mirror copy type indicates that the target object exists in the second original data, but does not exist in the first original data.

[0158] The "attribute inconsistency" type indicates that the target object exists in both the first and second original data, but its basic attributes are inconsistent. The basic attributes include at least one of the following: permissions, owner, timestamp, and size.

[0159] Among them, the extended attribute inconsistency type indicates that the target object exists in both the first and second original data and has the same basic attributes, but the extended attribute information is inconsistent.

[0160] Among them, the orphan object type indicates that the target object exists in the mirror storage node but its parent directory is missing, causing the object to lose the correct hierarchical relationship in the directory tree.

[0161] Among them, the hierarchical relationship anomaly type indicates that the path position of the target object in the first original data and the second original data is inconsistent, that is, there is a difference in the parent-child relationship in the directory tree.

[0162] Among them, the target synchronization task refers to a task generated based on the data difference type, used to guide the execution of specific synchronization operations on the target object in the mirror storage node. Each target synchronization task includes a task type and the data payload required for task execution.

[0163] Among them, performing data synchronization operations refers to performing specific metadata writing, deletion, attribute modification, or path adjustment operations on the corresponding objects in the mirror storage node according to the task type and data payload of the target synchronization task.

[0164] It is understood that in this embodiment, the primary storage node is the sole authoritative data source, and data synchronization operations are performed sequentially on the target objects to be synchronized in the mirror storage nodes according to the generated target synchronization task. The synchronization operation follows the one-way synchronization principle; all write, modify, and delete operations are performed only on the mirror storage nodes, and the metadata of the mirror storage nodes is prohibited from overwriting the primary storage node.

[0165] Specifically, in this embodiment, the processor reads the first original data corresponding to the target object to be synchronized from the primary storage node, and reads the second original data of the corresponding node under the same path as the target object to be synchronized from the mirror storage node. The processor then compares the acquired first and second original data field by field to determine the data difference type between them, and generates a corresponding target synchronization task based on the data difference type. Based on the target synchronization task, data synchronization operations are sequentially performed on the target objects to be synchronized in the mirror storage nodes.

[0166] It is understandable that during the second raw data reading process, if the corresponding target object does not exist under this path in the mirror storage node, the second raw data will be empty, which is also a kind of data difference state.

[0167] Specifically, by obtaining the first original data of the target object to be synchronized in the primary storage node and the second original data of the corresponding node in the mirror storage node, and determining the data difference type based on the first and second original data, and generating and executing the corresponding target synchronization task based on the data difference type, the system ensures that the corresponding synchronization operation is performed for different data difference types, thereby improving the execution efficiency of synchronization.

[0168] As an optional implementation, based on any of the above embodiments, a target synchronization task is generated based on the data difference type, including:

[0169] Read the data difference type corresponding to the target object to be synchronized;

[0170] Determine the corresponding synchronization operation semantics based on the data difference type;

[0171] The target synchronization task is generated based on the synchronization operation semantics and the first raw data.

[0172] Among them, the semantics of synchronous operation refers to the type definition of the specific correction actions that need to be performed on the target object on the mirror storage node.

[0173] It is understandable that the processor stores a pre-defined mapping relationship between data type differences and corresponding synchronization operation semantics.

[0174] For example, the synchronous operation semantics include at least one of the following: object creation semantics, object deletion semantics, property update semantics, extended property update semantics, and object move semantics.

[0175] Among them, the creation object semantics is used to indicate the addition of a target object on the mirror storage node.

[0176] The "delete object" semantic is used to indicate the removal of a target object from the mirror storage node.

[0177] Among them, the update attribute semantics is used to indicate the modification of the basic attribute fields of the target object on the mirror storage node.

[0178] Among them, updating extended attribute semantics is used to indicate the modification of extended attribute fields of the target object on the mirror storage node.

[0179] Among them, the move object semantics are used to indicate the hierarchical position of the target object in the directory tree on the mirror storage node.

[0180] Specifically, in this embodiment, the processor reads the data difference type corresponding to the target object to be synchronized, determines the corresponding synchronization operation semantics from the preset mapping relationship based on the data type difference, and generates the target synchronization task based on the determined synchronization operation semantics and the corresponding first original data and the path information of the target object.

[0181] Specifically, by reading the data difference type corresponding to the target object to be synchronized and determining the corresponding synchronization operation semantics based on the data difference type, a target synchronization task is generated. This enables target objects with different difference types to generate differentiated synchronization tasks with precise execution semantics and adapted data payloads, thereby improving the execution efficiency of synchronization operations.

[0182] As an optional implementation, based on any of the above embodiments, a data synchronization operation is performed on the target object to be synchronized in the mirror storage node based on the target synchronization task, including:

[0183] According to the target synchronization task, the first raw data is synchronized to the target object to be synchronized in the mirror storage node;

[0184] In response to the successful synchronization of the target object to be synchronized, the corresponding target object to be synchronized in the mirror storage node is marked as the first target;

[0185] In response to the failure of synchronization of the target object to be synchronized, a second mark is made on the corresponding target object to be synchronized in the mirror storage node.

[0186] Among them, successful synchronization means that the target synchronization task executed for a target object to be synchronized has been completed correctly, and the data of the target object in the mirror storage node is completely consistent with the first original data of the corresponding target object in the primary storage node.

[0187] It is understandable that the target object is a specific file or directory with metadata differences between the primary storage node and the mirror storage node, with unique path information, and the metadata information stored in the primary storage node and the mirror storage node is inconsistent.

[0188] The first marker refers to the marker information used to identify that the synchronization of the target object has been completed.

[0189] Optionally, the first marker may take the form of updating the summary status of the target object to a valid state in the stored summary data, or it may be writing a success flag in the synchronization task status record. This embodiment does not impose any specific limitations.

[0190] Synchronization failure refers to the failure of a target synchronization task to be performed on a target object to be synchronized to complete correctly.

[0191] Optionally, the reasons for synchronization failure may include, but are not limited to: network communication interruption, mirror storage node write failure, data verification error, insufficient storage space or insufficient permissions, etc.

[0192] The second marker is used to indicate that the synchronization of the target object has not been completed. Corresponding to the first marker, the second marker is used to distinguish between target objects that have successfully synchronized and those that have failed.

[0193] Optionally, the second marker can take the form of updating the summary status of the target object to a retry status in the summary storage module, or it can be writing a failure identifier and failure reason information into the synchronization task status record. This embodiment does not impose any specific limitations.

[0194] Specifically, in this embodiment, the processor adds target synchronization tasks to the target synchronization task queue and executes the target synchronization tasks sequentially to synchronize the first raw data to the target objects to be synchronized in the mirror storage node. After the processor confirms that the synchronization operation of a target object to be synchronized is successfully executed, it marks the target object in the mirror storage node with a first mark. When it detects that the synchronization operation of a target object to be synchronized fails, it marks the target object in the mirror storage node with a second mark.

[0195] Understandably, by assigning a first mark and a second mark to target objects that have successfully synchronized and those that have failed, the synchronization execution status of each target object can be recorded in real time. On the one hand, successfully synchronized target objects can be quickly identified using the first mark. On the other hand, target objects that have failed to synchronize can be accurately identified and tracked using the second mark. In the event of synchronization interruption or partial failure, there is no need to re-execute the already successful synchronization task; only the target objects marked with the second mark need to be retried, thus supporting the function of resuming interrupted transmissions.

[0196] Specifically, by synchronizing the first raw data to the target object to be synchronized in the mirror storage node according to the target synchronization task, and marking the target object that is successfully synchronized with a first mark and the target object that fails to be synchronized with a second mark, the synchronization execution status of the target object to be synchronized is accurately recorded and differentiated, thereby making the synchronization result of each target object to be synchronized traceable and distinguishable.

[0197] As an optional implementation, based on any of the above embodiments, it further includes:

[0198] In response to receiving a data synchronization interruption, acquire the target objects to be synchronized that are marked with the second mark and the unmarked target objects to be synchronized;

[0199] In response to the current environment meeting the preset conditions, the data synchronization operation is re-executed for the target objects to be synchronized that are marked with the second mark and the unmarked target objects to be synchronized.

[0200] Among them, data synchronization interruption refers to the state in which the data synchronization operation is forced to stop during the execution process due to abnormal circumstances.

[0201] Optionally, the triggering conditions for data synchronization interruption may include, but are not limited to: processor crash, restart or failure of the primary storage node and / or mirror storage node, insufficient storage space causing write operations to be unable to continue, or the administrator actively suspending the synchronization operation.

[0202] It is understandable that when a synchronization interruption occurs, the target objects to be synchronized can be divided into three categories: target objects that have been successfully synchronized and marked as first, target objects that have failed to be synchronized and marked as second, and target objects that have not yet started execution and have not been marked.

[0203] Understandably, the metadata in the mirror storage node of the first-marked target object is already consistent with the corresponding metadata on the primary storage node, and no further synchronization is needed. The metadata of the second-marked target object and the unmarked target object has not yet been synchronized with the primary storage node, and a resynchronization operation needs to be performed after recovery.

[0204] The condition that the current environment meets the preset conditions means that the prerequisites required for the data synchronization operation to be re-executed have been met.

[0205] Optionally, the preset conditions include, but are not limited to, at least one of the following: the processor is running normally, the primary storage node and / or the mirror storage node has been restarted and is in normal operation, the storage space has met the minimum requirements for write operations, and the administrator has retried the synchronization operation.

[0206] Specifically, in this embodiment, after determining that data synchronization has been interrupted, the processor retrieves the target objects marked with the second mark and the unmarked target objects to be synchronized from the target objects corresponding to the mirror storage node. It also periodically determines whether the current environment meets preset conditions. In response to the current environment meeting the preset conditions, it regenerates the corresponding target synchronization tasks for the target objects marked with the second mark and the unmarked target objects to be synchronized, and re-executes the data synchronization operation.

[0207] Specifically, after a data synchronization interruption, the system acquires target objects marked with a second tag and unmarked target objects to be synchronized. Upon environmental recovery, it re-executes the data synchronization operation on the incomplete target objects based on the tagging information. This allows the system to process only the unsuccessful parts during interruption recovery, significantly reducing unnecessary repetitive synchronization operations and shortening the time required for interruption recovery.

[0208] As an optional implementation, based on any of the above embodiments, third digest data is generated based on the metadata information of the updated second directory tree, including:

[0209] Determine the target synchronization object to perform data synchronization in the second directory tree;

[0210] Starting from the bottom up, retrieve the metadata information of each level corresponding to the target synchronization object according to the path information of the target synchronization object;

[0211] Updated summary data for each level is generated based on metadata information for each level corresponding to the target synchronization object.

[0212] The third summary data is generated based on the updated summary data of each level and the second summary data.

[0213] The target synchronization object refers to the target object in the mirror storage node that actually underwent data synchronization during this round of data synchronization operation. It corresponds to the target object to be synchronized determined in this synchronization operation and is the corresponding target object after the target object to be synchronized has actually completed the synchronization operation in the mirror storage node.

[0214] Here, "bottom-up" refers to the order in which metadata information of ancestor directory objects is retrieved layer by layer upwards along the path of the target synchronization object, starting from the file level of the directory tree. Each level corresponding to the target synchronization object refers to all levels traversed from the file level where the target synchronization object resides, upwards along the directory tree to the root directory. The metadata information of each level corresponding to the target synchronization object refers to retrieving the metadata information of the level objects affected by the synchronization operation, rather than retrieving the metadata information of all level objects in the entire second directory tree.

[0215] The third digest data is the final generated complete digest data set that reflects the overall consistency status of the mirror storage nodes after the synchronization operation is completed. The third digest data is formed by merging the updated digest data of each level with the unupdated portion of the second digest data.

[0216] Specifically, in this embodiment, the processor determines the target synchronization objects for data synchronization in the second directory tree from the records of synchronization operations. For each target synchronization object, it determines the hierarchical objects that need to re-acquire metadata information layer by layer along its path from bottom to top, and re-acquires the metadata information of the corresponding hierarchical objects. For file-level target synchronization objects, the file-level summary data is recalculated based on its updated metadata information. For ancestor objects at the directory level and above, the processor re-aggregates and calculates from bottom to top layer by layer based on its updated metadata information and the summary data of its lower-level objects, generating updated file-level, directory-level, second subtree-level, and first subtree-level summary data. The processor merges the updated summary data of each level with the summary data corresponding to the path of the hierarchical object that has not been updated in the second summary data to generate third summary data.

[0217] Specifically, by determining the target synchronization object in the second directory tree, the metadata information of the affected hierarchical objects is obtained from bottom to top according to the path information of the target synchronization object, updated summary data of each level is generated, and the third summary data is generated by combining the summary data of the unupdated part of the second summary data. This achieves incremental summary reconstruction only on the path of the hierarchical object affected by the synchronization operation, reduces the computational overhead and number of metadata reads in the post-synchronization verification stage, shortens the completion time of consistency verification, and improves the overall execution efficiency of synchronization closed-loop verification.

[0218] As an optional implementation, based on any of the above embodiments, it further includes:

[0219] Determine the priority of the data difference types corresponding to the target synchronization tasks;

[0220] The corresponding target synchronization tasks are executed sequentially according to the priority of the data difference type from high to low.

[0221] Optionally, the priority of data difference types is pre-defined.

[0222] The priority of data difference types is used to indicate the order in which different data difference types are processed during synchronous execution.

[0223] Among them, the target synchronization tasks corresponding to high-priority data difference types are executed first, while the target synchronization tasks corresponding to low-priority data difference types are executed later.

[0224] For example, the priority of data difference types, from high to low, can be: missing mirror copy type, redundant mirror copy type, hierarchical relationship anomaly type, orphan object type, attribute inconsistency type, and extended attribute inconsistency type.

[0225] Specifically, in this embodiment, the processor traverses all currently generated target synchronization tasks and reads the data difference type corresponding to each target synchronization task. Based on the preset data difference type priority, the processor determines the execution priority of each target synchronization task and sorts the target synchronization tasks from high to low priority, executing the corresponding target synchronization tasks sequentially.

[0226] It is understandable that priority sorting applies to both serial and parallel execution of synchronous tasks. In serial execution, tasks are executed sequentially from highest to lowest priority. In parallel execution, tasks with higher priority enter their respective parallel queues first.

[0227] Specifically, by determining the priority of the data difference types corresponding to the target synchronization tasks and executing the corresponding target synchronization tasks in descending order of priority, the execution order of each target synchronization task is reasonably arranged according to the degree of impact of the difference type on data consistency and business continuity, thereby ensuring that critical data differences are synchronized first.

[0228] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0229] Figure 3 A flowchart illustrating a data synchronization method provided in another embodiment of this application is shown below. Figure 3 As shown. Specifically, it includes the following steps:

[0230] S301: In response to receiving a data synchronization request, obtain the metadata information of the first directory tree of the primary storage node and the metadata information of the second directory tree of the mirror storage node.

[0231] S302: Use a preset summary generation algorithm to generate first summary data and second summary data based on the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree.

[0232] S303: Following a top-down hierarchical order, compare the summary data corresponding to each level object in the first directory tree corresponding to the first summary data with the summary data of the corresponding level object under the same path in the second directory tree corresponding to the second summary data one by one to obtain the target comparison result.

[0233] S304: The target object to be synchronized is determined based on the target comparison results.

[0234] S305: Obtain the first original data corresponding to the target object to be synchronized in the primary storage node and the second original data corresponding to the target object to be synchronized in the mirror storage node.

[0235] S306: Determine the data difference type based on the first and second original data.

[0236] S307: Generate target synchronization task based on data difference type.

[0237] S308: Perform data synchronization operations on the target objects to be synchronized in the mirror storage node based on the target synchronization task.

[0238] S309: In response to receiving data synchronization completion, obtain the updated metadata information of the second directory tree.

[0239] S310: Generate third summary data based on the metadata information of the updated second directory tree.

[0240] S311: Compare the third summary data with the first summary data.

[0241] S312: In response to the fact that the third digest data and the first digest data are the same, it is determined that the mirror storage node synchronization is successful.

[0242] S313: In response to the discrepancy between the third digest data and the first digest data, it is determined that the mirror storage node synchronization has failed, and the step of determining the target object to be synchronized is re-executed.

[0243] Figure 4 A flowchart illustrating a data synchronization method provided in another embodiment of this application is shown below. Figure 4 As shown. Specifically, it includes the following steps:

[0244] S401: Starting from the first subtree level, compare the summary data of the first subtree level in the first summary data with the summary data of the first subtree level under the same path in the second summary data.

[0245] S402: Determine if the summary data are the same.

[0246] S403: If they are the same, determine that the data on the primary storage node and the mirror storage node are consistent, and stop the summary data comparison operation.

[0247] S404: If they are not the same, it is determined that there is a difference between the data in the mirror storage node and the data in the primary storage node. Then, the summary data of each level is traversed downwards in sequence. For the corresponding level currently being traversed, the summary data of the level in the first summary data is compared with the summary data of the level under the same path in the second summary data.

[0248] S405: If they are the same, determine that the data of the corresponding level object and the sub-objects included under the level object are consistent, and stop comparing the summary data of the sub-objects included under the level object.

[0249] S406: If they are not the same, the comparison result indicates that there is data inconsistency in the sub-objects under the corresponding level of the current traversal. Continue to enter the next level of the corresponding level object of the current traversal to perform the summary data comparison operation until all level objects have been traversed.

[0250] S407: Record the comparison results at each level to obtain the target comparison result.

[0251] Figure 5 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of this application. Figure 5As shown, the execution entity of the above data synchronization method is a data synchronization device, which can be implemented by a computer program; it can also be implemented by a medium storing the relevant computer program, such as a USB flash drive and / or optical disc; or it can be implemented by a physical device integrating or installing the relevant computer program, such as an electronic device. The electronic device can be a computer or a server device. Since the data synchronization device provided in this embodiment is located in an electronic device, the data synchronization device 50 provided in this embodiment includes: an acquisition module 51, a generation module 52, a comparison module 53, a determination module 54, and an execution module 55.

[0252] Specifically, the acquisition module, in response to a received data synchronization request, acquires the metadata information of the first directory tree of the primary storage node and the metadata information of the second directory tree of the mirror storage node. The directory tree includes multiple hierarchical objects. The generation module generates first and second summary data based on the metadata information of the first and second directory trees. The first summary data includes summary data corresponding to each hierarchical object in the first directory tree. The second summary data includes summary data corresponding to each hierarchical object in the second directory tree. The comparison module compares the first and second summary data according to a preset hierarchical order to obtain a target comparison result. The target comparison result includes a comparison result showing whether the summary data of the first and second summary data are identical under the same hierarchical object. The determination module determines the target object to be synchronized based on the comparison result showing that the summary data are different in the target comparison result. The execution module performs the data synchronization operation.

[0253] Optionally, the acquisition module 51 is used to acquire the updated metadata information of the second directory tree in response to receiving data synchronization completion. The generation module 52 is used to generate third digest data based on the updated metadata information of the second directory tree. The comparison module 53 is used to compare the third digest data with the first digest data. The determination module 54 is used to determine that the mirror storage node synchronization is successful in response to the third digest data and the first digest data being the same. The determination module 54 is also used to determine that the mirror storage node synchronization has failed in response to the existence of differences between the third digest data and the first digest data, and to re-execute the step of determining the target object to be synchronized.

[0254] Optionally, the generation module 52, when generating first summary data and second summary data based on the metadata information of the first directory tree and the second directory tree, is specifically used to: obtain the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree; and generate first summary data and second summary data by using a preset summary generation algorithm and based on the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree.

[0255] Optionally, the generation module 52, when generating first and second summary data using a preset summary generation algorithm and based on the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree, specifically performs the following: For generating the first summary data, it acquires the metadata information of each level of objects in the first directory tree and the metadata information of the sub-objects included under the corresponding level of objects; it generates summary data corresponding to each level of objects in the first directory tree using a preset summary generation algorithm and based on the metadata information of each level of objects in the first directory tree and the metadata information of the sub-objects included under the corresponding level of objects; for generating the second summary data, it acquires the metadata information of each level of objects in the second directory tree and the metadata information of the sub-objects included under the corresponding level of objects; it generates summary data corresponding to each level of objects in the second directory tree using a preset summary generation algorithm and based on the metadata information of each level of objects in the second directory tree and the metadata information of the sub-objects included under the corresponding level of objects. Wherein, the summary data of any level of object is used to uniquely identify the metadata information of the level of object and the sub-objects included under the level of object; when the metadata information of a sub-object changes, the summary data of each upper-level level of object on the path to which the sub-object belongs also changes.

[0256] Optionally, when comparing the first summary data and the second summary data according to a preset hierarchical order to obtain the target comparison result, the comparison module 53 is specifically used to: compare the summary data corresponding to each level object in the first directory tree corresponding to the first summary data with the summary data of the corresponding level object under the same path in the second directory tree corresponding to the second summary data one by one according to the top-down hierarchical order to obtain the target comparison result. The comparison result in which the summary data corresponding to any level object is the same is used to indicate that the metadata information of the level object corresponding to the mirror storage node and the metadata information of the sub-objects included under the current level object are consistent with the corresponding metadata information in the main storage node.

[0257] Optionally, the hierarchy of the directory tree from top to bottom includes a first subtree level, a second subtree level, a directory level, and a file level; the summary data of the first subtree level is the subtree summary corresponding to the root directory of the directory tree; the summary data of the second subtree level is the subtree summary of each non-root directory of the directory tree.

[0258] Accordingly, the comparison module 53, when comparing the first summary data and the second summary data according to a preset hierarchical order to obtain the target comparison result, specifically performs the following: starting from the first subtree level, it compares the summary data of the first subtree level in the first summary data and the summary data of the first subtree level under the same path in the second summary data; if they are the same, it generates a target comparison result that the summary data corresponding to the first subtree level is the same, determines that the data of the main storage node and the mirror storage node are the same, and stops the summary data comparison operation; if they are different, it generates a comparison result that the summary data corresponding to the first subtree level is different, determines that there is a difference between the data of the mirror storage node and the data in the main storage node, and continues to perform the summary data comparison operation to obtain the target comparison result.

[0259] Optionally, when the comparison module 53 continues to perform the summary data comparison operation to obtain the target comparison result, it is specifically used to: sequentially traverse the summary data of each level downwards; for the corresponding level currently being traversed, compare the summary data corresponding to the level in the first summary data with the summary data of the corresponding level under the same path in the second summary data; if they are the same, generate a comparison result that the summary data of the corresponding level object currently being traversed is the same, determine that the data of the corresponding level object currently being traversed and the data of the sub-objects included under the level object are consistent, and stop the comparison operation on the summary data of the sub-objects included under the corresponding level object currently being traversed; if they are different, generate a comparison result that the summary data of the corresponding level object currently being traversed is different, determine that there is data inconsistency in the sub-objects under the corresponding level object currently being traversed, and continue to enter the next level of the corresponding level object currently being traversed to perform the summary data comparison operation until all level objects are traversed; record the comparison results of each level to obtain the target comparison result.

[0260] Optionally, when determining the target object to be synchronized based on the comparison results where the summary data is different in the target comparison results, the determining module 54 is specifically used to: in response to the comparison results where the summary data is different in the target comparison results, determine the hierarchical object at the file level where the comparison result is different in the summary data as the target object to be synchronized.

[0261] Optionally, when performing data synchronization operations, the execution module 55 is specifically used to: obtain the first original data corresponding to the target object to be synchronized in the primary storage node; obtain the second original data corresponding to the target object to be synchronized in the mirror storage node; determine the data difference type based on the first original data and the second original data; generate a target synchronization task based on the data difference type; and perform data synchronization operations on the target object to be synchronized in the mirror storage node based on the target synchronization task.

[0262] Optionally, when generating a target synchronization task based on data difference type, the generation module 52 is specifically used to: read the data difference type corresponding to the target object to be synchronized; determine the corresponding synchronization operation semantics based on the data difference type; and generate the target synchronization task based on the synchronization operation semantics and the first original data.

[0263] Optionally, when the execution module 55 performs a data synchronization operation on the target object to be synchronized in the mirror storage node based on the target synchronization task, it is specifically used to: synchronize the first original data to the target object to be synchronized in the mirror storage node according to the target synchronization task; in response to the successful synchronization of the target object to be synchronized, mark the corresponding target object to be synchronized in the mirror storage node with a first mark; in response to the failure of the synchronization of the target object to be synchronized, mark the corresponding target object to be synchronized in the mirror storage node with a second mark.

[0264] Optionally, the acquisition module 51 is configured to acquire, in response to receiving a data synchronization interruption, the target objects to be synchronized marked with a second mark and the unmarked target objects to be synchronized. The execution module 55 is configured to re-execute the data synchronization operation on the target objects to be synchronized marked with a second mark and the unmarked target objects to be synchronized in response to the current environment meeting preset conditions.

[0265] Optionally, when generating the third summary data based on the updated metadata information of the second directory tree, the generation module 52 is specifically used to: determine the target synchronization object for performing data synchronization in the second directory tree; sequentially obtain the metadata information of each level corresponding to the target synchronization object from bottom to top according to the path information of the target synchronization object; generate updated summary data of each level based on the metadata information of each level corresponding to the target synchronization object; and generate the third summary data based on the updated summary data of each level and the second summary data.

[0266] Optionally, the determining module 54 is used to determine the priority of the data difference type corresponding to the target synchronization task. The execution module 55 is used to execute the corresponding target synchronization tasks in descending order of priority of the data difference type.

[0267] For a description of the features in the embodiment corresponding to the data synchronization device, please refer to the relevant description in the embodiment corresponding to the data synchronization method, which will not be repeated here.

[0268] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes at least one processor 101 and a memory 601. Optionally, the electronic device 60 further includes a communication component 602. The processor 101, memory 601, and communication component 602 are connected via a bus.

[0269] In a specific implementation, at least one processor 101 executes computer execution instructions stored in memory 601, causing at least one processor 101 to perform the steps in any of the above data synchronization method embodiments.

[0270] The specific implementation process of processor 101 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0271] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0272] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0273] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0274] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described data synchronization method embodiments at runtime.

[0275] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0276] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described data synchronization method embodiments.

[0277] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described data synchronization method embodiments.

[0278] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.

[0279] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0280] The data synchronization method provided in this application has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A data synchronization method, characterized in that, The method is applied to a processor, and the method includes: In response to receiving a data synchronization request, the metadata information of the first directory tree of the primary storage node and the metadata information of the second directory tree of the mirror storage node are obtained; wherein, the directory tree includes multiple levels; First summary data and second summary data are generated based on the metadata information of the first directory tree and the metadata information of the second directory tree; the first summary data includes summary data corresponding to each level of objects in the first directory tree; the second summary data includes summary data corresponding to each level of objects in the second directory tree. The first summary data and the second summary data are compared in a preset hierarchical order to obtain a target comparison result; the target comparison result includes a comparison result of whether the summary data of the first summary data and the second summary data are the same under the same hierarchical object; Based on the comparison results where the summary data is different in the target comparison results, the target objects to be synchronized are determined, and the data synchronization operation is performed.

2. The data synchronization method according to claim 1, characterized in that, Also includes: Upon receiving confirmation that data synchronization is complete, retrieve the updated metadata information of the second directory tree; Generate third summary data based on the metadata information of the updated second directory tree; Compare the third summary data with the first summary data; If the third digest data is the same as the first digest data, it is determined that the mirror storage node has been successfully synchronized. In response to the discrepancy between the third digest data and the first digest data, it is determined that the mirror storage node synchronization has failed, and the step of determining the target object to be synchronized is re-executed.

3. The data synchronization method according to claim 1, characterized in that, The generation of first digest data and second digest data based on the metadata information of the first directory tree and the metadata information of the second directory tree includes: Obtain the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree; A preset summary generation algorithm is used to generate first summary data and second summary data based on the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree.

4. The data synchronization method according to claim 3, characterized in that, The step of generating first and second digest data using a preset digest generation algorithm and based on the metadata information corresponding to each level of objects in the first directory tree and the metadata information corresponding to each level of objects in the second directory tree includes: For generating the first summary data, obtain the metadata information of each level object in the first directory tree and the metadata information of the sub-objects included under the corresponding level object; A preset summary generation algorithm is used to generate summary data corresponding to each level of the first directory tree based on the metadata information of each level of the objects in the first directory tree and the metadata information of the sub-objects included under the corresponding level of the objects. For generating the second summary data, obtain the metadata information of each level object in the second directory tree and the metadata information of the sub-objects included under the corresponding level object; A preset summary generation algorithm is used to generate summary data corresponding to each level object in the second directory tree based on the metadata information of each level object and the metadata information of the sub-objects included under the corresponding level object. The summary data of any level object is used to uniquely identify the metadata information of the level object and the sub-objects included under the level object. When the metadata information of the sub-object changes, the summary data of each upper-level level object on the path to which the sub-object belongs also changes.

5. The data synchronization method according to claim 1, characterized in that, The step of comparing the first summary data and the second summary data according to a preset hierarchical order to obtain a target comparison result includes: Following a top-down hierarchical order, the summary data corresponding to each level object in the first directory tree corresponding to the first summary data is compared one by one with the summary data of the corresponding level objects under the same path in the second directory tree corresponding to the second summary data to obtain the target comparison result. The comparison result where the summary data corresponding to any level object is the same indicates that the metadata information of the level object corresponding to the mirror storage node and the metadata information of the sub-objects included under the current level object are consistent with the corresponding metadata information in the main storage node.

6. The data synchronization method according to claim 1, characterized in that, The directory tree has a hierarchy from top to bottom, including a first subtree level, a second subtree level, a directory level, and a file level; the summary data of the first subtree level is the subtree summary corresponding to the root directory of the directory tree; the summary data of the second subtree level is the subtree summary of each non-root directory of the directory tree. The step of comparing the first summary data and the second summary data according to a preset hierarchical order to obtain a target comparison result includes: Starting from the first subtree level, the summary data of the first subtree level in the first summary data is compared with the summary data of the first subtree level under the same path in the second summary data; If they are the same, generate the target comparison result where the summary data corresponding to the first subtree level is the same, determine that the data of the main storage node and the mirror storage node are the same, and stop the summary data comparison operation; If they are different, a comparison result is generated indicating that the summary data corresponding to the first subtree level is different. This determines that there is a difference between the data in the mirror storage node and the data in the main storage node. The summary data comparison operation is then performed to obtain the target comparison result.

7. The data synchronization method according to claim 6, characterized in that, The step of continuing to perform the summary data comparison operation to obtain the target comparison result includes: The summary data of each level is traversed downwards in sequence. For the current level being traversed, the summary data corresponding to the level in the first summary data is compared with the summary data of the corresponding level under the same path in the second summary data. If they are the same, a comparison result is generated to show that the summary data of the corresponding level object being traversed is the same. It is determined that the data of the corresponding level object being traversed and the data of the sub-objects included under the level object are consistent, and the comparison operation on the summary data of the sub-objects included under the corresponding level object being traversed is stopped. If they are different, a comparison result is generated to show that the summary data of the corresponding level object being traversed is different. It is determined that there is data inconsistency in the sub-objects under the corresponding level object being traversed. The summary data comparison operation is then performed on the next level of the corresponding level object being traversed until all level objects are traversed. Record the comparison results at each level to obtain the target comparison result.

8. The data synchronization method according to claim 1, characterized in that, The process of determining the target object to be synchronized based on the comparison results where the summary data is different in the target comparison results includes: In response to the fact that the target comparison results include comparison results with different summary data, the hierarchical objects with different summary data in the file-level comparison results are identified as target objects to be synchronized.

9. The data synchronization method according to claim 1, characterized in that, The data synchronization operation includes: Obtain the first original data corresponding to the target object to be synchronized in the main storage node; Obtain the second original data corresponding to the target object to be synchronized in the mirror storage node; The data difference type is determined based on the first raw data and the second raw data; Generate a target synchronization task based on the data difference type; Based on the target synchronization task, a data synchronization operation is performed on the target object to be synchronized in the mirror storage node.

10. The data synchronization method according to claim 9, characterized in that, The generation of the target synchronization task based on the data difference type includes: Read the data difference type corresponding to the target object to be synchronized; The corresponding synchronization operation semantics are determined based on the data difference type. A target synchronization task is generated based on the synchronization operation semantics and the first original data.

11. The data synchronization method according to claim 9, characterized in that, The step of performing data synchronization operations on the target object to be synchronized in the mirror storage node based on the target synchronization task includes: According to the target synchronization task, the first raw data is synchronized to the target object to be synchronized in the mirror storage node; In response to the successful synchronization of the target object to be synchronized, the target object to be synchronized in the mirror storage node is marked as a first marker. In response to the failure of synchronization of the target object to be synchronized, a second mark is made on the target object to be synchronized corresponding to the mirror storage node.

12. The data synchronization method according to claim 11, characterized in that, Also includes: In response to receiving a data synchronization interruption, the target object to be synchronized marked with a second mark and the unmarked target object to be synchronized are obtained; In response to the current environment meeting preset conditions, the data synchronization operation is re-executed for the target objects to be synchronized that are marked with the second mark and the unmarked target objects to be synchronized.

13. The data synchronization method according to claim 2, characterized in that, The generation of third digest data based on the metadata information of the updated second directory tree includes: Identify the target synchronization object to be performed in the second directory tree; Starting from the bottom up, according to the path information of the target synchronization object, the metadata information of each level corresponding to the target synchronization object is obtained sequentially. Based on the metadata information of each level corresponding to the target synchronization object, updated summary data for each level is generated; The third summary data is generated based on the updated summary data of each level and the second summary data.

14. The data synchronization method according to claim 9, characterized in that, Also includes: Determine the priority of the data difference type corresponding to the target synchronization task; The corresponding target synchronization tasks are executed sequentially according to the priority of the data difference types from high to low.

15. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data synchronization method as described in any one of claims 1 to 14 when executing the computer program.