Data conflict processing method, electronic equipment, readable medium and program product

By monitoring and conflict detection on the files under the file synchronization path, combined with priority evaluation and intelligent merger algorithm, the problem of data conflict in multi -user or multi -device environment, improved the efficiency and consistency of data synchronization, ensured the system to ensure the system. Transparency and reliability.

CN119336524APending Publication Date: 2025-01-21BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411452298.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

When multiple users or multiple devices edit the same data item at the same time, data conflicts will inevitably occur during the data synchronization process. If these conflicts cannot be resolved in a timely or effectively, it may lead to data inconsistency, data loss or overwrite, thereby affecting users Experience and business processes.

Method used

Monitor the files under the file synchronization path, perform the file conflict detection, conduct priority evaluation, sort the conflict based on the priority score, and select the appropriate version for conflict solving. The conflict generation version number and store the relevant information.

Benefits of technology

Ensure that key data is prioritized during the file synchronization process to avoid the loss of important information. The intelligent merging algorithm reduces manual intervention and improves the efficiency and integrity of data synchronization. System transparency and synchronization reliability are improved to ensure multi-user, multi-user Data consistency and efficient synchronization in device environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336524A_ABST
    Figure CN119336524A_ABST
Patent Text Reader

Abstract

The invention provides a data conflict processing method. The data conflict processing method comprises the following steps: monitoring files under a file synchronization path; when the change of the file is monitored, executing file conflict detection to determine whether conflicts which cannot be merged exist or not; performing priority evaluation on the conflicts which cannot be merged to obtain priority scores; performing priority ranking on the conflicts which cannot be merged based on the priority scores, and generating a priority ranking result; according to the priority ranking result, selecting a proper version to carry out conflict resolution on the conflict which cannot be merged; generating version numbers for the unselected conflicts which cannot be merged, and storing the unselected conflicts which cannot be merged and related detailed information into a database or recording the unselected conflicts which cannot be merged and the related detailed information in a persistent file mode. The disclosure also provides an electronic device, a computer readable medium, and a computer program product. According to the method, manual intervention is reduced in the file synchronization process, and important data is ensured to be processed preferentially.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of file synchronization and data conflict management, and in particular to a data conflict processing method, an electronic device, a computer-readable medium, and a computer program product. Background Art

[0002] With the development of cloud computing, mobile computing and IoT technologies, more and more applications need to support multiple users or multiple devices to access and edit shared data at the same time. For example, online collaboration platforms, enterprise resource planning (ERP) systems, content management systems (CMS) and distributed team collaboration tools. In these applications, data consistency and real-time performance are crucial. However, when multiple users or multiple devices edit the same data item at the same time, data conflicts will inevitably occur during data synchronization. If these conflicts cannot be resolved in a timely or effective manner, data inconsistency, data loss or overwriting may occur, affecting user experience and business processes. Summary of the invention

[0003] The embodiments of the present disclosure provide a data conflict processing method, an electronic device, a computer-readable medium, and a computer program product.

[0004] In a first aspect, an embodiment of the present disclosure provides a data conflict handling method, comprising: monitoring files under a file synchronization path; when changes in the files are monitored, performing file conflict detection to determine whether there are unmergeable conflicts; for the unmergeable conflicts, performing priority evaluation to obtain a priority score; prioritizing the unmergeable conflicts based on the priority score and generating a priority ranking result; based on the priority ranking result, selecting a suitable version to resolve the unmergeable conflicts and generate an integrated file; generating version numbers for unselected unmergeable conflicts, and storing the unselected unmergeable conflicts and their related detailed information in a database or recording them in the form of persistent files.

[0005] In some embodiments, before monitoring files under the file synchronization path, it also includes: creating a source-side policy to determine the file synchronization path and defining a conflict configuration for handling conflicts, wherein the conflict configuration includes: a conflict detection configuration, defining conflict detection rules, including selecting a difference algorithm and setting conflict type standards; a priority configuration, setting priority evaluation factors and their weights; a conflict resolution configuration, setting processing methods for different conflict types; and a version control configuration, setting a recording and management method for unselected, unmergeable conflicts.

[0006] In some embodiments, when changes to the file are monitored, file conflict detection is performed to determine whether there is an unmergeable conflict, including: when changes to the file are monitored, using a difference algorithm to compare different versions of the file to obtain the changed part; and determining whether the changed part is a mergeable conflict or an unmergeable conflict based on the conflict type standard.

[0007] In some embodiments, the difference algorithm is adaptively adjusted based on the type of file.

[0008] In some embodiments, for the unmergeable conflicts, a priority evaluation is performed to obtain a priority score, including: determining priority evaluation factors and weights assigned to the priority evaluation factors based on the priority configuration; and calculating the priority score using a weighted scoring method using the priority evaluation factors and the weights.

[0009] In some embodiments, the priority evaluation factors and the weights may be dynamically adjusted according to user needs.

[0010] In some embodiments, based on the priority sorting result, a suitable version is selected to resolve the unmergeable conflicts, including: for the mergeable conflicts, using a merge algorithm to generate merged content; for the unmergeable conflicts, selecting the highest priority conflict based on the priority sorting result and generating selected content; combining the merged content and the selected content to generate an integrated file; and recording a conflict resolution log.

[0011] In some embodiments, a version number is generated for an unselected, unmergeable conflict, and the unselected, unmergeable conflict and its related detailed information are stored in a database or recorded in a persistent file, further comprising: exporting the unselected, unmergeable conflict based on the version number; and renaming the unselected, unmergeable conflict and placing it under the file synchronization path.

[0012] In some embodiments, the data conflict handling method further includes: encrypting the integrated file; sending the encrypted file to a destination; decrypting the encrypted file at the destination; and storing the decrypted file on a disk.

[0013] In a second aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a memory on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the data conflict handling method described in the first aspect of the embodiment of the present disclosure.

[0014] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, the data conflict handling method described in the first aspect of the embodiment of the present disclosure is implemented.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the data conflict handling method described in the first aspect of the embodiment of the present disclosure.

[0016] The present disclosure ensures that key data is processed first during the file synchronization process to avoid the loss of important information through a priority-based conflict resolution mechanism. The intelligent merging algorithm reduces manual intervention and improves the efficiency and integrity of data synchronization. For conflicting data that cannot be merged, the system retains detailed historical records through version control to facilitate data backtracking by users. Overall, this technical solution enhances the transparency and synchronization reliability of the system, ensuring data consistency and efficient synchronization in a multi-user, multi-device environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of a data conflict processing method according to an embodiment of the present disclosure;

[0018] Figure 2 is a schematic timing diagram of a data conflict processing method according to an embodiment of the present disclosure;

[0019] Figure 3 is a schematic diagram of the composition of an electronic device according to an embodiment of the present disclosure;

[0020] Figure 4 is a block diagram of a data conflict processing system according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the technical solution of the present disclosure is described in detail below with reference to the accompanying drawings.

[0022] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.

[0023] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0024] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0025] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.

[0026] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.

[0027] In this disclosure, unless otherwise specified, the following technical terms should be understood as follows:

[0028] Data synchronization refers to maintaining data consistency between multiple devices or systems, ensuring that data changes in one system or device can be propagated to other systems or devices in a timely manner.

[0029] Conflict detection refers to the phenomenon in which the system detects conflicts in modifications when multiple sources make different modifications to the same data during data synchronization.

[0030] The smart merge algorithm is an algorithm for handling conflicting data. It analyzes the differences between different versions of data and intelligently merges multiple modifications into a consistent data set.

[0031] The three-way merge algorithm is an algorithm for merging multiple versions of files or data by simultaneously considering the modifications of two versions and their common ancestors to calculate a merged version that contains all modifications.

[0032] Disk writing refers to the process of writing data to disk or storage media at the receiving end to ensure persistent storage of data.

[0033] A differential algorithm is an algorithm used to compare the differences between two versions of a file or data set and identify what has changed.

[0034] Myers Difference Algorithm is a difference algorithm for comparing text files, which can efficiently find the minimum edit distance between two text versions.

[0035] ConcurrentHashMap is a concurrent and safe hash table implementation that allows multiple threads to read and write without locking the entire data structure, ensuring efficient concurrent access.

[0036] Data rollback refers to the process of retaining historical versions of data so that users can view and restore specific versions of data.

[0037] The purpose of the present disclosure is to provide a data conflict processing method, which improves the efficiency and accuracy of data editing and synchronization in a multi-user or multi-device environment through an automatic data conflict resolution mechanism based on priority and version control.

[0038] The present disclosure provides a data conflict handling method, which monitors file changes in real time through source-side policy configuration. When data conflicts are detected, the conflicting data are weightedly evaluated and sorted according to priority evaluation factors configured by the user, and the conflicts are automatically resolved in combination with an intelligent merging algorithm to ensure data consistency and integrity. For conflicts that cannot be merged, the highest priority version is given priority, and the historical information of each edit is recorded through version control to ensure data traceability and system transparency.

[0039] The data conflict handling method disclosed in the present invention aims to solve the following problems:

[0040] During the file synchronization process, for data conflicts, the disclosed method calculates the priority of each conflicting data item through user-defined priority configuration (such as data importance, user permissions, etc.), ensuring that high-priority data can be updated and synchronized first.

[0041] The disclosed method integrates an intelligent algorithm, which can intelligently merge conflicting data when data conflicts are detected, minimizing manual intervention. By analyzing the different sources and contexts of conflicting data, it can merge the edits of different users as much as possible, ensure the integrity and consistency of data, and avoid data loss caused by conflicts.

[0042] For data conflicts that cannot be merged, each version of the conflict is recorded through the version control mechanism. After each conflict, the versions before and after the conflict are saved to ensure that users can trace back to any version of the data at any time, which is convenient for manual adjustment or recovery, ensuring the security and traceability of the data.

[0043] Figure 1 It is a flow chart of a data conflict processing method according to an embodiment of the present disclosure.

[0044] First, refer to Figure 1 , the present disclosure provides a data conflict processing method, including:

[0045] S11, monitoring the files under the file synchronization path;

[0046] S12, when monitoring the change of the file, performing file conflict detection to determine whether there is an unmergeable conflict;

[0047] S13, for the unmergeable conflicts, performing a priority evaluation to obtain a priority score;

[0048] S14, prioritizing the unmergeable conflicts based on the priority scores and generating a priority ranking result;

[0049] S15. According to the priority sorting result, select a suitable version to resolve the unmergeable conflicts and generate an integrated file;

[0050] S16. Generate version numbers for unselected unmergeable conflicts, and store the unselected unmergeable conflicts and related detailed information in a database or record them in a persistent file.

[0051] In the embodiment of the present disclosure, before monitoring the files under the file synchronization path, the method further includes:

[0052] Creating a source policy to determine the file synchronization path and defining a conflict configuration for handling conflicts,

[0053] Wherein, the conflict configuration includes:

[0054] Conflict detection configuration, which defines conflict detection rules, including selecting a difference algorithm and setting conflict type criteria;

[0055] Priority configuration, setting priority evaluation factors and their weights;

[0056] Conflict resolution configuration, setting the processing methods for different conflict types;

[0057] Version control configuration, which sets the recording and management method of unselected unmergeable conflicts.

[0058] In some embodiments, the file synchronization path specifies a folder or directory that needs to be monitored in real time.

[0059] In some embodiments, in the conflict detection configuration, conflict detection rules are defined, including a difference algorithm for comparing different versions of a file and obtaining the changed parts, and predefined conflict type standards, such as whether the same part of a file is modified by different sources (such as two users modifying the same line at the same time); whether the deletion and modification operations of a file conflict (such as one user deletes a file, and another user modifies the file); whether the path change or file name modification conflicts. The conflict detection rule is a predefined logic or algorithm that processes the changes identified by the difference algorithm, and classifies these changes according to the conflict type, and determines whether the conflict is a mergeable conflict or an unmergeable conflict.

[0060] In some embodiments, in the priority configuration, priority evaluation factors and their weights are pre-set. For example, multiple priority evaluation factors (e.g., user authority, timestamp, data keyword, etc.) can be pre-set according to actual needs, and weights are pre-assigned to the priority evaluation factors according to their importance. Users can also adjust these factors according to actual needs so as to apply different evaluation criteria in different scenarios.

[0061] In some embodiments, in the conflict resolution configuration, conflict handling methods for different conflict types are set, including, for mergeable conflicts, using a merge algorithm (e.g., a three-way merge algorithm, etc.) for automatic merging; for non-mergeable conflicts, selecting a suitable version for conflict resolution based on priority sorting results.

[0062] In some embodiments, in the version control configuration, a method for recording and managing unselected conflicting file versions is set, including storing detailed information of each edit, such as version number, editor, modification time and content changes, to support data backtracking and history management.

[0063] Those skilled in the art should understand that the data conflict handling method disclosed in the present invention creates a source-side policy, and the policy includes a file synchronization path and a conflict configuration. When the monitoring thread monitors the configured folder path, the thread will continue to monitor file changes in the specified path according to a pre-set policy. This means that once a file is modified, deleted, or added, the monitoring thread will capture these events in real time, and record the file change information (such as file path, modification time, file size, etc.), and start the subsequent processing flow. The conflict configuration allows the user to choose a solution to a conflict, including: conflict detection configuration; priority configuration, which defines file priority calculation rules, such as file attributes and data importance; version control configuration; conflict resolution configuration, depending on the type of conflict, choose to merge or process unresolved conflicts by priority.

[0064] In some embodiments, monitoring files under the file synchronization path includes:

[0065] Automatically start the monitoring thread through the source end strategy and create a listener;

[0066] The listener is used to listen to the files under the file synchronization path to monitor changes of the files.

[0067] Those skilled in the art should understand that the method of monitoring file changes is not limited to creating a listener, and other methods can also be used to monitor file changes, such as monitoring files in the monitoring directory through the built-in functions of the operating system; using third-party tools to monitor files in the monitoring directory; using metadata services provided by distributed file systems (such as HDFS) to monitor the status and changes of files in real time.

[0068] In some embodiments, monitoring files under the file synchronization path includes:

[0069] Automatically triggering the built-in function of the operating system or the metadata service of the distributed file system through the source end policy;

[0070] The files under the file synchronization path are monitored using the built-in function of the operating system or the metadata service of the distributed file system to monitor changes of the files.

[0071] Those skilled in the art should understand that the method disclosed herein creates a listener after the policy configuration is completed to monitor file changes in real time, which not only monitors changes in file data but also monitors changes in all related attributes of the file. Potential data conflicts are identified by comparing the current data status and operations.

[0072] In the embodiment of the present disclosure, when the change of the file is monitored, file conflict detection is performed to determine whether there is an unmergeable conflict, including:

[0073] When a change of the file is monitored, a difference algorithm is used to compare different versions of the file to obtain a changed portion;

[0074] According to the conflict type standard, it is determined whether the changed portion is a mergeable conflict or an unmergeable conflict.

[0075] In some embodiments, the difference algorithm includes but is not limited to: Myers difference algorithm, longest common subsequence (LCS) algorithm, edit distance algorithm (Levenshtein distance).

[0076] In the disclosed embodiment, the difference algorithm is adaptively adjusted based on the file type, for example, Myers algorithm is used for text files, or a checksum-based algorithm is used for binary files.

[0077] In some embodiments, when the file conflict detection finds no conflict, the source end will directly perform a file synchronization operation.

[0078] In some embodiments, the changes in the file include, but are not limited to: changes in file attributes (such as changes in the file path, etc.), and changes in file content (such as modification, addition or deletion of file data, etc.).

[0079] In some embodiments, when changes to the file are monitored, performing file conflict detection to determine mergeable conflicts and unmergeable conflicts further includes: recording file information when changes to the file are monitored.

[0080] In some embodiments, the file information when file changes are monitored includes but is not limited to: a policy ID, which is used to identify the synchronization policy applicable to the file; a file path, which uniquely identifies the location of the file and helps distinguish different files; a file action, which records the type of operation on the file (addition, modification, deletion, etc.) to facilitate understanding the nature of the file change; the last modification time when discovered, which records the timestamp of the last modification of the file to help identify whether the file is the latest version; the timestamp of the current system discovered by the monitoring thread, which is used to record the time when the thread first detected a file change; the file size discovered by the monitoring thread, which records the size of the current file, can help quickly identify whether the file has changed; the destination data source name, which identifies the target location for file synchronization, that is, the destination to which the data is ultimately transmitted or synchronized.

[0081] In some embodiments, mergeable conflicts generally refer to modified parts that are unrelated to each other or semantically compatible. The criteria for judging the mergeable conflict types include, but are not limited to, the following situations: modification of different parts, format modification and content modification, spelling correction and structural adjustment, and content addition at the end of the document.

[0082] In some embodiments, the criteria for determining the type of conflict that cannot be merged include, but are not limited to, the following situations: mutually exclusive modifications of the same part, deletion and modification conflicts, file path / name conflicts, formatting conflicts, and metadata conflicts. The types of conflict that cannot be merged are usually more complex and usually need to be handled according to priority rules or manual selection.

[0083] In the embodiment of the present disclosure, for the unmergeable conflicts, priority evaluation is performed to obtain a priority score, including:

[0084] Based on the priority configuration, determining priority evaluation factors and weights assigned to the priority evaluation factors;

[0085] A priority score is calculated by a weighted scoring method using the priority evaluation factors and the weights.

[0086] In the embodiment of the present disclosure, the priority evaluation factor and the weight can be dynamically adjusted according to the needs of the user, for example, according to the importance of the file or the permissions of different users.

[0087] In some embodiments, the priority evaluation factors may include:

[0088] User permissions, such as giving administrators higher priority than ordinary users;

[0089] Timestamp, files with later modification times are given priority;

[0090] Data keywords, if the file contains keywords, it is more important;

[0091] Other evaluation factors, for example, assign different weights to specific file types, directories, or operations (such as deletion, modification, etc.) according to user-preset policies.

[0092] In some embodiments, a weight is assigned to each priority evaluation factor based on the user policy. The weight assignment reflects the importance of different factors in the decision-making. Specifically, for example, the weight of user authority is 40%, the timestamp is 30%, the data keyword is 20%, and the other evaluation factors are 10%. For each conflict, the priority score of each conflict is calculated based on the actual value scores of different factors and the weights of each factor. For example, user authority score: the administrator's score is 100, and the ordinary user's score is 50; timestamp score: the later the time, the higher the score, for example, the most recent modification gets 90 points, and the earlier modification gets 50 points; data keyword score: if the keyword is included, the score is high, otherwise it is low; other factors are given corresponding scores according to the operation type. The scores of these priority evaluation factors are combined with the assigned weights to calculate the priority score of each conflict.

[0093] In some embodiments, once the priority scores of the conflicts are calculated, the conflicts are sorted according to these scores. The higher the score, the higher the priority, indicating that the conflict is more important.

[0094] In some embodiments, prioritizing the unmergeable conflicts based on the priority scores and generating a prioritization result comprises:

[0095] Sorting the unmergeable conflicts from high to low or from low to high according to the priority scores;

[0096] Generate and output the priority ranking results.

[0097] In the embodiment of the present disclosure, according to the priority sorting result, selecting a suitable version to resolve the unmergeable conflict includes:

[0098] For the mergeable conflicts, using a merge algorithm to generate merged content;

[0099] For the unmergeable conflicts, selecting the conflict with the highest priority according to the priority sorting result and generating the selected content;

[0100] Combining the merged content and the selected content to generate an integrated file;

[0101] Record conflict handling logs.

[0102] In some embodiments, the merging algorithm includes but is not limited to: a three-way merging algorithm, a recursive merging algorithm, and a minimum edit distance algorithm. The merging algorithm intelligently merges non-conflicting parts according to the modified contents of different versions.

[0103] In some embodiments, the conflict handling log includes: version number, user, IP, file name, time, conflict content, and detailed information related to the conflict handling process. While resolving the conflict, the detailed log information of the conflict handling is recorded. For those conflict data with lower priority, a version number is assigned to it and saved to the database or recorded as a persistent file so that the user can trace back the relevant data and track the resolution of each conflict when needed in the future.

[0104] In the embodiment of the present disclosure, a version number is generated for the unselected unmergeable conflicts, and the unselected unmergeable conflicts and their related detailed information are stored in a database or recorded in a persistent file, further comprising:

[0105] deriving the unselected unmergeable conflicts based on the version numbers;

[0106] The unselected unmergeable conflicts are renamed and placed in the file synchronization path.

[0107] In some embodiments, the user can view different versions of each file based on the version number, audit the content changes, editing time and related personnel of each version, and export the data of a certain version as needed.

[0108] Those skilled in the art should understand that in the method disclosed herein, for conflicting data that cannot be merged, the unselected version is added with a version number and stored in a database or a persistent file. Unsent data is stored specifically to facilitate user backtracking. Detailed information of each edit (such as editor, time, content changes, etc.) will be stored together with the version number. For the database table storing conflicting versions that cannot be merged, each record will have a unique identifier (primary key), which is automatically incremented. In other words, whenever a new conflicting version is inserted into the database, the system will automatically assign it a new number, which will serve as the "version number" of the version. There is also a similar mechanism in the persistent file, and each file version has an independent identifier for subsequent search and backtracking. The user can understand the change record of the detailed conflicting data through the system interface, and can export the data of that version number according to each version number, then rename it, and choose whether to put it back in the monitoring directory for sending, thereby achieving the backtracking function of the conflicting data, ensuring that the data modified each time is not lost.

[0109] In some embodiments, the content related to the unmergeable conflict includes detailed information such as editor, modification time, content changes, etc.

[0110] In the embodiment of the present disclosure, the data conflict handling method further includes:

[0111] Encrypting the integrated file;

[0112] Send the encrypted file to the destination;

[0113] decrypting the encrypted file at the destination end;

[0114] The decrypted file is stored on disk.

[0115] Those skilled in the art should understand that when a data conflict occurs, the source end will send the integrated file. Logs and unselected versions are usually not sent to avoid conflicts on the other end. Users can export conflicting data based on version numbers and logs, and then choose whether to put it back in the monitoring directory for sending. After the receiving end receives the data and successfully writes it to the storage, it returns the processing result to confirm that the data synchronization is complete.

[0116] The technical features of the data conflict handling method disclosed in the present invention are mainly reflected in the following:

[0117] Through user-defined policy configuration, the specified file directory is continuously monitored to detect file changes. Unlike traditional file synchronization systems, this method can dynamically manage the trigger conditions and behaviors of file synchronization based on pre-configured policies;

[0118] When file changes are detected, conflict detection will be performed first. If a conflict occurs, synchronization will not be simply stopped or the file will be overwritten. Instead, the conflict will be finely scored through a priority scoring mechanism based on user-defined policies. This priority scoring can combine multiple factors such as data importance, user permissions, timestamps, etc. to ensure priority synchronization of key data;

[0119] For conflicting content that can be merged, intelligent merging algorithms (such as the three-way merging algorithm) are used to merge and process, further ensuring data consistency and integrity. For conflicts that cannot be merged, the most important version will be selected as the final synchronization version based on priority, which has advantages in the accuracy and decision-making of data synchronization;

[0120] In the disclosed method, all unselected versions and their conflict handling information are recorded in detail in the log, including the version number of the unused version and the historical record of conflict resolution. Compared with the traditional synchronization system, this version control-based recording method greatly enhances the ability of data backtracking and ensures the transparency and auditability of the data synchronization process.

[0121] These technical features enable the method of the present disclosure to better handle complex data conflict scenarios during the file synchronization process, while ensuring data integrity and consistency and providing traceable version control records.

[0122] Figure 2 It is a schematic timing diagram of the data conflict processing method according to an embodiment of the present disclosure.

[0123] In the embodiments of the present disclosure, refer to Figure 2 , the source file server creates a listener to monitor file changes (as shown in the "Create File Listener" step in the figure), and returns a successful response after the listener is successfully created; when the file changes, conflict detection is performed. If there is a conflict, check whether the conflict can be merged. If it cannot be merged, data conflict resolution is performed according to the priority configuration of the policy configuration. After the resolution, the data is encrypted and sent to the receiving end, and the log and version information are recorded at the source end. The log and version information will be presented on the system page, and users can operate as needed. The receiving end is responsible for receiving the encrypted data, decrypting it and storing it on the receiving file server; when the data is successfully stored, the receiving end will return a successful feedback and gradually feed it back to the source file server.

[0124] like Figure 2 As shown in the figure, the source end monitors file changes through a listener, and performs a series of conflict detection, priority configuration, conflict resolution, and version control operations after changes occur; after these steps are completed, the source end packages the data, encrypts it, and sends it to the receiving end; the receiving end decrypts and stores the data on the receiving end file server, and after success, notifies the source end of the result through the feedback process.

[0125] Figure 3 It is a schematic diagram of the composition of an electronic device according to an embodiment of the present disclosure.

[0126] Second, refer to Figure 3 , an embodiment of the present disclosure provides an electronic device, comprising:

[0127] One or more processors 301;

[0128] A memory 302, on which one or more programs are stored. When the one or more programs are executed by one or more processors, the one or more processors implement the data conflict handling method described in the first aspect of the embodiment of the present disclosure;

[0129] One or more I / O interfaces 303 are connected between the processor and the memory and are configured to implement information exchange between the processor and the memory.

[0130] Among them, the processor 301 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 302 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 303 is connected between the processor 301 and the memory 302, and can realize information interaction between the processor 301 and the memory 302, including but not limited to a data bus (Bus), etc.

[0131] In some embodiments, the processor 301 , the memory 302 , and the I / O interface 303 are connected to each other via a bus 304 , and further connected to other components of the computing device.

[0132] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the data conflict handling method described in the first aspect of the embodiment of the present disclosure is implemented.

[0133] In a fourth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the data conflict handling method described in the first aspect of the embodiment of the present disclosure.

[0134] Figure 4 is a block diagram of a data conflict processing system according to an embodiment of the present disclosure.

[0135] Fifth, refer to Figure 4 , the present disclosure provides a data conflict processing system, including:

[0136] The file monitoring module 401 is configured to monitor files under the file synchronization path;

[0137] The conflict detection module 402 is configured to perform file conflict detection to determine whether there is an unmergeable conflict when monitoring the change of the file;

[0138] The priority evaluation module 403 is configured to perform a priority evaluation on the unmergeable conflicts to obtain a priority score; and prioritize the unmergeable conflicts based on the priority score and generate a priority ranking result;

[0139] The conflict resolution module 404 is configured to select a suitable version to resolve the unmergeable conflict according to the priority sorting result, and generate an integrated file;

[0140] The version control module 405 is configured to generate version numbers for unselected unmergeable conflicts, and store the unselected unmergeable conflicts and their related detailed information in a database or record them in a persistent file.

[0141] In the embodiment of the present disclosure, the data conflict processing system further includes:

[0142] A source-side policy module creates a source-side policy to determine the file synchronization path and defines a conflict configuration for handling conflicts, wherein the conflict configuration includes: a conflict detection configuration that defines conflict detection rules, including selecting a difference algorithm and setting conflict type standards; a priority configuration that sets priority evaluation factors and their weights; a conflict resolution configuration that sets processing methods for different conflict types; and a version control configuration that sets recording and management methods for unselected, non-mergeable conflicts.

[0143] In the embodiment of the present disclosure, the conflict detection module 402 includes:

[0144] A comparison module, configured to compare different versions of the file using a difference algorithm to obtain a changed portion when a change of the file is monitored;

[0145] The conflict determination module is configured to determine whether the changed portion is a mergeable conflict or an unmergeable conflict according to the conflict type standard.

[0146] In the disclosed embodiment, the difference algorithm is adaptively adjusted based on the type of the file.

[0147] In the embodiment of the present disclosure, the priority evaluation module 403 includes:

[0148] an evaluation factor determination module configured to determine priority evaluation factors and weights assigned to the priority evaluation factors based on the priority configuration;

[0149] A calculation module is configured to calculate a priority score by a weighted scoring method using the priority evaluation factors and the weights.

[0150] In the embodiment of the present disclosure, the priority evaluation factors and the weights may be dynamically adjusted according to user needs.

[0151] In the embodiment of the present disclosure, the conflict resolution module 404 includes:

[0152] A merging module, configured to generate merged content using a merging algorithm for the mergeable conflicts;

[0153] A selection module configured to select, for the unmergeable conflicts, the conflict with the highest priority according to the priority sorting result and generate selected content;

[0154] An integration module combines the merged content and the selected content to generate an integrated file;

[0155] Recording module, records conflict handling logs.

[0156] In the embodiment of the present disclosure, a version number is generated for the unselected unmergeable conflicts, and the unselected unmergeable conflicts and their related detailed information are stored in a database or recorded in a persistent file, further comprising:

[0157] An export module, which exports the unselected unmergeable conflicts based on the version number;

[0158] The renaming module renames the unselected unmergeable conflicts and places them under the file synchronization path.

[0159] In the embodiment of the present disclosure, the data conflict processing system further includes:

[0160] An encryption module, configured to encrypt the integrated file;

[0161] A transmission module configured to send the encrypted file to a destination;

[0162] A decryption module, configured to decrypt the encrypted file at the destination end;

[0163] The disk storage module is configured to store the decrypted file on the disk.

[0164] In order to enable those skilled in the art to more clearly understand the technical solution provided by the embodiment of the present disclosure, the data conflict processing method provided by the embodiment of the present disclosure is described in detail below through specific embodiments:

[0165] Embodiment 1

[0166] The data conflict handling method disclosed in the present invention can be applied to unidirectional gatekeeper built-in file synchronization and client file synchronization.

[0167] According to the data conflict handling method disclosed in the present invention, the specific implementation steps are as follows:

[0168] 1) The source file synchronization service A creates a policy to specify the monitoring directory and conflict configuration (including priority evaluation, conflict detection, etc.);

[0169] 2) The source file synchronization service A creates a listener to monitor file changes in the directory in real time;

[0170] 3) When the listener detects a file change, the file information (such as policy ID, file path, file action, last modification time when discovered, timestamp of the monitoring thread discovering the current system, file size discovered by the monitoring thread, name of the data source at the destination, etc.) is stored in the file sending pool (the file sending pool can use data structures such as ConcurrentHashMap, ConcurrentLinkedQueue or CopyOnWriteArrayList). If there is still file information under the same path and policy in the sending pool, a difference algorithm (such as Myers difference algorithm) is used to compare versions, find the changed parts and identify conflicts based on the changed parts.

[0171] 4) If a conflict is detected, the conflicting files are evaluated according to the priority evaluation module configured in the policy (e.g. based on user permissions, timestamps, data keywords, etc.), the priority score of each conflict is calculated, sorted, and the conflict data is written to the database (including editor, time, content changes, version information, etc.) for easy backtracking and auditing;

[0172] 5) According to the priority sorting, the conflict strategy is automatically executed to merge mergeable conflicts (such as text editing) using algorithms (such as the three-way merge algorithm); for non-mergeable conflicts (such as overwriting edits), the version with the highest priority is selected as the final version, and a detailed log of conflict resolution (including version number and other information) is recorded. Users can view the information of each version on the page (such as the relevant file content, date, and differences between versions) and export data for backtracking. Users can export data of a certain version by clicking on the page and resend it, thereby achieving the purpose of data backtracking.

[0173] 6) The integrated file is encrypted and sent to the receiving end, which parses it and stores it on disk.

[0174] The data conflict handling method disclosed in the present invention has a wide range of application scenarios. In addition to being used for cross-network file synchronization, it can also be applied to the following fields: local disk data backup, when backing up files on the local hard disk, ensure the consistency of files between multiple backup versions, avoid version conflicts, and select the optimal version to save; data consistency maintenance in distributed file systems, such as in distributed file systems such as HDFS or Ceph, multiple nodes may operate the same file at the same time, and this method can automatically resolve version conflicts to ensure data synchronization consistency; multi-device data synchronization, suitable for users to handle version conflicts when synchronizing personal data between multiple devices (such as mobile phones, tablets, and computers) to ensure the integrity of important data; remote office and collaborative editing scenarios, when multiple users collaborate on the same document, real-time conflict handling and priority solutions are provided to ensure smooth workflow. These scenarios together reflect the efficient applicability of the disclosed method in various complex environments that require data synchronization and conflict resolution.

[0175] This disclosure focuses on the scenario of cross-network file synchronization, and the key technical points involved are as follows:

[0176] The algorithm can intelligently analyze and merge the conflicting contents of files. By comparing different versions of files, the conflicting parts are automatically merged to ensure the integrity and consistency of the data and reduce the need for manual processing.

[0177] Allow users to customize conflict profiles and set priority evaluation factors including file attributes, user information, permissions, etc. When file content conflicts and cannot be merged intelligently, it can be determined based on priority and automatically select important content for synchronization first, ensuring that key information can be synchronized first, thus avoiding loss or overwriting of key data;

[0178] Conflicting data is managed through version control. For conflicts that are not selected and cannot be merged, a unique version number will be assigned to them and the data will be recorded through the version number. Users can backtrack and access historical data that has not been merged due to insufficient priority based on the version number, ensuring that all data modifications and conflicts can be clearly recorded and traced in a multi-user or multi-device environment, thereby ensuring the integrity and consistency of data synchronization.

[0179] The data conflict handling method disclosed in the present invention effectively solves the conflict handling, priority management and data consistency problems in the file synchronization process in a cross-network environment, and ensures the reliability and data integrity of the system in a complex environment.

[0180] The data conflict handling method disclosed in the present invention can bring the following beneficial effects:

[0181] 1) When data conflicts occur, the data can be screened according to the importance of the policy configured by the user, ensuring that key data and urgent edits are processed first, thereby improving the reliability of the data synchronization process. At the same time, the version control function ensures that data will not be lost even if conflicts occur.

[0182] 2) Version control provides a detailed history of conflicting data, which is convenient for users to backtrack and audit. This not only ensures the integrity of conflicting data, but also improves the transparency of the system, ensuring that all conflicting data is recorded and not lost.

[0183] 3) The present disclosure reduces the need for manual intervention by users through an automated conflict detection and resolution mechanism, significantly improves work efficiency, and avoids misoperation or delays caused by human intervention.

[0184] 4) The intelligent merging strategy in the present disclosure reduces the risk of data loss and ensures that different versions of data can be effectively merged, thereby ensuring the consistency and integrity of the data.

[0185] In general, any scenario that requires remote real-time monitoring and operation of terminal devices can consider using the data conflict handling method disclosed in the present invention to improve work efficiency and convenience and ensure the stability and security of the system.

[0186] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0187] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A data conflict handling method, comprising: Monitor the files under the file synchronization path; When monitoring the changes of the file, performing file conflict detection to determine whether there is an unmergeable conflict; For the unmergeable conflicts, performing a priority evaluation to obtain a priority score; Prioritize the unmergeable conflicts based on the priority scores and generate a priority ranking result; According to the priority sorting result, a suitable version is selected to resolve the unmergeable conflicts and generate an integrated file; A version number is generated for the unselected unmergeable conflicts, and the unselected unmergeable conflicts and related detailed information are stored in a database or recorded in a persistent file.

2. The data conflict handling method according to claim 1, wherein: Before monitoring the files in the file synchronization path, the following steps are also included: Creating a source policy to determine the file synchronization path and defining a conflict configuration for handling conflicts, Wherein, the conflict configuration includes: Conflict detection configuration, which defines conflict detection rules, including selecting a difference algorithm and setting conflict type criteria; Priority configuration, setting priority evaluation factors and their weights; Conflict resolution configuration, setting the processing methods for different conflict types; Version control configuration, which sets the recording and management method of unselected unmergeable conflicts.

3. The data conflict handling method according to claim 2, wherein: When the changes of the file are monitored, file conflict detection is performed to determine whether there is an unmergeable conflict, including: When a change of the file is monitored, a difference algorithm is used to compare different versions of the file to obtain a changed portion; According to the conflict type standard, it is determined whether the changed portion is a mergeable conflict or an unmergeable conflict.

4. The data conflict handling method according to claim 3, wherein: The difference algorithm is adaptively adjusted based on the type of file.

5. The data conflict handling method according to claim 4, wherein: For the unmergeable conflicts, a priority evaluation is performed to obtain a priority score, including: Based on the priority configuration, determining priority evaluation factors and weights assigned to the priority evaluation factors; A priority score is calculated by a weighted scoring method using the priority evaluation factors and the weights.

6. The data conflict handling method according to claim 5, wherein: The priority evaluation factors and the weights may be dynamically adjusted according to user needs.

7. The data conflict handling method according to claim 6, wherein: According to the priority sorting result, a suitable version is selected to resolve the unmergeable conflict, including: For the mergeable conflicts, using a merge algorithm to generate merged content; For the unmergeable conflicts, selecting the conflict with the highest priority according to the priority sorting result and generating the selected content; Combining the merged content and the selected content to generate the integrated file; Record conflict handling logs.

8. The data conflict handling method according to any one of claims 1 to 7, wherein: Generating version numbers for unselected unmergeable conflicts, and storing the unselected unmergeable conflicts and related detailed information in a database or recording them in a persistent file, further comprising: deriving the unselected unmergeable conflicts based on the version numbers; The unselected unmergeable conflicts are renamed and placed in the file synchronization path.

9. The data conflict handling method according to any one of claims 1 to 7, wherein: The data conflict handling method further includes: Encrypting the integrated file; Send the encrypted file to the destination; decrypting the encrypted file at the destination end; The decrypted file is stored on disk.

10. An electronic device comprising: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data conflict handling method according to any one of claims 1 to 9.

11. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data conflict handling method according to any one of claims 1 to 9.

12. A computer program product, comprising a computer program or an instruction, wherein when the computer program or the instruction is executed by a processor, the data conflict handling method according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Data consistency processing method, distributed system and computer storage medium

    CN120045573A

  • IO optimization method and device based on distributed storage, equipment and storage medium

    CN121411714A

  • Data synchronization conflict processing method and device, medium and program product

    CN121524264A

  • Automatic data conflict resolution method and apparatus, electronic device, and medium

    WO2026199677A1