Client data full synchronization method

By adopting the full synchronization method of client data in iOS applications, the inconsistency, conflicts, delays and other problems in data synchronization between multiple plug-ins are solved, and the stability and consistency of data synchronization are achieved, improving the speed and real-time data updates.

CN120011103APending Publication Date: 2025-05-16HAINAN CHEZHIYITONG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510082116.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the plug-in development of iOS applications, data synchronization between multiple plug-ins has data source inconsistency, data access conflicts, data synchronization delay, communication complexity, security issues between plug-ins, and version compatibility issues, resulting in inconsistency in data sharing and exchange, affecting application behavior and user experience.

Method used

The full synchronization method of client data is adopted, including plug-in registration and identification, data unit set change notification mechanism, data unit set synchronization request and processing, and data conflict processing mechanism, to ensure the stability and consistency in the data synchronization process.

Benefits of technology

By introducing a data unit set change notification mechanism and a complete data conflict handling mechanism, the stability and consistency in the data synchronization process are ensured, data loss, duplication or inconsistency are avoided, the overall reliability of the system is enhanced, and the real-time synchronization of data between multiple plug-ins is realized, which improves the speed of data updates and the real-time data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011103A_ABST
    Figure CN120011103A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing and synchronization, and discloses a client data full synchronization method. The method comprises the following steps of: 1, registering and identifying plug-ins: registering own data unit set synchronization service in an iOS application by each plug-in; step 2, a data unit set change notification mechanism: when the data unit set of one plug-in changes, the plug-in sends a data unit set change notification to other plug-ins through the notification mechanism; and step 3, synchronous requesting and processing of the data unit set. By introducing a data unit set change notification mechanism and a perfect data conflict processing mechanism, the scheme ensures the stability and consistency in the data synchronization process, can effectively avoid the problem of data loss, repetition or inconsistency even in a high-concurrency or complex data interaction scene, enhances the overall reliability of the system, and improves the user experience. The instant synchronization of the data unit sets among a plurality of plug-ins is realized, and the data updating speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of data processing and synchronization, and specifically relates to a client data full synchronization method. Background Art

[0002] In iOS applications, the plug-in development model provides developers with the ability to quickly respond to market changes and user needs with its high flexibility and scalability. However, this model is also accompanied by a problem that cannot be ignored - the data synchronization problem between multiple plug-ins. Specifically, data source inconsistency, data access conflicts, data synchronization delays, communication complexity between plug-ins, security issues, and version compatibility issues together constitute complex challenges for data synchronization. Each plug-in may maintain its data source independently, resulting in inconsistencies in data sharing and exchange, affecting the behavior of the application and user experience. At the same time, when multiple plug-ins access or modify the same data resource at the same time, if there is a lack of appropriate concurrency control mechanism, data access conflicts will occur, threatening data integrity and application stability. In addition, during data synchronization, Asynchronous operations, such as network requests and database reading and writing, often cause synchronization delays due to network delays or performance bottlenecks, further affecting user experience. The communication mechanism between plug-ins is complex to design, involving multiple levels such as interface definition, event monitoring and callback processing, which increases the difficulty of development and maintenance. Security issues in the data synchronization process, such as unencrypted communication and improper permission allocation, may lead to data leakage or tampering by malicious plug-ins. Finally, with the iteration of applications and the update of plug-ins, the differences in data formats or synchronization protocols between plug-ins of different versions may cause version compatibility issues, requiring developers to formulate detailed migration strategies when updating. In summary, in order to overcome these challenges, developers must design and implement a set of efficient, reliable and secure data synchronization methods in the process of plug-in development to ensure the consistency of data between plug-ins. Summary of the invention

[0003] The object of the present invention is to provide a client data full synchronization method to solve the problems raised in the above background technology.

[0004] In order to achieve the above object, the present invention provides the following technical solution: a client data full synchronization method, the specific steps of the data full synchronization method include:

[0005] Step 1: Plug-in registration and identification: Each plug-in registers its own data unit set synchronization service in the iOS application;

[0006] Step 2, data unit set change notification mechanism: when the data unit set of one of the plug-ins changes, the plug-in sends a data unit set change notification to other plug-ins through the notification mechanism;

[0007] Step 3: Data unit set synchronization request and processing: other plug-ins that receive the data unit set change notification initiate a data unit set synchronization request based on the content of the notification;

[0008] Step 4: Data conflict handling: During the data unit set synchronization process, when data conflicts occur, a reasonable data conflict handling mechanism is adopted.

[0009] Preferably, the specific contents of plug-in registration and identification in step 1 include:

[0010] A1, Plug-in registration: Each plug-in registers its own data unit set synchronization service in the iOS application;

[0011] A2, Unique Identifier: Each plug-in is given a unique identifier when it is registered, which is used to identify and distinguish it during the data synchronization process.

[0012] Preferably, the specific content of the data unit set change notification mechanism in step 2 includes:

[0013] B1, Change Detection: The plugin internally monitors changes to its data unit set;

[0014] B2, Notification sending: The plug-in that has changed sends a data unit set change notification to other plug-ins through the notification mechanism provided by the system;

[0015] B3, Notification content: The notification content at least includes the identifier of the data unit set that has changed and the specific changed content.

[0016] Preferably, the specific contents of the data unit set synchronization request and processing in step 3 include:

[0017] C1, synchronization request: other plug-ins that receive the data unit set change notification determine whether the data unit set needs to be synchronized based on the notification content;

[0018] C2, request processing: After receiving the synchronization request, the plug-in that initiates the data unit set change processes the request and prepares the latest data unit set for synchronization;

[0019] C3, Data Transfer: After processing the synchronization request, the initiator transmits the latest set of data units to the requesting plug-in through the network or other means.

[0020] Preferably, the specific steps of handling data conflicts in step 4 include:

[0021] D1, conflict detection: During the synchronization of data unit sets, the system or plug-in needs to detect whether there is a data conflict;

[0022] D2, conflict handling mechanism: To ensure data consistency, a reasonable data conflict handling mechanism needs to be adopted.

[0023] Preferably, common conflict handling mechanisms in the D2 include:

[0024] E1, take the latest value: select the most recently changed data as the valid data and ignore other changes;

[0025] E2, cumulative value: If the data unit set supports the cumulative operation, multiple changes can be merged into a new change for synchronization;

[0026] E3, version control: by maintaining data version information, determine which version of the change is more effective and synchronize accordingly;

[0027] E4, conflict resolution: Resolve data conflicts according to the conflict handling mechanism to ensure that the synchronized data unit set is consistent.

[0028] Preferably, the synchronization notification process in the data unit set change notification in step 2 includes:

[0029] F1. Synchronization of data objects: In a system where data objects are updated by multiple sources or components, the updates need to be synchronized to all relevant listeners;

[0030] F2. Role of unique identifier: Each data object has a unique identifier. When the state of the data object changes, this unique identifier is used to determine which listeners need to be notified;

[0031] F3. Send message to listeners: When the state of a data object changes, the system will check whether there is a listener registered to listen to the data object; if so, the system will construct a message containing the change information and send the message to all relevant listeners; when the listener receives the message containing the data object change information, it will pass the changed data as a parameter;

[0032] F4. The business side handles its own logic: Inside the set method, the business side can write custom logic to handle the received data changes.

[0033] Preferably, the specific steps of synchronizing the request in C1 include:

[0034] G1. Bind synchronization data objects; design the structure of data objects according to application requirements to ensure that they express the application status; before data objects are bound, they need to be initialized to ensure that they contain the data required when the application starts;

[0035] G2. Bind the model or UI control through the unique identifier: bind the data object to the UI control or model;

[0036] G3. Monitor object changes through set method callback: When the data object changes, set the setter for the data object.

[0037] The beneficial effects of the present invention are as follows:

[0038] 1. The present invention introduces a data unit set change notification mechanism and a perfect data conflict handling mechanism. The scheme ensures the stability and consistency of the data synchronization process. Even in high concurrency or complex data interaction scenarios, it can effectively avoid data loss, duplication or inconsistency, thereby enhancing the overall reliability of the system.

[0039] 2. The present invention realizes the instant synchronization of data unit sets between multiple plug-ins, significantly improving the speed of data update, thereby ensuring the real-time and accuracy of data. This efficient data processing capability is crucial for iOS applications that require frequent interaction and sharing of data.

[0040] 3. The present invention is highly flexible and can support synchronization of data unit sets between multiple plug-ins, and allows customization of synchronization content according to the specific functions and requirements of the plug-ins. This flexibility not only reduces the difficulty of system integration, but also improves the scalability and maintainability of the system, providing convenience for future functional expansion and optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a data binding flow chart of the present invention;

[0042] Figure 2 It is a diagram of the notification mechanism of the present invention;

[0043] Figure 3 The present invention is implemented as a flow chart. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] like Figures 1 to 3 As shown, an embodiment of the present invention provides a method for full synchronization of client data, and the specific steps of the method for full synchronization of data include:

[0046] Step 1: Plug-in registration and identification: Each plug-in registers its own data unit set synchronization service in the iOS application;

[0047] Step 2, data unit set change notification mechanism: when the data unit set of one of the plug-ins changes, the plug-in sends a data unit set change notification to other plug-ins through the notification mechanism; the notification contains the identifier of the relevant data unit set and the change content;

[0048] Step 3: Data unit set synchronization request and processing: other plug-ins that receive the data unit set change notification initiate a data unit set synchronization request based on the content of the notification; the plug-in that initiates the data unit set synchronization processes the request and synchronizes the latest data unit set to the requesting plug-in;

[0049] Step 4: Data conflict handling: During the synchronization of data unit sets, when data conflicts occur, a reasonable data conflict handling mechanism is adopted, such as taking the latest value or accumulated value.

[0050] The specific contents of plug-in registration and identification in step 1 include:

[0051] A1, Plug-in registration: Each plug-in registers its own data unit set synchronization service in the iOS application. This step is the basis of data synchronization and ensures that each plug-in can be recognized and managed by the system;

[0052] A2, Unique identifier: Each plug-in is given a unique identifier (such as UUID) when it is registered, which is used to identify and distinguish it during the data synchronization process; this helps ensure the accuracy and pertinence of data synchronization.

[0053] The specific contents of the data unit set change notification mechanism in step 2 include:

[0054] B1, Change Detection: The plug-in internally monitors changes in its data unit set; once a change in the data unit set is detected, the change notification mechanism is triggered;

[0055] B2, Notification sending: The plug-in that has changed sends a data unit set change notification to other plug-ins through the notification mechanism provided by the system; the notification should contain sufficient information so that the recipient can identify and process the change;

[0056] B3, Notification content: The notification content includes at least the identifier of the data unit set that has changed and the specific changed content; the recipient can decide whether to initiate a synchronization request based on this information.

[0057] The specific contents of the data unit set synchronization request and processing in step 3 include:

[0058] C1, synchronization request: other plug-ins that receive the data unit set change notification determine whether the data unit set needs to be synchronized based on the notification content; if necessary, a data unit set synchronization request is initiated to the plug-in that initiated the change;

[0059] C2, request processing: After receiving the synchronization request, the plug-in that initiates the data unit set change processes the request and prepares the latest data unit set for synchronization;

[0060] C3, Data Transfer: After processing the synchronization request, the initiator transmits the latest set of data units to the requesting plug-in through the network or other means.

[0061] The specific steps of data conflict handling in step 4 include:

[0062] D1, conflict detection: During the data unit set synchronization process, the system or plug-in needs to detect whether there is a data conflict; by maintaining a version number or timestamp for each data unit set. Whenever the data is modified, the version number is incremented or the timestamp is updated. During the synchronization process, the version number or timestamp is compared to determine whether there is a newer version, and a lock is added before the data modification operation to prevent other processes or plug-ins from modifying the same data unit set at the same time;

[0063] D2, conflict handling mechanism: To ensure data consistency, a reasonable data conflict handling mechanism needs to be adopted; notify users or administrators to manually resolve conflicts. This may involve comparing two or more versions of data and selecting the most appropriate version to retain; if the conflict can be resolved automatically (for example, merging changes in text files), the system can try to automatically merge these changes; determine which modification should be retained based on certain rules (such as timestamps, user permissions, etc.).

[0064] Among them, common conflict handling mechanisms in D2 include:

[0065] E1, take the latest value: select the most recently changed data as the valid data and ignore other changes;

[0066] E2, cumulative value: If the data unit set supports the cumulative operation, multiple changes can be merged into a new change for synchronization;

[0067] E3, version control: by maintaining data version information, determine which version of the change is more effective and synchronize accordingly;

[0068] E4, conflict resolution: Resolve data conflicts according to the conflict handling mechanism to ensure that the synchronized data unit set is consistent.

[0069] The synchronization notification process in the data unit set change notification in step 2 includes:

[0070] F1. Synchronization of data objects: In a system, data objects are updated by multiple sources or components, and the updates need to be synchronized to all relevant listeners; the synchronization process may involve obtaining the latest data from a database, network request, user input, or other data source, and updating it to the internal state of the data object;

[0071] F2. Role of unique identifier: Each data object has a unique identifier (such as ID, UUID, etc.). When the state of the data object changes, this unique identifier is used to determine which listeners need to be notified; reduce unnecessary notifications and improve system efficiency and response speed;

[0072] F3. Send messages to listeners: When the state of a data object changes, the system will check whether there is a listener registered to listen to the data object (through its unique identifier); if so, the system will construct a message containing the change information (such as the changed data value, timestamp, etc.), and send the message to all relevant listeners through some mechanism (such as event bus, callback function list, etc.); when the listener receives the message containing the data object change information, it passes the changed data as a parameter;

[0073] F4. The business side handles its own logic: Inside the set method, the business side can write custom logic to handle the received data changes; including updating the UI, triggering further data processing, recording logs, sending notifications to other system components, etc. The specific implementation of the business side logic depends on the application requirements and context.

[0074] Among them, the specific steps of the synchronization request in C1 include:

[0075] G1. Bind and synchronize data objects; design the structure of data objects according to application requirements to ensure that they express the application status; before data objects are bound, they need to be initialized to ensure that they contain the data required when the application starts; consider data persistence strategies, such as using local storage (Local Storage, IndexedDB, etc.) or remote servers, so that data status can be restored when needed;

[0076] G2. Bind models or UI controls through unique identifiers: bind data objects to UI controls (such as text boxes, buttons, etc.) and models (in MVC / MVVM and other architectures); ensure that data can be correctly mapped to corresponding UI elements or model attributes; two-way binding: in many modern front-end frameworks, two-way data binding is supported, that is, changes to UI controls will automatically update data objects, and changes to data objects will also be automatically reflected in UI controls; using template engines (such as Handlebars, Mustache, etc.) can easily generate UI structures based on data objects to separate data from views; using modern front-end frameworks such as Vue.js, React, and Angul ar, data binding can be implemented more efficiently and conveniently. These frameworks provide rich APIs and tools to support complex data binding scenarios;

[0077] G3. Listen to object changes through set method callback: When the data object changes, set the setter for the data object. The setter method can contain callback logic to perform specific operations (such as updating the UI) when the data changes; Observer pattern: The idea of ​​the observer pattern is often hidden behind the data binding mechanism, that is, the data object is the observed, and the UI control or model is the observer; when the observed (data object) changes, all registered observers (UI controls or models) are notified to update; in some modern front-end frameworks, such as Vue.js, the dependency tracking system is used to automatically detect data changes and trigger corresponding update operations without manually writing setter methods or callback logic; when implementing data binding, you need to pay attention to performance issues; for example, avoid unnecessary update operations, use virtual DOM and other technologies to optimize rendering performance, etc.

[0078] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0079] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for full synchronization of client data, characterized in that: The specific steps of the data full synchronization method include: Step 1: Plug-in registration and identification: Each plug-in registers its own data unit set synchronization service in the iOS application; Step 2, data unit set change notification mechanism: when the data unit set of one of the plug-ins changes, the plug-in sends a data unit set change notification to other plug-ins through the notification mechanism; Step 3: Data unit set synchronization request and processing: other plug-ins that receive the data unit set change notification initiate a data unit set synchronization request based on the content of the notification; Step 4: Data conflict handling: During the data unit set synchronization process, when data conflicts occur, a reasonable data conflict handling mechanism is adopted.

2. A client data full synchronization method according to claim 1, characterized in that: The specific contents of the plug-in registration and identification in step 1 include: A1, Plug-in registration: Each plug-in registers its own data unit set synchronization service in the iOS application; A2, Unique Identifier: Each plug-in is given a unique identifier when it is registered, which is used to identify and distinguish it during the data synchronization process.

3. A method for full synchronization of client data according to claim 1, characterized in that: The specific contents of the data unit set change notification mechanism in step 2 include: B1, Change Detection: The plugin internally monitors changes to its data unit set; B2, Notification sending: The plug-in that has changed sends a data unit set change notification to other plug-ins through the notification mechanism provided by the system; B3, Notification content: The notification content at least includes the identifier of the data unit set that has changed and the specific changed content.

4. A client data full synchronization method according to claim 1, characterized in that: The specific contents of the data unit set synchronization request and processing in step 3 include: C1, synchronization request: other plug-ins that receive the data unit set change notification determine whether the data unit set needs to be synchronized based on the notification content; C2, request processing: After receiving the synchronization request, the plug-in that initiates the data unit set change processes the request and prepares the latest data unit set for synchronization; C3, Data Transfer: After processing the synchronization request, the initiator transmits the latest set of data units to the requesting plug-in through the network or other means.

5. A client data full synchronization method according to claim 1, characterized in that: The specific steps of data conflict processing in step 4 include: D1, conflict detection: During the synchronization of data unit sets, the system or plug-in needs to detect whether there is a data conflict; D2, conflict handling mechanism: To ensure data consistency, a reasonable data conflict handling mechanism needs to be adopted.

6. A method for full synchronization of client data according to claim 5, characterized in that: Common conflict handling mechanisms in D2 include: E1, take the latest value: select the most recently changed data as the valid data and ignore other changes; E2, cumulative value: If the data unit set supports the cumulative operation, multiple changes are merged into a new change for synchronization; E3, version control: by maintaining data version information, determine which version of the change is more effective and synchronize accordingly; E4, conflict resolution: Resolve data conflicts according to the conflict handling mechanism to ensure that the synchronized data unit set is consistent.

7. A method for full synchronization of client data according to claim 1, characterized in that: The synchronization notification process in the data unit set change notification in step 2 includes: F1. Synchronization of data objects: In a system where data objects are updated by multiple sources or components, the updates need to be synchronized to all relevant listeners; F2. Role of unique identifier: Each data object has a unique identifier. When the state of the data object changes, this unique identifier is used to determine which listeners need to be notified; F3. Send message to listeners: When the state of a data object changes, the system will check whether there is a listener registered to listen to the data object; if so, the system will construct a message containing the change information and send the message to all relevant listeners; when the listener receives the message containing the data object change information, it will pass in the changed data as a parameter; F4. The business side handles its own logic: Inside the set method, the business side writes custom logic to handle the received data changes.

8. A method for full synchronization of client data according to claim 4, characterized in that: The specific steps of the synchronization request in C1 include: G1. Bind synchronization data objects; design the structure of data objects according to application requirements to ensure that they express the application status; before data objects are bound, they need to be initialized to ensure that they contain the data required when the application starts; G2. Bind the model or UI control through the unique identifier: bind the data object to the UI control or model; G3. Monitor object changes through set method callback: When the data object changes, set the setter for the data object.