Cross-platform seamless data synchronization method, system and electronic equipment for development of App (Application) of swan Mongolian province
By defining a unified data model and API interface in cross-platform data synchronization, using incremental synchronization algorithms and offline queue management modules, the problems of low data consistency, bandwidth consumption and reliability in the existing technology are solved, and efficient and reliable cross-platform data synchronization is achieved.
Patent Information
- Application Number
- CN202411790967.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-25
AI Technical Summary
The existing data synchronization technology has problems such as difficult to ensure data consistency during cross-platform data synchronization, high network bandwidth consumption during synchronization, low synchronization reliability in unstable network environments, and poor cross-platform compatibility.
By defining a unified data model and API interface, specific adapters are implemented for different operating system platforms, database data is updated using timestamp-based incremental synchronization algorithms, concurrent modifications are resolved conflicts, and database data is assisted by offline queues in the case of offline.
It realizes seamless data interaction between the Hongmeng system and other mainstream systems, ensures the consistency of cross-platform data, reduces network bandwidth usage, improves user experience and system performance, and improves synchronization success rate in unstable network environments.
Smart Images

Figure CN119691044A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data synchronization technology, and more specifically, to a cross-platform seamless data synchronization method, system and electronic device for Hongmeng App development. Background Art
[0002] With the popularization of smart devices and the increase in scenarios where multiple devices work together, users' demand for cross-platform data synchronization continues to grow, especially for the emerging Hongmeng OS ecosystem. Realizing seamless data interaction with other mainstream operating systems (such as Android and iOS) is particularly critical for the development of APPs under the Hongmeng OS ecosystem.
[0003] At present, the existing data synchronization technology mainly has the following problems: data consistency is difficult to ensure, network bandwidth consumption is large during the synchronization process, synchronization reliability is low in an unstable network environment, and cross-platform compatibility is poor.
[0004] Therefore, how to provide a cross-platform seamless data synchronization method for Hongmeng App development, which can realize data interaction between Hongmeng system and other mainstream systems, ensure the consistency of cross-platform data, reduce network bandwidth occupancy, and improve user experience and system performance, has become a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a cross-platform seamless data synchronization method for Hongmeng App development, which can realize data interaction between the Hongmeng system and other mainstream systems, ensure the consistency of cross-platform data, reduce network bandwidth occupancy, and improve user experience and system performance.
[0006] The technical solution provided by the present invention is as follows:
[0007] The present invention provides a cross-platform seamless data synchronization method for Hongmeng App development. Compared with the prior art, the method comprises the following steps: defining a unified data model and API interface; implementing specific adapters for OS operating system platform, Android operating system platform and Hongmeng operating system platform; updating database data according to data obtained from API interface using a timestamp-based incremental synchronization algorithm; performing conflict resolution on concurrent modifications; and if an offline situation occurs, using an offline queue to assist in updating database data; the step of using a timestamp-based incremental synchronization algorithm to update database data according to data obtained from API interface comprises the steps of: setting a last modification timestamp for the modified data record; processing the modified data using a difference comparison algorithm to obtain data that differs from the most recent synchronization; processing platform-specific data type conversion and storage method; and transmitting data that differs from the most recent synchronization.
[0008] Furthermore, in a preferred embodiment of the present invention, the steps for conflict resolution of concurrent modifications include: maintaining a version vector for each data, wherein the version vector is used to record the modification history of each device; identifying concurrent modifications by comparing version vectors; if a simple conflict is identified, attempting to automatically merge the simple conflict; if a complex conflict is identified, prompting the user to choose to keep the version.
[0009] Furthermore, in a preferred embodiment of the present invention, if an offline situation occurs, using an offline queue to assist in updating database data includes: saving local modified data in an offline queue; regularly obtaining local modified data in the offline queue from an API interface; using a timestamp-based incremental synchronization algorithm to update database data according to the local modified data obtained from the API interface; resolving conflicts for concurrent modifications; and after successful synchronization, removing the synchronized local modified data from the offline queue.
[0010] Furthermore, the unified data model is specifically JSON, XML or a binary protocol, and the unified data model is used to ensure data transmission and parsing compatibility between different platforms.
[0011] In addition, the present invention also provides a cross-platform seamless data synchronization system for Hongmeng App development, the system including: an offline queue management module, the offline queue module is used to use the offline queue to assist in updating database data if an offline situation occurs; an incremental synchronization module, the incremental synchronization module is used to obtain data from the API interface; use a timestamp-based incremental synchronization algorithm to update the database data according to the data obtained from the API interface; a conflict resolution module, the conflict resolution module is used to resolve conflicts for concurrent modifications; a distributed data storage architecture module, the distributed data storage architecture module is used to store synchronized data; a central synchronization service module, the central synchronization service module is used to distribute data to the distributed data storage architecture module; a cross-platform adaptation layer module, the cross-platform adaptation layer module is used to achieve cross-platform compatibility.
[0012] Furthermore, the distributed data storage architecture module includes a master database and several slave databases, the master database is responsible for data writing and consistency maintenance, and the slave databases are responsible for data reading and caching.
[0013] Furthermore, the cross-platform adaptation layer module includes: a unified data model and API interface; adapters specific to the OS operating system platform, Android operating system platform and Hongmeng operating system platform, and the adapters are used to handle data type conversion and storage methods specific to the OS operating system platform, Android operating system platform and Hongmeng operating system platform.
[0014] Furthermore, the conflict resolution module includes: a version vector mechanism, which is used to record the modification history of multiple devices; an automatic detection component, which is used to automatically identify concurrent modifications by comparing version vectors; an intelligent merge algorithm component, which is used to automatically merge when simple conflicts are identified; and a user-friendly interface, which is used to prompt the user to choose to retain the version when complex conflicts are identified.
[0015] Furthermore, in a preferred embodiment of the present invention, the offline queue management module uses persistent storage of the offline queue, and the locally modified data in the offline queue will not be lost after the device is restarted.
[0016] In addition, the present invention also provides an electronic device, comprising:
[0017] A computer program for executing the cross-platform seamless data synchronization method for Hongmeng App development as described above;
[0018] A memory, the memory being used to store the computer program;
[0019] A processor is used to execute the computer program.
[0020] In summary, compared with the prior art, the present invention provides a cross-platform seamless data synchronization method for Hongmeng App development, which includes the following steps: defining a unified data model and API interface; implementing specific adapters for OS operating system platform, Android operating system platform and Hongmeng operating system platform; using a timestamp-based incremental synchronization algorithm to update database data according to data obtained from the API interface; resolving conflicts for concurrent modifications; if an offline situation occurs, using an offline queue to assist in updating the database data; the step of using a timestamp-based incremental synchronization algorithm to update database data according to data obtained from the API interface includes the steps of: setting the last modification timestamp for the modified data record; using a difference comparison algorithm to process the modified data to obtain data that is different from the most recent synchronization; processing platform-specific data type conversion and storage methods; transmitting data that is different from the most recent synchronization. Among them, the cross-platform seamless data synchronization method for Hongmeng App development involved in the present invention can ensure that different platforms use the same data model to interact with data through the same interface by designing a standardized data model and constructing a unified API interface independent of the platform, and reduce the difficulty of data compatibility by standardizing the data form and transmission method; through specific adapters, the Hongmeng system and other mainstream platforms can interoperate and synchronize data under different storage models and data formats; the incremental synchronization method used when transmitting data is a method that only synchronizes changed data, reduces redundant data transmission, optimizes network bandwidth, improves synchronization speed, reduces user waiting time, and resolves conflicts for concurrent modifications, ensuring that no data loss will occur when the same data is modified on multiple platforms at the same time, thereby ensuring consistency of cross-platform data; the method involves situations in some offline scenarios where the device may not be able to perform real-time data synchronization, and uses offline queues to ensure that offline data can be successfully synchronized after the network is restored, thereby improving adaptability to the network environment.
[0021] Among them, the cross-platform seamless data synchronization system for Hongmeng App development includes the following modules: an offline queue management module, which is used to use the offline queue to assist in updating database data if an offline situation occurs; an incremental synchronization module, which is used to obtain data from the API interface; using a timestamp-based incremental synchronization algorithm to update the database data according to the data obtained from the API interface; a conflict resolution module, which is used to resolve conflicts for concurrent modifications; a distributed data storage architecture module, which is used to store synchronized data; a central synchronization service module, which is used to distribute data to the distributed data storage architecture module; a cross-platform adaptation layer module, which is used to achieve cross-platform compatibility.
[0022] Among them, the offline queue management module, the incremental synchronization module, the conflict resolution module, and the cross-platform adaptation layer module can provide technical effects consistent with the cross-platform seamless data synchronization method used for Hongmeng App development; the central synchronization service module is used to distribute data to the distributed data storage architecture module, and together with the distributed data storage architecture module constitute a special synchronization data storage and processing mechanism. Through the distributed data storage architecture module, the writing, reading and maintenance of synchronization data are distributedly processed, which improves the reading performance and reliability of the system. In addition, the present invention also provides a cross-platform seamless data synchronization electronic device for Hongmeng App development, which also has the above technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A flow chart of a cross-platform seamless data synchronization method for Hongmeng App development provided by an embodiment of the present invention;
[0025] Figure 2 A schematic diagram of the steps of updating database data according to data obtained from an API interface using a timestamp-based incremental synchronization algorithm for a cross-platform seamless data synchronization method for Hongmeng App development provided by an embodiment of the present invention;
[0026] Figure 3 A schematic diagram of the steps for resolving conflicts between concurrent modifications in a cross-platform seamless data synchronization method for Hongmeng App development provided by an embodiment of the present invention;
[0027] Figure 4 A schematic diagram of the steps of updating database data using an offline queue to assist in the cross-platform seamless data synchronization method for Hongmeng App development provided by an embodiment of the present invention;
[0028] Figure 5 A schematic diagram of a cross-platform seamless data synchronization system module for Hongmeng App development provided by an embodiment of the present invention;
[0029] Figure 6 A schematic diagram of a cross-platform adaptation layer module of a cross-platform seamless data synchronization system module for Hongmeng App development provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 the field without creative work are within the scope of protection of the present invention.
[0031] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprises a" do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0032] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" and "several" is two or more, unless otherwise clearly and specifically defined.
[0033] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with this technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantive technical significance. Any structural modification, change in proportion or adjustment of size, without affecting the effects and purposes that can be achieved by the present invention, should still fall within the scope of the technical contents disclosed by the present invention.
[0034] Please Figures 1 to 6As shown, the cross-platform seamless data synchronization method for Hongmeng App development provided by an embodiment of the present invention includes the following steps: defining a unified data model and API interface; implementing specific adapters for OS operating system platform, Android operating system platform and Hongmeng operating system platform; using a timestamp-based incremental synchronization algorithm to update database data according to data obtained from the API interface; resolving conflicts for concurrent modifications; if an offline situation occurs, using an offline queue to assist in updating database data; the step of using a timestamp-based incremental synchronization algorithm to update database data according to data obtained from the API interface includes the steps of: setting the last modification timestamp for the modified data record; using a difference comparison algorithm to process the modified data to obtain data that is different from the most recent synchronization; processing platform-specific data type conversion and storage methods; transmitting data that is different from the most recent synchronization.
[0035] Among them, designing a standardized data model and building a unified platform-independent API interface can ensure that different platforms use the same data model to interact with data through the same interface, and reduce the difficulty of data compatibility by standardizing the data format and transmission method; through specific adapters, Hongmeng system and other mainstream platforms can interoperate and synchronize data under different storage models and data formats; the incremental synchronization method used when transmitting data is a method that only synchronizes changed data, reduces redundant data transmission, optimizes network bandwidth, improves synchronization speed, and reduces user waiting time. Conflict resolution is performed for concurrent modifications to ensure that there is no data loss when the same data is modified on multiple platforms at the same time, and to ensure the consistency of cross-platform data; this method involves some offline scenarios where the device may not be able to synchronize real-time data. The offline queue is used to ensure that offline data can be successfully synchronized after the network is restored, thereby improving adaptability to the network environment.
[0036] In this way, data interaction between the Hongmeng system and other mainstream systems can be achieved, ensuring the consistency of cross-platform data, reducing network bandwidth usage, and improving user experience and system performance.
[0037] In an embodiment of the present invention, the pseudo code of the incremental synchronization algorithm is provided as follows:
[0038] python def incremental_sync(last_sync_time):
[0039] changed_data=get_changed_data(last_sync_time)
[0040] for itemin changed_data:
[0041] if item.modified_time>last_sync_time:
[0042] sync_item(item)
[0043] update_last_sync_time()
[0044] Specifically, the steps for resolving conflicts in concurrent modifications include: maintaining a version vector for each data, the version vector being used to record the modification history of each device; identifying concurrent modifications by comparing version vectors; if a simple conflict is identified, attempting to automatically merge the simple conflict; if a complex conflict is identified, prompting the user to choose to keep the version.
[0045] It should be noted that, in the embodiment of the present invention, the version vector is a data structure that records the modification history of the data item on each device, and is usually set as an array, where each element of the array corresponds to the modification count of a device.
[0046] If the version vectors are different and have no inclusion relationship, it means that the data item has been modified concurrently. If the modifications of the two devices are simple conflicts, that is, they modify different parts of the data or data structures, the system can automatically merge these conflicts. If it is text data, the conflict can be resolved by merging the text; if it is structured data, the conflict can be resolved by merging the values of the two fields.
[0047] It should be noted that when the system identifies a complex conflict, that is, two devices have modified the same data item and these modifications conflict with each other, such as modifying the same field or value, the system cannot automatically merge and must be handed over to the user to intervene to resolve the conflict. At this time, the system will display the conflicting data items and list the versions modified by each device. The user can choose which version to keep or merge the modifications manually.
[0048] Specifically, in an embodiment of the present invention, if an offline situation occurs, using an offline queue to assist in updating database data includes: saving local modified data in an offline queue; regularly obtaining local modified data in the offline queue from an API interface; using a timestamp-based incremental synchronization algorithm to update database data according to the local modified data obtained from the API; resolving conflicts for concurrent modifications; and after successful synchronization, removing the synchronized local modified data from the offline queue.
[0049] It should be noted that when the device is offline, the user can still modify the data, and the system will temporarily store the modified data in the offline queue until the device is back online. Since the background service regularly synchronizes the offline queue, data will be transferred at this time. In order to ensure the implementation of the timestamp-based incremental synchronization algorithm, whenever the device modifies local data, the system stores the modified data together with its timestamp in the offline queue. The data items are arranged in the order of modification to ensure that they are transmitted in the correct order during synchronization. After each synchronization is completed, the system will confirm which data has been successfully transmitted based on the synchronization results, and delete these data from the offline queue to ensure that only the data to be synchronized is stored in the queue.
[0050] Specifically, in the embodiment of the present invention, the unified data model is specifically JSON, XML or a binary protocol, and the unified data model is used to ensure the compatibility of data transmission and analysis between different platforms.
[0051] It should be noted that, in the embodiments of the present invention, the use of a unified data model simplifies the interface design of different platforms, so that the data exchange process is no longer limited by differences in platforms or operating systems. These formats can optimize parsing and transmission performance and reduce bandwidth usage.
[0052] In addition, an embodiment of the present invention also provides a cross-platform seamless data synchronization system for Hongmeng App development, the system including: an offline queue management module, the offline queue module is used to use the offline queue to assist in updating database data if an offline situation occurs; an incremental synchronization module, the incremental synchronization module is used to obtain data from the API interface; use a timestamp-based incremental synchronization algorithm to update the database data according to the data obtained from the API interface; a conflict resolution module, the conflict resolution module is used to resolve conflicts for concurrent modifications; a distributed data storage architecture module, the distributed data storage architecture module is used to store synchronized data; a central synchronization service module, the central synchronization service module is used to distribute data to the distributed data storage architecture module; a cross-platform adaptation layer module, the cross-platform adaptation layer module is used to achieve cross-platform compatibility.
[0053] Among them, the offline queue management module, the incremental synchronization module, the conflict resolution module, and the cross-platform adaptation layer module can provide technical effects consistent with the cross-platform seamless data synchronization method used for Hongmeng App development; the central synchronization service module is used to distribute data to the distributed data storage architecture module, and together with the distributed data storage architecture module constitute a special synchronization data storage and processing mechanism. Through the distributed data storage architecture module, the writing, reading and maintenance of synchronization data are distributedly processed, thereby improving the reading performance and reliability of the system.
[0054] Specifically, the distributed data storage architecture module includes a master database and several slave databases, the master database is responsible for data writing and consistency maintenance, and the slave databases are responsible for data reading and caching.
[0055] It should be noted that, in the embodiment of the present invention, the master database is the core component in the distributed architecture, which is responsible for all data writing operations and ensuring the consistency and persistence of the data. All data modification operations will first be written to the master database, and these operations will trigger the transaction processing mechanism to ensure the consistency and atomicity of the data; the slave database is responsible for processing data read requests and caching some commonly used data to reduce the burden on the master database and improve the read performance and scalability of the system. Moreover, since the slave database bears most of the read load, the response speed of the system can be significantly improved. When the master database fails, it can switch to the slave database to ensure the high availability of the system.
[0056] Specifically, the cross-platform adaptation layer module includes: a unified data model and API interface; adapters specific to the OS operating system platform, Android operating system platform and Hongmeng operating system platform, and the adapters are used to handle data type conversion and storage methods specific to the OS operating system platform, Android operating system platform and Hongmeng operating system platform.
[0057] Among them, the unified data model defines the standard format of data transmission on different platforms, so that different operating systems or hardware platforms can use the same method to represent and exchange data, providing a standardized framework for data transmission between different platforms; and the API interface defines how applications communicate with operating systems on different platforms, ensuring that applications on each platform can use the same interface to access services, operate data, etc. Developers can only focus on the unified API interface and data model without having to deal with differences between platforms, reducing development complexity. Specific adapters for the OS operating system platform, Android operating system platform, and Hongmeng operating system platform will automatically handle differences between platforms, simplifying cross-platform development.
[0058] Specifically, the conflict resolution module includes: a version vector mechanism, which is used to record the modification history of multiple devices; an automatic detection component, which is used to automatically identify concurrent modifications by comparing version vectors; an intelligent merge algorithm component, which is used to automatically merge when simple conflicts are identified; and a user-friendly interface, which is used to prompt the user to choose to retain the version when complex conflicts are identified.
[0059] Specifically, in the embodiment of the present invention, the offline queue management module uses persistent storage of the offline queue, and the locally modified data in the offline queue will not be lost after the device is restarted.
[0060] In addition, an embodiment of the present invention further provides an electronic device, including:
[0061] A computer program for executing the cross-platform seamless data synchronization method for Hongmeng App development as described above;
[0062] A memory, the memory being used to store the computer program;
[0063] A processor is used to execute the computer program.
[0064] To be more specific, with the popularization of smart devices and the increase in scenarios where multiple devices work together, users' demand for cross-platform data synchronization continues to grow, especially for the emerging Hongmeng OS ecosystem. Realizing seamless data interaction with other mainstream operating systems such as Android and iOS is particularly critical for the development of APPs under the Hongmeng OS ecosystem.
[0065] At present, the existing data synchronization technology mainly has the following problems: data consistency is difficult to ensure, network bandwidth consumption during the synchronization process is large, synchronization reliability is low in an unstable network environment, and cross-platform compatibility is poor. Based on this, the technical solution involved in the embodiment of the present invention makes the following comprehensive improvements.
[0066] The technical solution involved in the embodiment of the present invention reduces the compatibility difficulty of data between different platforms by designing a standardized data model and constructing a platform-independent API interface. This standardized processing enables different platforms to seamlessly interact with data, improving the consistency and accuracy of data. The implementation of specific adapters enables the Hongmeng system to interoperate and synchronize data with other mainstream platforms under different storage models and data formats. This greatly expands the application scenarios and compatibility of the Hongmeng App, and the incremental synchronization algorithm only synchronizes the changed data, reducing the redundant transmission of data, thereby optimizing the use of network bandwidth. At the same time, this algorithm also improves the synchronization speed, reduces the user's waiting time, and can achieve conflict resolution for concurrent modifications, ensuring that there will be no data loss or overwriting when the same data is modified on multiple platforms at the same time, thus ensuring the consistency and integrity of cross-platform data. In addition, the use of the offline queue management module enables the device to store the data to be synchronized even when it is offline, and synchronize after the network is restored, which improves the adaptability of the system to the network environment and ensures the real-time and integrity of the data. The distributed data storage architecture module and the central synchronization service module together constitute a special synchronization data storage and processing mechanism, which improves the system by distributing the writing, reading and maintenance of the synchronization data. Reading performance and reliability. This architecture enables the system to process a large number of data synchronization requests more efficiently, improving the overall performance of the system. In summary, the technical solutions involved in the embodiments of the present invention can realize data interaction between the Hongmeng system and other mainstream systems, ensure cross-platform data consistency, reduce network bandwidth occupancy, and improve user experience and system performance. Compared with the existing technology, it has the following technical advantages: millisecond-level data synchronization, greatly improving user experience; ensuring data consistency across devices and platforms; significantly reducing network bandwidth occupancy and data transmission volume; improving the synchronization success rate in unstable network environments; and realizing seamless data synchronization between Hongmeng OS, Android and iOS platforms.
[0067] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A cross-platform seamless data synchronization method for Hongmeng App development, characterized in that: The following steps are involved: Define a unified data model and API interface; Implement specific adapters for operating system platforms; Convert operating system platform-specific data into a unified data model and connect through API interfaces; Get data from the API interface; Use a timestamp-based incremental synchronization algorithm to update database data based on data obtained from the API interface; Perform conflict resolution for concurrent modifications; If an offline situation occurs, use the offline queue to assist in updating database data; The step "Using a timestamp-based incremental synchronization algorithm to update database data based on data obtained from an API interface" includes the following steps: Set the last modification timestamp for modification data records; Use the difference comparison algorithm to process the modified data and obtain the data that is different from the most recent synchronization; Handle platform-specific data type conversion and storage methods; Transfers data that differs from the most recent synchronization.
2. The cross-platform seamless data synchronization method for Hongmeng App development according to claim 1 is characterized in that: The step "Resolving conflicts for concurrent modifications" includes the steps: A version vector is maintained for each data, and the version vector is used to record the modification history of each device; Identify concurrent modifications by comparing version vectors; If simple conflicts are identified, try to automatically merge the simple conflicts; If a complex conflict is identified, the user is prompted to choose a version to keep.
3. The cross-platform seamless data synchronization method for Hongmeng App development according to claim 2 is characterized in that: The step "If an offline situation occurs, use the offline queue to assist in updating database data" includes: Save local modified data in the offline queue; Regularly obtain local modification data in the offline queue from the API interface; Use a timestamp-based incremental synchronization algorithm to update database data based on local modification data obtained from the API interface; Perform conflict resolution for concurrent modifications; After the synchronization is successful, the synchronized local modified data is removed from the offline queue.
4. The cross-platform seamless data synchronization method for Hongmeng App development according to claim 1 is characterized in that: The unified data model is specifically JSON, XML or a binary protocol, and the unified data model is used to achieve data transmission and parsing compatibility between different platforms.
5. A cross-platform seamless data synchronization system for Hongmeng App development, characterized in that: The system is used to execute the cross-platform seamless data synchronization method for Hongmeng App development as described in any one of claims 1 to 4, including: An offline queue management module, wherein the offline queue module is used to use the offline queue to assist in updating database data if an offline situation occurs; An incremental synchronization module, which is used to obtain data from an API interface; and update database data according to the data obtained from the API interface using an incremental synchronization algorithm based on a timestamp; A conflict resolution module, the conflict resolution module is used to resolve conflicts of concurrent modifications; A distributed data storage architecture module, wherein the distributed data storage architecture module is used to store synchronous data; A central synchronization service module, the central synchronization service module is used to distribute data to the distributed data storage architecture module; A cross-platform adaptation layer module, wherein the cross-platform adaptation layer module is used to achieve cross-platform compatibility.
6. The cross-platform seamless data synchronization system for Hongmeng App development according to claim 5 is characterized in that: The distributed data storage architecture module includes a master database and several slave databases. The master database is responsible for data writing and consistency maintenance, and the slave databases are responsible for data reading and caching.
7. The cross-platform seamless data synchronization system for Hongmeng App development according to claim 6 is characterized in that: The cross-platform adaptation layer module includes: Unified data model and API interface; Adapters specific to OS operating system platform, Android operating system platform and Hongmeng operating system platform; The adapter is used to process data type conversion and storage methods specific to the OS operating system platform, Android operating system platform and Hongmeng operating system platform.
8. The cross-platform seamless data synchronization system for Hongmeng App development according to claim 7 is characterized in that: The conflict resolution module includes: A version vector mechanism, which is used to record multi-device modification history; An automatic detection component, the automatic detection component is used to automatically identify concurrent modifications by comparing version vectors; An intelligent merging algorithm component, wherein the intelligent merging algorithm component is used to automatically merge when a simple conflict is identified; A user-friendly interface that prompts the user to choose a version to keep when complex conflicts are identified.
9. The cross-platform seamless data synchronization system for Hongmeng App development according to claim 8 is characterized in that: The offline queue management module uses persistent storage for the offline queue, and the locally modified data in the offline queue will not be lost after the device is restarted.
10. An electronic device, characterized in that: include: A computer program, the computer program being used to execute the cross-platform seamless data synchronization method for Hongmeng App development as described in any one of claims 1 to 4; A memory, the memory being used to store the computer program; A processor is used to execute the computer program.
Citation Information
Cited By
A cross-system data synchronization method, system and electronic device
CN122795984A