Synchronization methods, devices, electronic equipment and media

By synchronizing the first and second data objects in the data warehouse, the problem of multi-page data synchronization in the MVVM framework is solved, and real-time data updates on different devices are achieved.

CN113971195BActive Publication Date: 2025-12-02DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010716142.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-23
Publication Date
2025-12-02
Estimated Expiration
2041-05-30

AI Technical Summary

Technical Problem

In the MVVM framework, multiple pages cannot synchronize data simultaneously, which means that if a user changes data on one terminal device, other devices need to refresh the data before it can be updated.

Method used

By detecting changes in data objects in the first data source of the data warehouse, the data objects in the second data source of the data warehouse are updated to maintain the consistency between the first and second data objects, and the interface is synchronized with the updates.

Benefits of technology

It enables synchronized updates of data across different pages, ensuring that changes to user data on any device are immediately reflected in the display interface of all devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971195B_ABST
    Figure CN113971195B_ABST
Patent Text Reader

Abstract

This disclosure discloses embodiments of a data synchronization method, apparatus, electronic device, and medium. One specific implementation of the method includes: in response to detecting a change in a first data object in a first data source of a data warehouse, updating a second data object in a second data source of the data warehouse according to the change in the first data object, so that the second data object is consistent with the first data object; in response to the change in the second data object, updating a first interface data object based on the second data object and presenting the updated first interface data object in a first display interface corresponding to the first interface data object; wherein the first data object and the second data object are copies of the same data object in different data sources. This implementation achieves synchronized updates of data on different pages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this disclosure relate to the field of computer technology, and more specifically to methods, apparatuses, electronic devices, and media for synchronizing data. Background Technology

[0002] The MVVM (Model-View-ViewModel) framework is a low-level framework for developing Android applications. It consists of three layers: Model (data), View (presentation), and ViewModel. Communication between the ViewModel and View no longer relies on interfaces. A current problem with this approach is its inability to achieve data synchronization across multiple pages simultaneously. For example, in some communication applications, if user A changes their avatar, only the avatar on the device where user A changed their avatar is updated; other devices need to refresh their data to update user A's avatar. Summary of the Invention

[0003] The summary section of this invention provides a brief overview of the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.

[0004] The purpose of some embodiments of this disclosure is to provide a data synchronization method, apparatus, electronic device, and medium to solve the technical problems mentioned in the background section above.

[0005] In a first aspect, some embodiments of this disclosure provide a data synchronization method, the method comprising: in response to detecting a change in a first data object in a first data source of a data warehouse, updating a second data object in a second data source of the data warehouse according to the change in the first data object, so that the second data object is consistent with the first data object; in response to the change in the second data object, updating a first interface data object based on the second data object and presenting the updated first interface data object in a first display interface corresponding to the first interface data object; wherein the first data object and the second data object are copies of the same data object in different data sources.

[0006] Secondly, some embodiments of this disclosure provide a data synchronization apparatus, comprising: an update unit configured to, in response to detecting a change in a first data object in a first data source of a data warehouse, update a second data object in a second data source of the data warehouse according to the change in the first data object, so that the second data object is consistent with the first data object; and a presentation unit configured to, in response to a change in the second data object, update a first interface data object based on the second data object and present the updated first interface data object in a first display interface corresponding to the first interface data object; wherein the first data object and the second data object are copies of the same data object in different data sources.

[0007] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, which, when executed by one or more processors, cause the one or more processors to implement any of the methods in the first aspect.

[0008] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements any of the methods in the first aspect.

[0009] One embodiment of the above-described embodiments of this disclosure has the following beneficial effects: by determining that the first data object has changed, the second data object is updated to ensure that the second data object remains consistent with the first data object. Then, by determining that the second data object has changed, the first interface data object based on the second data object is updated, and the updated first interface data object is presented in the first display interface corresponding to the first interface data object. This achieves synchronous updating of data across different pages. Attached Figure Description

[0010] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.

[0011] Figure 1 This is a schematic diagram illustrating an application scenario of a data synchronization method according to some embodiments of the present disclosure;

[0012] Figure 2 This is a flowchart of some embodiments of the data synchronization method according to this disclosure;

[0013] Figure 3 These are flowcharts of other embodiments of the data synchronization method according to this disclosure;

[0014] Figure 4 This is a schematic diagram of the structure of some embodiments of the synchronization data apparatus according to the present disclosure;

[0015] Figure 5 This is a schematic diagram of the structure of some embodiments of the synchronization data apparatus according to the present disclosure;

[0016] Figure 6 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation

[0017] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0018] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.

[0019] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0020] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0021] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0022] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0023] Figure 1 This is a schematic diagram illustrating an application scenario of a data synchronization method according to some embodiments of the present disclosure;

[0024] In such Figure 1As shown in the application scenario, firstly, in response to detecting a change in the first data object 1011 in the first data source 103 of the data warehouse 102, the terminal device 101 updates the second data object 1012 in the second data source 104 of the data warehouse 102 according to the change in the first data object 1011, so that the second data object 1012 is consistent with the first data object 1011. Then, in response to the change in the second data object 1012, the first interface data object 1013 based on the second data object 1012 is updated, and the updated first interface data object 1014 is presented in the first display interface 105 corresponding to the first interface data object 1013. Here, the first data object 1011 and the second data object 1012 are copies of the same data object in different data sources.

[0025] It is understood that the data synchronization method can be executed by the terminal device 101, the server, or various software programs. The terminal device 101 can be, for example, various electronic devices with a display screen, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. Furthermore, the executing entity can also be a server, software, etc. When the executing entity is software, it can be installed in the aforementioned electronic devices. It can be implemented as multiple software programs or software modules for providing distributed services, or as a single software program or software module. No specific limitations are made here.

[0026] It should be understood that Figure 1 The number of mobile phones shown is merely illustrative. Depending on implementation needs, any number of mobile phones can be used.

[0027] Continue to refer to Figure 2 The diagram illustrates a flow 200 of some embodiments of a data synchronization method according to the present disclosure. This data synchronization method includes the following steps:

[0028] Step 201: In response to detecting a change in the first data object in the first data source of the data warehouse, the second data object in the second data source of the data warehouse is updated according to the change in the first data object, so that the second data object is consistent with the first data object.

[0029] In some embodiments, the execution subject of the data synchronization method (e.g., Figure 1The terminal device 101 shown can update the second data object in the second data source of the data warehouse according to the change of the first data object when it is determined that a change has been detected in the first data source of the data warehouse, so that the second data object is consistent with the first data object. The data warehouse can be obtained by encapsulating local data sources and remote data sources. The data warehouse has a corresponding data access interface. The data access interface can be used to connect the data warehouse and the terminal device. For example, data in the data warehouse can be accessed on the terminal device through the data access interface. As an example, when the avatar in user a's personal information changes from image A to image B, the avatar in user a's personal information in the second data source is updated to image B.

[0030] In some optional implementations of certain embodiments, the first data source is a remote data source, and the second data source is a local data source; or, the first data source is a local data source, and the second data source is a remote data source. The local data source includes local sub-data sources and in-memory data sources. The local sub-data source can be locally stored data. The in-memory data source can be data stored in memory. The remote data source can be data stored on a network. As an example, a synchronization relationship can be established between the local sub-data sources, the in-memory data source, and the remote data source in the data warehouse. When establishing the synchronization relationship, since the interfaces of each data source may be different, it is necessary to agree on the interface according to a unified key-value pair protocol, so that when any data source is updated, the other data sources will automatically synchronize.

[0031] In some optional implementations of certain embodiments, in response to the first data object being a set of key-value pairs, the second data object is updated in the second data source of the data warehouse according to the changes in the first data object, based on the key corresponding to the first data object. For example, if a user changes the username corresponding to ID "010031" to "Zhang San" in their personal information on a terminal device, the username with ID "010031" in the second data source of the data warehouse is updated to "Zhang San".

[0032] In some optional implementations of certain embodiments, condition information corresponding to the first data object is determined; based on the condition information, the second data object is updated in the second data source of the data warehouse according to the changes of the first data object. As an example, the condition information of the first data object may refer to the first two digits of the student ID in the student table being "01", and the first data object may be "Class 1". In this case, the class of the student whose first two digits of the student ID in the student table are "01" is updated to "Class 1".

[0033] Step 202: In response to the change of the second data object, the first interface data object based on the second data object is updated and the updated first interface data object is presented in the first display interface corresponding to the first interface data object.

[0034] In some embodiments, when the execution entity determines that the second data object has changed, it updates the first interface data object based on the second data object and presents the updated first interface data object in the first display interface corresponding to the first interface data object. Here, the first data object and the second data object are copies of the same data object in different data sources. The first display interface can be a page used to display the first interface data object. For example, taking the above example, when the profile picture of user a in the second data source is updated from image A to image B, the first interface data object can be the second data object displayed on the terminal device. The first interface data object is updated to image B, and image B is presented in the first display interface corresponding to the first interface data object.

[0035] In some optional implementations of certain embodiments, a target remote data source is generated; the target remote data source may be a location created by the executing entity for storing data. In response to detecting a data request for the target remote data source, the target update data corresponding to the data request is stored in the target remote data source and a target local data source associated with the target remote data source. The data request may refer to a request to update the target update data in the target remote data source. The target local data source associated with the target remote data source may be a location on the terminal device receiving the data request for local data storage. As an example, the data stored in the target remote data source may be a question and its corresponding answer, where the answer may be words, web pages, or text, etc. The user enters the question "How to care for flowers and plants?" in the first display interface. The corresponding answers could be: "'Water cutting: Cutting the stems in water can prevent air from blocking water absorption and prolong the life of cut flowers'; 'Enlarge the cut surface: When cutting flower branches, try to make the cut surface at the end of the flower stem larger to increase the water absorption capacity of the flower or flower branch'; 'Soaking in water: After cutting, the inflorescence and leaves of the flowers may wilt due to long-distance transportation, high temperature, and long dehydration time'." The above questions and corresponding answers are stored in the target remote data source and the above questions and corresponding answers are stored in the target local data source associated with the target remote data source.

[0036] The data synchronization method disclosed in some embodiments of this disclosure updates a second data object after determining that a first data object has changed, ensuring that the second data object remains consistent with the first data object. Then, after determining that the second data object has changed, a first interface data object based on the second data object is updated, and the updated first interface data object is displayed on the first display interface corresponding to the first interface data object. This achieves synchronized updates of data across different pages.

[0037] Continue to refer to Figure 3 The diagram illustrates a flow 300 of some embodiments of a data synchronization method according to the present disclosure. This data synchronization method includes the following steps:

[0038] Step 301: In response to detecting a change in the first data object in the first data source of the data warehouse, the second data object in the second data source of the data warehouse is updated according to the change in the first data object, so that the second data object is consistent with the first data object.

[0039] Step 302: In response to the change of the second data object, the first interface data object based on the second data object is updated and the updated first interface data object is presented in the first display interface corresponding to the first interface data object.

[0040] In some embodiments, the specific implementation of steps 301-302 and the resulting technical effects can be found in [reference needed]. Figure 2 Steps 201-202 in the corresponding embodiments will not be repeated here.

[0041] Step 303: In response to detecting a data update operation in the second display interface, determine the first data object corresponding to the data update operation in the second interface data object corresponding to the second display interface.

[0042] In some embodiments, the execution subject of the data synchronization method (e.g., Figure 1The terminal device 101 shown can determine that a data update operation is detected in the second display interface, and determine the first data object corresponding to the data update operation in the second interface data object corresponding to the second display interface. The data update operation can be an operation such as adding or modifying data on the second display interface. As an example, in the MVVM framework, the second display interface belongs to the View (presentation) layer, the second interface data object can belong to the ViewModel layer, and the first data object can belong to the Model (data) layer. When the user performs a data update operation in the View layer, obtains the first data object corresponding to the data update operation, and updates the second interface data object, so that the second interface data object matches the obtained first data object corresponding to the data update operation.

[0043] Step 304: Update the first data object in the first data source of the data warehouse according to the above data update operation so that the first data object changes.

[0044] In some embodiments, the aforementioned execution entity may update the aforementioned first data object in the first data source of the aforementioned data warehouse according to the aforementioned data update operation, so that the aforementioned first data object changes. As an example, in the second display interface of the View layer, the user changes the username corresponding to the ID "010031" from "Zhang San" to "An An", and changes the username corresponding to the ID "010031" in the first data source of the aforementioned data warehouse to "An An".

[0045] As an example, firstly, the user modifies data on the view layer's display page. The modified data is then transformed into a modified data object (ViewModel) within the MVVM framework. Then, as... Figure 4 As shown, the modified data object 401 is stored in the data warehouse through the data access interface 402 (Repository). Data interface 402 provides a data access interface to the View layer, and internally accesses remote / local data sources through Fetcher / Cache. The data warehouse is mainly divided into remote data source 403 (Fetcher) and local data source 404 (Cache). The local data source can be further divided into disk 405 and memory 406, while the remote data source can be web service 407. The remote data source provides an interface for requesting remote data, while the local data source provides an interface for accessing local data. disk 405, memory 406, and web service 407 can all represent data sources that can request data and continuously observe data changes.

[0046] As an example, JDT (Jack-of-Data) tools can be used to visualize data flow. JDT can be a tool for monitoring data flow, changes, and performance (duration). For instance, if a user adds data on a page, the added data A will be stored in all data sources in the data warehouse through data access interfaces. These processes are usually invisible to the naked eye, but tools allow us to see the data flow and changes within the system. This visualization of data flow allows us to more intuitively see various issues occurring during data changes, thereby improving work efficiency.

[0047] from Figure 3 It can be seen from this that, with Figure 2 Compared to the description of some corresponding embodiments, Figure 3 In some corresponding embodiments, the flow 300 of the information display method reflects that, in response to detecting a data update operation in the second display interface, the first data object corresponding to the data update operation is determined in the second interface data object corresponding to the second display interface, and the first data object is updated in the first data source of the data warehouse. Therefore, the solutions described in these embodiments can be introduced to update the same data on different pages, and all data updates can be performed in the same data warehouse.

[0048] Further reference Figure 5 As an implementation of the methods described in the above figures, this disclosure provides some embodiments of a synchronization data device, which are similar to... Figure 2 Corresponding to the above-described method embodiments, the device can be specifically applied to various electronic devices.

[0049] like Figure 5 As shown, the synchronization data apparatus 500 in some embodiments includes an update unit 501 and a presentation unit 502. The update unit 501 is configured to, in response to detecting a change in a first data object in a first data source of the data warehouse, update a second data object in a second data source of the data warehouse according to the change in the first data object, so that the second data object is consistent with the first data object. The presentation unit 502 is configured to, in response to a change in the second data object, update a first interface data object based on the second data object and present the updated first interface data object in a first display interface corresponding to the first interface data object; wherein the first data object and the second data object are copies of the same data object in different data sources.

[0050] In some embodiments, the synchronization data device 500 is further configured to: in response to detecting a data update operation in a second display interface, determine the first data object corresponding to the data update operation in a second interface data object corresponding to the second display interface; and update the first data object in a first data source of the data warehouse according to the data update operation, so that the first data object changes.

[0051] In some embodiments, the first data source is a remote data source and the second data source is a local data source; or, the first data source is a local data source and the second data source is a remote data source.

[0052] In some embodiments, the synchronization data device 500 is further configured to: in response to the first data object being a set of key-value pairs, update the second data object in the second data source of the data warehouse according to the changes of the first data object based on the key corresponding to the first data object.

[0053] In some embodiments, the synchronization data device 500 is further configured to: determine condition information corresponding to the first data object; and update the second data object in the second data source of the data warehouse according to the changes of the first data object based on the condition information.

[0054] In some embodiments, the synchronization data device 500 is further configured to: generate a target remote data source; and in response to detecting a data request for the target remote data source, store the target update data corresponding to the data request in the target remote data source and the target local data source associated with the target remote data source.

[0055] It is understandable that the units described in the device 500 are related to the reference. Figure 2 The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method also apply to the device 500 and the units contained therein, and will not be repeated here.

[0056] The following is for reference. Figure 6 It illustrates electronic devices suitable for implementing some embodiments of this disclosure (e.g., Figure 1 The diagram shows the structure of the server (600) in this disclosure. Terminal devices in some embodiments of this disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6The terminal device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.

[0057] like Figure 6 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0058] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 6 Each box shown can represent a device or multiple devices as needed.

[0059] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined above in the methods of some embodiments of this disclosure.

[0060] It should be noted that, in some embodiments of this disclosure, the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0061] In some implementations, clients and servers may communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and may interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0062] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: in response to detecting a change in a first data object in a first data source of the data warehouse, update a second data object in a second data source of the data warehouse according to the change in the first data object, so that the second data object is consistent with the first data object; in response to a change in the second data object, update a first interface data object based on the second data object and present the updated first interface data object in a first display interface corresponding to the first interface data object; wherein the first data object and the second data object are copies of the same data object in different data sources.

[0063] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0064] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0065] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an update unit and a presentation unit. The names of these units do not necessarily limit the unit itself; for example, an update unit may also be described as "a unit that, in response to detecting a change in a first data object in a first data source of a data warehouse, updates a second data object in a second data source of the data warehouse according to the change in the first data object, so that the second data object remains consistent with the first data object."

[0066] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0067] According to one or more embodiments of this disclosure, a data synchronization method is provided, comprising: in response to detecting a change in a first data object in a first data source of a data warehouse, updating a second data object in a second data source of the data warehouse according to the change in the first data object, so that the second data object is consistent with the first data object; in response to the change in the second data object, updating a first interface data object based on the second data object and presenting the updated first interface data object in a first display interface corresponding to the first interface data object; wherein the first data object and the second data object are copies of the same data object in different data sources.

[0068] According to one or more embodiments of this disclosure, the method further includes: in response to detecting a data update operation in a second display interface, determining the first data object corresponding to the data update operation in a second interface data object corresponding to the second display interface; and updating the first data object in a first data source of the data warehouse according to the data update operation, so that the first data object changes.

[0069] According to one or more embodiments of this disclosure, the first data source is a remote data source and the second data source is a local data source; or, the first data source is a local data source and the second data source is a remote data source.

[0070] According to one or more embodiments of this disclosure, in response to the first data object being a set of key-value pairs, the second data object is updated in the second data source of the data warehouse according to the changes in the first data object based on the key corresponding to the first data object.

[0071] According to one or more embodiments of this disclosure, condition information corresponding to the first data object is determined; based on the condition information, the second data object is updated in the second data source of the data warehouse according to the changes of the first data object.

[0072] According to one or more embodiments of this disclosure, the method further includes: generating a target remote data source; and in response to detecting a data request for the target remote data source, storing target update data corresponding to the data request in the target remote data source and a target local data source associated with the target remote data source.

[0073] According to one or more embodiments of this disclosure, a data synchronization apparatus is provided, comprising: an update unit configured to, in response to detecting a change in a first data object in a first data source of a data warehouse, update a second data object in a second data source of the data warehouse according to the change in the first data object, so that the second data object is consistent with the first data object; and a presentation unit configured to, in response to a change in the second data object, update a first interface data object based on the second data object and present the updated first interface data object in a first display interface corresponding to the first interface data object; wherein the first data object and the second data object are copies of the same data object in different data sources.

[0074] According to one or more embodiments of this disclosure, the apparatus is further configured to: in response to detecting a data update operation in a second display interface, determine the first data object corresponding to the data update operation in a second interface data object corresponding to the second display interface; and update the first data object in a first data source of the data warehouse according to the data update operation, so that the first data object changes.

[0075] According to one or more embodiments of this disclosure, the first data source is a remote data source and the second data source is a local data source; or, the first data source is a local data source and the second data source is a remote data source.

[0076] According to one or more embodiments of this disclosure, in response to the first data object being a set of key-value pairs, the second data object is updated in the second data source of the data warehouse according to the changes in the first data object based on the key corresponding to the first data object.

[0077] According to one or more embodiments of this disclosure, condition information corresponding to the first data object is determined; based on the condition information, the second data object is updated in the second data source of the data warehouse according to the changes of the first data object.

[0078] According to one or more embodiments of this disclosure, the apparatus is further configured to: generate a target remote data source; and in response to detecting a data request for the target remote data source, store the target update data corresponding to the data request in the target remote data source and a target local data source associated with the target remote data source.

[0079] According to one or more embodiments of the present disclosure, an electronic device is provided, including: one or more processors; and a storage device 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 methods described in any of the foregoing embodiments.

[0080] According to one or more embodiments of the present disclosure, a computer-readable medium is provided having a computer program stored thereon, wherein the program, when executed by a processor, implements the method as described in any of the foregoing embodiments.

[0081] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A method for synchronizing data, comprising: In response to detecting a change in a first data object in a first data source of the data warehouse, the second data object in the second data source of the data warehouse is updated according to the change in the first data object so that the second data object is consistent with the first data object; The first data object is updated according to the data update operation detected in the second display interface, so that it changes; In response to a change in the second data object, the first interface data object based on the second data object is updated and the updated first interface data object is presented on the first display interface corresponding to the first interface data object. The first display interface is a page used to display the first interface data object. The first data object and the second data object are copies of the same data object in different data sources.

2. The method according to claim 1, characterized in that, Also includes: In response to detecting a data update operation in the second display interface, the first data object corresponding to the data update operation is determined in the second interface data object corresponding to the second display interface; The first data object is updated in the first data source of the data warehouse according to the data update operation, so that the first data object changes.

3. The method according to claim 1, characterized in that, The first data source is a remote data source, and the second data source is a local data source; or, The first data source is a local data source, and the second data source is a remote data source.

4. The method according to claim 1, characterized in that, The step of updating the second data object in the second data source of the data warehouse according to the changes of the first data object includes: In response to the first data object being a set of key-value pairs, the second data object is updated in the second data source of the data warehouse according to the changes in the first data object, based on the key corresponding to the first data object.

5. The method according to claim 1, characterized in that, The step of updating the second data object in the second data source of the data warehouse according to the changes of the first data object includes: Determine the condition information corresponding to the first data object; Based on the aforementioned condition information, the second data object is updated in the second data source of the data warehouse according to the changes in the first data object.

6. The method according to any one of claims 1-5, characterized in that, Also includes: Generate the target remote data source; In response to detecting a data request for the target remote data source, the target update data corresponding to the data request is stored in the target remote data source and the target local data source associated with the target remote data source.

7. A data synchronization device, comprising: The update unit is configured to update a second data object in a second data source of the data warehouse according to the change of the first data object in response to detecting a change in the first data object in a first data source of the data warehouse, so that the second data object is consistent with the first data object; The first data object is updated according to the data update operation detected in the second display interface, so that it changes; The presentation unit is configured to update the first interface data object based on the second data object in response to a change in the second data object, and present the updated first interface data object in the first display interface corresponding to the first interface data object. The first display interface is a page used to display the first interface data object. The first data object and the second data object are copies of the same data object in different data sources.

8. An electronic device, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

9. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and system enabling multiple persons to cooperatively process fault tree

    CN105553704A

  • Social account friend head portrait updating method and apparatus

    CN106789552A