WO2022017458A1 - 同步数据方法、装置、电子设备和介质 - Google Patents
同步数据方法、装置、电子设备和介质 Download PDFInfo
- Publication number
- WO2022017458A1 WO2022017458A1 PCT/CN2021/107844 CN2021107844W WO2022017458A1 WO 2022017458 A1 WO2022017458 A1 WO 2022017458A1 CN 2021107844 W CN2021107844 W CN 2021107844W WO 2022017458 A1 WO2022017458 A1 WO 2022017458A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- data object
- source
- interface
- data source
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/283—Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP
Definitions
- Embodiments of the present disclosure relate to the field of computer technology, and in particular, to methods, apparatuses, electronic devices, and media for synchronizing data.
- the MVVM (Model-View-ViewModel) framework is the underlying framework for developing Android-side rendering.
- the MVVM framework has three layers: Model (data)-View (display)-ViewModel. Communication between ViewModel and View no longer relies on interfaces.
- the current problem with this method is that data synchronization cannot be achieved on multiple pages at the same time. For example, in some communication applications, user a changes the user avatar, only the user avatar on the terminal device where user a's avatar is changed is changed, and other devices need to refresh data to update the user a's avatar.
- the purpose of some embodiments of the present disclosure is to provide a method, apparatus, electronic device and medium for synchronizing data, so as to solve the technical problems mentioned in the above background art section.
- some embodiments of the present disclosure provide a method for synchronizing data, 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 the above-mentioned data warehouse
- the source updates the second data object according to the change of the first data object, so that the second data object is consistent with the first data object;
- the first interface data object of the object is updated and the updated first interface data object is presented in the first display interface corresponding to the first interface data object; wherein, the first data object and the second data object are A copy of the same data object in a different data source.
- some embodiments of the present disclosure provide an apparatus for synchronizing data, the apparatus comprising: an updating unit configured to, in response to detecting a change in a first data object in a first data source of a data warehouse, update the data in the above-mentioned data In the second data source of the warehouse, the second data object is updated according to the change of the above-mentioned first data object, so that the above-mentioned second data object is consistent with the above-mentioned first data object; the presentation unit is configured to respond to the above-mentioned 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; wherein, the above The first data object and the above-mentioned second data object are copies of the same data object in different data sources.
- some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, when one or more programs are stored by one or more The processors execute such that the one or more processors implement a method as in any of the first aspects.
- some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of the first aspects.
- One of the foregoing embodiments of the present disclosure has the following beneficial effects: by determining that the first data object has changed, the second data object is updated, so that the second data object is consistent with the first data object. Then, it is determined 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 on the first display interface corresponding to the first interface data object middle. Synchronous update of data on different pages is achieved.
- FIG. 1 is a schematic diagram of an application scenario of a method for synchronizing data according to some embodiments of the present disclosure
- FIG. 2 is a flowchart of some embodiments of a method of synchronizing data according to the present disclosure
- FIG. 3 is a flowchart of other embodiments of a method of synchronizing data according to the present disclosure
- FIG. 4 is a schematic diagram of an embodiment in which data objects are stored in a data warehouse through a data access interface in the method for synchronizing data according to the present disclosure
- FIG. 5 is a schematic structural diagram of some embodiments of a data synchronization apparatus according to the present disclosure.
- FIG. 6 is a schematic structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure.
- FIG. 1 is a schematic diagram of an application scenario of a method for synchronizing data according to some embodiments of the present disclosure
- the terminal device 101 may, in response to detecting a change in the first data object 1011 in the first data source 103 of the data warehouse 102 , store the second data in the above-mentioned data warehouse 102
- the source 104 updates the second data object 1012 according to the change of the first data object 1011, so that the second data object 1012 is consistent with the first data object 1011.
- 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 interface data object 1013 in the corresponding first display interface 105 .
- the first data object 1011 and the second data object 1012 are copies of the same data object in different data sources.
- the method for synchronizing data may be executed by the terminal device 101, or may also be executed by a server, or may also be executed by various software programs.
- the terminal device 101 may be, for example, various electronic devices having a display screen, including but not limited to smart phones, tablet computers, e-book readers, laptop computers, desktop computers, and the like.
- the execution body may also be embodied as a server, software, or the like. When the execution body is software, it can be installed in the electronic devices listed above. It can be implemented, for example, as multiple software or software modules for providing distributed services, or as a single software or software module. There is no specific limitation here.
- FIG. 1 the number of cell phones in FIG. 1 is merely illustrative. There can be any number of handsets depending on implementation needs.
- the method for synchronizing data includes the following steps:
- Step 201 in response to detecting the change of the first data object in the first data source of the data warehouse, update the second data object in the second data source of the above-mentioned data warehouse according to the change of the above-mentioned first data object, to The above-mentioned second data object is made consistent with the above-mentioned first data object.
- the execution body of the method for synchronizing data may, when it is determined that a change in the first data object is detected in the first data source of the data warehouse, in the above-mentioned data warehouse In the second data source, the second data object is updated according to the change of the first data object, so that the second data object is consistent with the first data object.
- the above data warehouse may be obtained by encapsulating a local data source and a remote data source.
- the above data warehouse has a corresponding data access interface.
- the above data access interface can be used to connect the data warehouse and the terminal device.
- the data in the data warehouse can be called on the terminal device through the above-mentioned data access interface.
- the avatar in the personal information of user a changes from picture A to picture B
- the avatar in the personal information of user a in the second data source is updated to picture B.
- the first data source is a remote data source
- the second data source is a local data source
- the first data source is a local data source
- the second data source is for the remote data source.
- the above-mentioned local data sources include local sub-data sources and memory data sources.
- the above-mentioned local sub-data source may be locally stored data.
- the above-mentioned memory data source may be data stored in memory.
- the above-mentioned remote data sources may store data on the network.
- a synchronization relationship can be established for a local sub-data source, an in-memory data source, and a remote data source in a data warehouse.
- the user in response to the above-mentioned first data object being a set of key-value pairs, based on the key corresponding to the above-mentioned first data object, in the second data source of the above-mentioned data warehouse, according to the above-mentioned first data object Changes to one data object update the second data object.
- the user changes the user name corresponding to the ID "010031" to "Zhang San" in the personal information on the terminal device, and updates the user name with the ID "010031" in the second data source of the above data warehouse to "Zhang San".
- condition information corresponding to the first data object is determined; based on the condition information, in the second data source of the data warehouse, the second data object is changed according to the change of the first data object.
- the data object is updated.
- the condition information of the above-mentioned first data object may mean that the first two digits of the ID of the student in the student table are "01”, and the above-mentioned first data object may be "Class 1", then the student in the student table The class of the student whose first two digits of ID are "01" is updated to "Class 1".
- Step 202 in response to the change of the second data object, update the first interface data object based on the second data object and present the updated first interface data object in the first interface data object corresponding to the first interface data object.
- a display interface in response to the change of the second data object, update the first interface data object based on the second data object and present the updated first interface data object in the first interface data object corresponding to the first interface data object.
- the execution body may update the first interface data object based on the second data object when it is determined that the second data object has changed, and present the updated first interface data object on the above-mentioned in the first display interface corresponding to 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.
- the above-mentioned first display interface may be a page for displaying the first interface data object.
- the first interface data object may be the second data displayed on the terminal device object, update the above-mentioned first interface data object to picture B, and present the picture B in the first display interface corresponding to the above-mentioned first interface data object.
- a target remote data source is generated; the above-mentioned target remote data source may be a place created by an execution body to store data.
- 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.
- the above data request may refer to a data update request for the target update data in the above target remote data source.
- the target local data source associated with the above-mentioned target remote data source may be a place for locally storing data of the terminal device receiving the above-mentioned data request.
- the data stored in the target remote data source may be questions and corresponding answers, and the answers may be words, web pages, or texts.
- the user enters the question in the above-mentioned first display interface as "how to maintain flowers and plants?", and the corresponding answer can be "'cutting in water, cutting branches in water can avoid air blocking moisture absorption and prolong the life of fresh cut flowers.
- the cutting section of the stems and branches of the flowers should be as large as possible when cutting the flower branches, in order to increase the water absorption function of the flowers or flower branches', 'After soaking in water and cutting flowers, due to long-distance transportation and temperature Due to reasons such as high temperature and long dehydration time, the inflorescence and leaves of flowers will wilt.”, store the above questions and the corresponding answers in the target remote data source, and save the above questions and the above corresponding answers in In the target local data source associated with the above target remote data source.
- the data synchronization methods disclosed in some embodiments of the present disclosure update the second data object by determining that the first data object has changed, so that the second data object is consistent with the first data object. Then, it is determined 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 on the first display interface corresponding to the first interface data object middle. Synchronous update of data on different pages is achieved.
- the method for synchronizing data includes the following steps:
- Step 301 in response to detecting a change in the first data object in the first data source of the data warehouse, update the second data object in the second data source of the data warehouse according to the change of the first data object, to The above-mentioned second data object is made consistent with the above-mentioned first data object.
- Step 302 in response to the change of the second data object, update the first interface data object based on the second data object and present the updated first interface data object in the first interface data object corresponding to the first interface data object. a display interface.
- steps 301-302 for the specific implementation of steps 301-302 and the technical effects brought about, reference may be made to steps 201-202 in those embodiments corresponding to FIG. 2, and details are not repeated here.
- Step 303 In response to detecting the 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.
- the execution body of the method for synchronizing data may determine that a data update operation is detected in the second display interface, and the second interface data corresponding to the above-mentioned second display interface
- the above-mentioned first data object corresponding to the above-mentioned data update operation is determined in the object.
- the above-mentioned data update operation may be operations such as data addition, data modification, etc. performed on the above-mentioned second display interface.
- the above-mentioned second display interface belongs to the View (display) layer
- the above-mentioned second interface data object may belong to the ViewModel layer
- the above-mentioned first data object may belong to the Model (data) layer.
- the user performs a data update operation on the View layer, obtains the above-mentioned first data object corresponding to the above-mentioned data update operation, and updates the above-mentioned second interface data object, so that the above-mentioned second interface data object corresponds to the obtained above-mentioned data update operation.
- the first data object is a data update operation on the View layer
- updates the above-mentioned second interface data object so that the above-mentioned second interface data object corresponds to the obtained above-mentioned data update operation.
- Step 304 Update the first data object in the first data source of the data warehouse according to the data update operation, so that the first data object changes.
- the execution body may update the first data object in the first data source of the data warehouse according to the data update operation, so that the first data object changes.
- the user changes the user name corresponding to the ID "010031” from “Zhang San” to "An An” in the second display interface of the View layer, and changes the ID in the first data source of the above data warehouse to "010031" The corresponding user name is changed to "An An”.
- the user modifies data on the display page of the View layer, and the modified data is converted into a modified data object (ViewModel) in the MVVM framework.
- the modified data object 401 is stored in the data warehouse through the data access interface 402 (Repository).
- the data interface 402 can provide a data access interface to the View layer, and can internally access remote/local data sources through Fetcher/Cache.
- the data warehouse is mainly divided into a remote data source 403 (Fetcher) and a local data source 404 (Cache).
- the local data source can also be divided into disk405 and memory406, and the remote data source can be webservice407.
- the remote data source provides an interface for requesting remote data.
- a local data source provides an interface for accessing local data.
- disk405, memory406 and webservice407 can all be represented as data sources that can request data and continuously observe data changes.
- data flow visualization can be implemented using JDT.
- JDT may be a tool for monitoring data flow, changes, performance (duration), and the like. For example, if the user adds data on the page, the added data A will be stored in all data sources in the data warehouse through the data access interface. These are usually invisible to our naked eyes. Through tools, we can see the data flow and data changes within the system. This enables visualization of data flow, allowing us to more intuitively see various problems that occur during data changes, thereby improving work efficiency.
- the process 300 of the information display method in some embodiments corresponding to FIG. 3 embodies the response to the detection of data update in the second display interface operation, determining the first data object corresponding to the data update operation in the second interface data object corresponding to the second display interface, and updating the first data object 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 data can be updated in the same data warehouse.
- the present disclosure provides some embodiments of a device for synchronizing data. These device embodiments correspond to those method embodiments described above in FIG. 2 , and the device can be applied to in various electronic devices.
- an apparatus 500 for synchronizing data in some embodiments includes: an updating unit 501 and a presenting unit 502 .
- the updating unit 501 is configured to, in response to detecting a change in the first data object in the first data source of the data warehouse, update the second data object in the second data source of the data warehouse according to the change of the first data object.
- the data object is updated so that the second data object is consistent with the first data object;
- the presentation unit 502 is configured to, in response to the change of the second data object, update the first interface data based on the second data object.
- the object is updated and the updated first interface data object is presented in the first display interface corresponding to the first interface data object; wherein, the first data object and the second data object are the same data object in different data objects. copy in source.
- the data synchronization apparatus 500 is further configured to: in response to detecting the data update operation in the second display interface, determine the data update operation corresponding to the above-mentioned second interface data object in the second interface data object corresponding to the above-mentioned second display interface
- the above-mentioned first data object in the first data source of the above-mentioned data warehouse, the above-mentioned first data object is updated according to the above-mentioned data update operation, so that the above-mentioned first data object is changed.
- the first data source is a remote data source
- the second data source is a local data source
- the first data source is a local data source
- the second data source is a remote data source
- the data synchronization apparatus 500 is further configured to: in response to the above-mentioned first data object being a set of key-value pairs, based on the key corresponding to the above-mentioned first data object, in the second data source of the above-mentioned data warehouse according to The above-mentioned change of the first data object updates the second data object.
- the data synchronization apparatus 500 is further configured to: determine condition information corresponding to the first data object; The second data object is updated.
- the data synchronization apparatus 500 is further configured to: generate a target remote data source; in response to detecting a data request for the target remote data source, store the target update data corresponding to the data request to the target remote In the target local data source associated with the data source and the above target remote data source.
- the units recorded in the apparatus 500 correspond to the respective steps in the method described with reference to FIG. 2 . Therefore, the operations, features and beneficial effects described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and details are not described herein again.
- FIG. 6 it shows a schematic structural diagram of an electronic device (eg, the server in FIG. 1 ) 600 suitable for implementing some embodiments of the present disclosure.
- Terminal devices in some embodiments of the present disclosure may include, but are not limited to, such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals Mobile terminals such as in-vehicle navigation terminals, etc., and stationary terminals such as digital TVs, desktop computers, and the like.
- the terminal device shown in FIG. 6 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
- an electronic device 600 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 601 that may be loaded into random access according to a program stored in a read only memory (ROM) 602 or from a storage device 608 Various appropriate actions and processes are executed by the programs in the memory (RAM) 603 . In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored.
- the processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
- An input/output (I/O) interface 605 is also connected to bus 604 .
- the following devices can be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration an output device 607 such as a computer; a storage device 608 including, for example, a memory card; and a communication device 609 .
- Communication means 609 may allow electronic device 600 to communicate wirelessly or by wire with other devices to exchange data. While FIG. 6 shows electronic device 600 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in FIG. 6 may represent one device, or may represent multiple devices as required.
- the processes described above with reference to the flowcharts may be implemented as computer software programs.
- some embodiments of the present 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 method illustrated in the flowchart.
- the computer program may be downloaded and installed from the network via the communication device 609, or from the storage device 608, or from the ROM 602.
- the processing device 601 When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of some embodiments of the present disclosure are performed.
- the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the foregoing two.
- the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above.
- a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
- 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 therein.
- Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
- Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
- the client and server can use any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects.
- HTTP HyperText Transfer Protocol
- Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or future development network of.
- the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
- the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, causes the electronic device: in response to detecting the occurrence of the first data object in the first data source of the data warehouse change, the second data object is updated in the second data source of the above-mentioned data warehouse according to the change of the above-mentioned first data object, so that the above-mentioned second data object is consistent with the above-mentioned first data object; in response to the above-mentioned second data object When the object changes, update the first interface data object based on the second data object and present the updated first interface data object in the first display interface corresponding to the first interface data object; A data object and the above-mentioned second data object are copies of the same data object in different data sources.
- Computer program code for carrying out operations of some embodiments of the present disclosure may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, or a combination thereof, Also included are conventional procedural programming languages - such as the "C" language or similar programming languages.
- the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
- the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider to via Internet connection).
- LAN local area network
- WAN wide area network
- each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
- the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
- the units described in some embodiments of the present disclosure may be implemented by means of software, and may also be implemented by means of hardware.
- the described unit may also be provided in the processor, for example, it may be described as: a processor includes an update unit and a presentation unit.
- the names of these units do not constitute a limitation of the unit itself in some cases, for example, the update unit can also be described as "in response to detecting that the first data object in the first data source of the data warehouse changes , a unit for updating the second data object in the second data source of the above-mentioned data warehouse according to the change of the above-mentioned first data object, so that the above-mentioned second data object is consistent with the above-mentioned first data object".
- exemplary types of hardware logic components include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.
- FPGAs Field Programmable Gate Arrays
- ASICs Application Specific Integrated Circuits
- ASSPs Application Specific Standard Products
- SOCs Systems on Chips
- CPLDs Complex Programmable Logical Devices
- a method for synchronizing data comprising: in response to detecting a change in a first data object in a first data source of a data warehouse, in a second data source of the above-mentioned data warehouse The second data object is updated according to the change of the above-mentioned first data object, so that the above-mentioned second data object is consistent with the above-mentioned first data object; update the first interface data object and present the updated first interface data object in the first display interface corresponding to the first interface data object; wherein, the first data object and the second data object are the same A copy of a data object in a different data source.
- the method further includes: in response to detecting the data update operation in the second display interface, determining in the second interface data object corresponding to the second display interface the corresponding data update operation The above-mentioned first data object; the above-mentioned first data object is updated according to the above-mentioned data update operation in the first data source of the above-mentioned data warehouse, so that the above-mentioned first data object is changed.
- the first data source is a remote data source
- the second data source is a local data source
- the first data source is a local data source
- the second data source is a remote data source data source
- the above-mentioned first data object being a set of key-value pairs, based on the key corresponding to the above-mentioned first data object, in the second data source of the above-mentioned data warehouse, according to the above-mentioned first data Changes to the object update the second data object.
- condition information corresponding to the first data object is determined; based on the condition information, the second data object is processed in the second data source of the data warehouse according to the change of the first data object. to update.
- the method further includes: generating a target remote data source; in response to detecting a data request for the target remote data source, storing target update data corresponding to the data request to the target In the target local data source associated with the remote data source and the above target remote data source.
- an apparatus for synchronizing data comprising: an updating unit configured to, in response to detecting a change in a first data object in a first data source of a data warehouse, update the data in the above-mentioned data In the second data source of the warehouse, the second data object is updated according to the change of the above-mentioned first data object, so that the above-mentioned second data object is consistent with the above-mentioned first data object; the presentation unit is configured to respond to the above-mentioned 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; wherein, the above The first data object and the above-mentioned second data object are copies of the same data object in different data sources.
- the apparatus is further configured to: in response to detecting a data update operation in the second display interface, determine the data update in the second interface data object corresponding to the second display interface The corresponding first data object is operated; 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 is changed.
- the first data source is a remote data source
- the second data source is a local data source
- the first data source is a local data source
- the second data source is a remote data source data source
- the above-mentioned first data object being a set of key-value pairs, based on the key corresponding to the above-mentioned first data object, in the second data source of the above-mentioned data warehouse, according to the above-mentioned first data Changes to the object update the second data object.
- condition information corresponding to the first data object is determined; based on the condition information, the second data object is processed in the second data source of the data warehouse according to the change of the first data object. to update.
- the apparatus is further configured to: generate a target remote data source; in response to detecting a data request for the target remote data source, store the target update data corresponding to the data request in a The above target remote data source and the target local data source associated with the above target remote data source.
- 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 stored by one or more
- the execution of the processor causes one or more processors to implement a method as described in any of the above embodiments.
- a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the foregoing embodiments.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本公开的实施例公开了同步数据方法、装置、电子设备和介质。该方法的一具体实施方式包括:响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在该数据仓库的第二数据源中按照该第一数据对象的变化对第二数据对象进行更新,以使得该第二数据对象与该第一数据对象保持一致;响应于该第二数据对象发生变化,对基于该第二数据对象的第一界面数据对象进行更新并将更新后的该第一界面数据对象呈现在该第一界面数据对象对应的第一显示界面中;其中,该第一数据对象和该第二数据对象为同一数据对象在不同数据源中的副本。该实施方式实现了不同页面数据的同步更新。
Description
相关申请的交叉引用
本申请要求于2020年07月23日提交的,申请号为202010716142.3、发明名称为“同步数据方法、装置、电子设备和介质”的中国专利申请的优先权,该申请的全文通过引用结合在本申请中。
本公开的实施例涉及计算机技术领域,具体涉及同步数据方法、装置、电子设备和介质。
MVVM(Model-View-ViewModel)框架为用于开发Android端呈现的底层框架,MVVM框架一共有三层分别是:Model(数据)-View(展示)-ViewModel。ViewModel和View之间的通信不再依赖接口。这种方法目前存在的问题是无法在多个页面同时实现数据同步。例如,在一些通信应用中,用户a更改用户头像,只有用户a的更改头像的终端设备上的用户头像被更改,其它设备需要刷新数据才能更新用户a的头像。
发明内容
本发明内容部分用于以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。本发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
本公开的一些实施例的目的在于提出一种同步数据方法、装置、电子设备和介质,来解决以上背景技术部分提到的技术问题。
第一方面,本公开的一些实施例提供了一种同步数据方法,该方法包括:响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致;响应于上述第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中;其中,上述第一数据对象和上述第二数据对象为同一数据对象在不同数据源中的副本。
第二方面,本公开的一些实施例提供了一种同步数据装置,装置包括:更新单元,被配置成响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致;呈现单元,被配置成响应于上述第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中;其中,上述第一数据对象和上述第二数据对象为同一数据对象在不同数据源中的副本。
第三方面,本公开的一些实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一的方法。
第四方面,本公开的一些实施例提供了一种计算机可读介质,其上存储有计算机程序,其中,程序被处理器执行时实现如第一方面中任一的方法。
本公开的上述各个实施例中的一个实施例具有如下有益效果:通过确定第一数据对象发生变化,对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致。然后,确定第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中。实现了不同页面数据的同步更新。
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,元件和元素不一定按照比例绘制。
图1是根据本公开的一些实施例的同步数据方法的一个应用场景的示意图;
图2是根据本公开的同步数据方法的一些实施例的流程图;
图3是根据本公开的同步数据方法的另一些实施例的流程图;
图4是根据本公开的同步数据方法中数据对象通过数据访问接口存储到数据仓库的一个实施例的示意图;
图5是根据本公开的同步数据装置的一些实施例的结构示意图;
图6是适于用来实现本公开的一些实施例的电子设备的结构示意图。
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例。相反,提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而 非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
下面将参考附图并结合实施例来详细说明本公开。
图1是根据本公开的一些实施例的同步数据方法的一个应用场景的示意图;
在如图1的应用场景中所示,首先,终端设备101可以在响应于在数据仓库102的第一数据源103中检测到第一数据对象1011发生变化,在上述数据仓库102的第二数据源104中按照上述第一数据对象1011的变化对第二数据对象1012进行更新,以使得第二数据对象1012与第一数据对象1011保持一致。然后,响应于第二数据对象1012发生变化,对基于上述第二数据对象1012的第一界面数据对象1013进行更新并将更新后的上述第一界面数据对象1014呈现在上述第一界面数据对象1013对应的第一显示界面105中。其中,上述第一数据对象1011和上述第二数据对象1012为同一数据对象在不同数据源中的副本。
可以理解的是,同步数据方法可以是由终端设备101来执行,或者也可以是由服务器来执行,或者还可以是各种软件程序来执行。其中,终端设备101例如可以是具有显示屏的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。此外,执行主体也可以体现为服务器、软件等。当执行主体为软件时,可以安装在上述所列举的电子设备中。其可以实现成例如用来提供分布式服务的多个软件或软件模块,也可以实现成单个软件或软件模块。在此不做具体限定。
应该理解,图1中的手机的数目仅仅是示意性的。根据实现需要,可以具有任意数目的手机。
继续参考图2,示出了根据本公开的同步数据方法的一些实施例的流程200。该同步数据方法,包括以下步骤:
步骤201,响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致。
在一些实施例中,同步数据方法的执行主体(例如,图1所示的终端设备101)可以在确定在数据仓库的第一数据源中检测到第一数据对象发生变化时,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致。上述数据仓库可以是对本地数据源和远程数据源进行封装得到的。上述数据仓库存在对应的数据访问接口。上述数据访问接口可以是用来连接数据仓库和终端设备的。例如,可以在终端设备上通过上述数据访问接口调用数据仓库中的数据。作为示例,当用户a的个人信息中的头像由图片A变为图片B,将第二数据源中用户a的个人信息中的头像更新成图片B。
在一些实施例的一些可选的实现方式中,上述第一数据源为远程数据源,上述第二数据源为本地数据源;或,上述第一数据源为本地数据源,上述第二数据源为远程数据源。其中,上述本地数据源包括本地子数据源和内存数据源。上述本地子数据源可以是本地存储的数据。上述内存数据源可以是内存中存储的数据。上述远程数据源可以网络上存储的数据。作为示例,可以为数据仓库中的本地子数据源、内存数据源和远程数据源建立同步关系。在建立同步关系时,由于各个数据源的接口可能不同,所以需要按照统一的键值对的协议约定接口,这样在任意数据源被更新时,其他数据源都会自动同步。
在一些实施例的一些可选的实现方式中,响应于上述第一数据对象是一组键值对,基于上述第一数据对象对应的键,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新。作为示例,用户在终端设备上的个人信息中,将ID“010031”对应的用户名改为“张三”,在上述数据仓库的第二数据源中将ID为“010031”的用户名更新为“张三”。
在一些实施例的一些可选的实现方式中,确定上述第一数据对象对 应的条件信息;基于上述条件信息,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新。作为示例,上述第一数据对象的条件信息可以是指学生表中的学生的ID的前两位为“01”,上述第一数据对象可以是“一班”,那么就是将学生表中的学生的ID的前两位为“01”的学生的班级更新为“一班”。
步骤202,响应于上述第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中。
在一些实施例中,上述执行主体可以在确定上述第二数据对象发生变化时,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中。其中,上述第一数据对象和上述第二数据对象为同一数据对象在不同数据源中的副本。上述第一显示界面可以是用于展示第一界面数据对象的页面。作为示例,以上述例子为例,当上述第二数据源中用户a的个人信息中的头像由图片A更新成图片B时,上述第一界面数据对象可以是在终端设备上展示的第二数据对象,将上述第一界面数据对象更新成图片B,并将图片B呈现在上述第一界面数据对象对应的第一显示界面中。
在一些实施例的一些可选的实现方式中,生成目标远程数据源;上述目标远程数据源可以是执行主体创建的用于存储数据的地方。响应于检测到针对上述目标远程数据源的数据请求,将上述数据请求对应的目标更新数据,存储到上述目标远程数据源和上述目标远程数据源关联的目标本地数据源中。上述数据请求可以是指对上述目标远程数据源中目标更新数据的数据更新的请求。上述上述目标远程数据源关联的目标本地数据源可以是接收上述数据请求的终端设备的用于本地存储数据的地方。作为示例,上述目标远程数据源中存储的数据可以是问题与对应的答案,上述答案可以是词语、网页或文本等。用户在上述第一显示界面中输入问题为“花草的养护方法?”,对应的答案可以是“‘水中剪切,将枝条放在水中剪切,可以避免空气阻断水分吸收,延长鲜切花寿命’,‘扩大切面,花枝剪切时应尽量使鲜花的茎枝末端剪切的剖面大一些,目的 在于增加鲜花或花枝的吸水功能’,‘水中浸泡,鲜花剪切后,由于长途运输和气温较高及脱水时间较长等原因,使鲜花的花序及叶片出现萎蔫现象’”,将上述问题与上述对应的答案存入上述目标远程数据源中,并将上述问题与上述对应的答案存入与上述目标远程数据源关联的目标本地数据源中。
本公开的一些实施例公开的同步数据方法,通过确定第一数据对象发生变化,对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致。然后,确定第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中。实现了不同页面数据的同步更新。
继续参考图3,示出了根据本公开的同步数据方法的一些实施例的流程300。该同步数据方法,包括以下步骤:
步骤301,响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致。
步骤302,响应于上述第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中。
在一些实施例中,步骤301-302的具体实现及所带来的技术效果可以参考图2对应的那些实施例中的步骤201-202,在此不再赘述。
步骤303,响应于在第二显示界面中检测到数据更新操作,在上述第二显示界面对应的第二界面数据对象中确定上述数据更新操作对应的上述第一数据对象。
在一些实施例中,同步数据方法的执行主体(例如,图1所示的终端设备101)可以确定在第二显示界面中检测到数据更新操作,在上述第二显示界面对应的第二界面数据对象中确定上述数据更新操作对应的上述第一数据对象。上述数据更新操作可以是在上述第二显示界面上 进行的数据添加、数据修改等操作。作为示例,在MVVM框架中,上述第二显示界面属于View(展示)层,上述第二界面数据对象可以属于ViewModel层,上述第一数据对象可以属于Model(数据)层。用户在View层进行数据更新操作,获取上述数据更新操作对应的上述第一数据对象,对上述第二界面数据对象进行更新,使得上述第二界面数据对象与获取到的上述数据更新操作对应的上述第一数据对象。
步骤304,在上述数据仓库的第一数据源中按照上述数据更新操作对上述第一数据对象进行更新,以使得上述第一数据对象发生变化。
在一些实施例中,上述执行主体可以在上述数据仓库的第一数据源中按照上述数据更新操作对上述第一数据对象进行更新,以使得上述第一数据对象发生变化。作为示例,用户在View层的第二显示界面中将ID为“010031”对应的用户名由“张三”修改为“安安”,将上述数据仓库的第一数据源中的ID为“010031”对应的用户名修改为“安安”。
作为示例,首先,用户在View层的显示页面上对数据进行修改,修改后数据在在MVVM框架中会转化成修改后数据对象(ViewModel)。然后,如图4所示,将修改后数据对象401通过数据访问接口402(Repository)存储到数据仓库中。数据接口402可以向View层提供数据访问接口,内部可以通过Fetcher/Cache访问远程/本地的数据源。数据仓库中主要分为远程数据源403(Fetcher)和本地数据源404(Cache)。其中,本地数据源还可以分为disk405和memory406,远程数据源可以是webservice407。其中,远程数据源提供对远程数据请求的接口。本地数据源提供对本地数据存取的接口。disk405、memory406和webservice407均可以表示为可以请求数据、并可持续观察数据变化的数据源。
作为示例,可以利用JDT实现数据流向可视化。上述JDT可以是用于监听数据流向,变动,性能(时长)等的工具。例如,用户在页面上进行了数据添加操作,那么添加的数据A会通过数据访问接口,分别存储到数据仓库中的所有数据源中。这些通常是我们肉眼无法看到的,通过工具我们可以看到数据在系统内部的数据流向和数据变动等。这可以实现数据流向的可视化,让我们更加直观的看到数据变动 过程中发生的各种问题,从而提高工作效率。
从图3中可以看出,与图2对应的一些实施例的描述相比,图3对应的一些实施例中的信息显示方法的流程300体现了响应于在第二显示界面中检测到数据更新操作,在上述第二显示界面对应的第二界面数据对象中确定上述数据更新操作对应的上述第一数据对象,并在上述数据仓库的第一数据源中对上述第一数据对象进行更新。由此,这些实施例描述的方案可以引入在不同页面对同一数据进行更新,都可以在同一个数据仓库中进行数据更新。
进一步参考图5,作为对上述各图上述方法的实现,本公开提供了一种同步数据装置的一些实施例,这些装置实施例与图2上述的那些方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图5所示,一些实施例的同步数据装置500包括:更新单元501和呈现单元502。其中,更新单元501,被配置成响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致;呈现单元502,被配置成响应于上述第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中;其中,上述第一数据对象和上述第二数据对象为同一数据对象在不同数据源中的副本。
在一些实施例中,同步数据装置500被进一步配置成:响应于在第二显示界面中检测到数据更新操作,在上述第二显示界面对应的第二界面数据对象中确定上述数据更新操作对应的上述第一数据对象;在上述数据仓库的第一数据源中按照上述数据更新操作对上述第一数据对象进行更新,以使得上述第一数据对象发生变化。
在一些实施例中,上述第一数据源为远程数据源,上述第二数据源为本地数据源;或,上述第一数据源为本地数据源,上述第二数据源为远程数据源。
在一些实施例中,同步数据装置500被进一步配置成:响应于上述 第一数据对象是一组键值对,基于上述第一数据对象对应的键,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新。
在一些实施例中,同步数据装置500被进一步配置成:确定上述第一数据对象对应的条件信息;基于上述条件信息,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新。
在一些实施例中,同步数据装置500被进一步配置成:生成目标远程数据源;响应于检测到针对上述目标远程数据源的数据请求,将上述数据请求对应的目标更新数据,存储到上述目标远程数据源和上述目标远程数据源关联的目标本地数据源中。
可以理解的是,该装置500中记载的诸单元与参考图2描述的方法中的各个步骤相对应。由此,上文针对方法描述的操作、特征以及产生的有益效果同样适用于装置500及其中包含的单元,在此不再赘述。
下面参考图6,其示出了适于用来实现本公开的一些实施例的电子设备(例如图1中的服务器)600的结构示意图。本公开的一些实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图6示出的终端设备仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。
如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如存储卡等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图6中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。
特别地,根据本公开的一些实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的一些实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的一些实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开的一些实施例的方法中限定的上述功能。
需要说明的是,本公开的一些实施例上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的一些实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的一些实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序 代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致;响应于上述第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中;其中,上述第一数据对象和上述第二数据对象为同一数据对象在不同数据源中的副本。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的一些实施例的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一 个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开的一些实施例中的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括更新单元和呈现单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,更新单元还可以被描述为“响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
根据本公开的一个或多个实施例,提供了一种同步数据方法,包 括:响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致;响应于上述第二数据对象发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中;其中,上述第一数据对象和上述第二数据对象为同一数据对象在不同数据源中的副本。
根据本公开的一个或多个实施例,该方法还包括:响应于在第二显示界面中检测到数据更新操作,在上述第二显示界面对应的第二界面数据对象中确定上述数据更新操作对应的上述第一数据对象;在上述数据仓库的第一数据源中按照上述数据更新操作对上述第一数据对象进行更新,以使得上述第一数据对象发生变化。
根据本公开的一个或多个实施例,上述第一数据源为远程数据源,上述第二数据源为本地数据源;或,上述第一数据源为本地数据源,上述第二数据源为远程数据源。
根据本公开的一个或多个实施例,响应于上述第一数据对象是一组键值对,基于上述第一数据对象对应的键,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新。
根据本公开的一个或多个实施例,确定上述第一数据对象对应的条件信息;基于上述条件信息,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新。
根据本公开的一个或多个实施例,该方法还包括:生成目标远程数据源;响应于检测到针对上述目标远程数据源的数据请求,将上述数据请求对应的目标更新数据,存储到上述目标远程数据源和上述目标远程数据源关联的目标本地数据源中。
根据本公开的一个或多个实施例,提供了一种同步数据装置,包括:更新单元,被配置成响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新,以使得上述第二数据对象与上述第一数据对象保持一致;呈现单元,被配置成响应于上述第二数据对象 发生变化,对基于上述第二数据对象的第一界面数据对象进行更新并将更新后的上述第一界面数据对象呈现在上述第一界面数据对象对应的第一显示界面中;其中,上述第一数据对象和上述第二数据对象为同一数据对象在不同数据源中的副本。
根据本公开的一个或多个实施例,该装置被进一步配置成:响应于在第二显示界面中检测到数据更新操作,在上述第二显示界面对应的第二界面数据对象中确定上述数据更新操作对应的上述第一数据对象;在上述数据仓库的第一数据源中按照上述数据更新操作对上述第一数据对象进行更新,以使得上述第一数据对象发生变化。
根据本公开的一个或多个实施例,上述第一数据源为远程数据源,上述第二数据源为本地数据源;或,上述第一数据源为本地数据源,上述第二数据源为远程数据源。
根据本公开的一个或多个实施例,响应于上述第一数据对象是一组键值对,基于上述第一数据对象对应的键,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新。
根据本公开的一个或多个实施例,确定上述第一数据对象对应的条件信息;基于上述条件信息,在上述数据仓库的第二数据源中按照上述第一数据对象的变化对第二数据对象进行更新。
根据本公开的一个或多个实施例,该装置被进一步配置成:生成目标远程数据源;响应于检测到针对上述目标远程数据源的数据请求,将上述数据请求对应的目标更新数据,存储到上述目标远程数据源和上述目标远程数据源关联的目标本地数据源中。
根据本公开的一个或多个实施例,提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如上述任一实施例描述的方法。
根据本公开的一个或多个实施例,提供了一种计算机可读介质,其上存储有计算机程序,其中,程序被处理器执行时实现如上述任一实施例描述的方法。
以上描述仅为本公开的一些较佳实施例以及对所运用技术原理的 说明。本领域技术人员应当理解,本公开的实施例中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开的实施例中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
Claims (9)
- 一种同步数据方法,包括:响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在所述数据仓库的第二数据源中按照所述第一数据对象的变化对第二数据对象进行更新,以使得所述第二数据对象与所述第一数据对象保持一致;响应于所述第二数据对象发生变化,对基于所述第二数据对象的第一界面数据对象进行更新并将更新后的所述第一界面数据对象呈现在所述第一界面数据对象对应的第一显示界面中;其中,所述第一数据对象和所述第二数据对象为同一数据对象在不同数据源中的副本。
- 根据权利要求1所述的方法,其特征在于,还包括:响应于在第二显示界面中检测到数据更新操作,在所述第二显示界面对应的第二界面数据对象中确定所述数据更新操作对应的所述第一数据对象;在所述数据仓库的第一数据源中按照所述数据更新操作对所述第一数据对象进行更新,以使得所述第一数据对象发生变化。
- 根据权利要求1所述的方法,其特征在于,所述第一数据源为远程数据源,所述第二数据源为本地数据源;或,所述第一数据源为本地数据源,所述第二数据源为远程数据源。
- 根据权利要求1所述的方法,其特征在于,所述在所述数据仓库的第二数据源中按照所述第一数据对象的变化对第二数据对象进行更新,包括:响应于所述第一数据对象是一组键值对,基于所述第一数据对象对应的键,在所述数据仓库的第二数据源中按照所述第一数据对象的变化 对第二数据对象进行更新。
- 根据权利要求1所述的方法,其特征在于,所述在所述数据仓库的第二数据源中按照所述第一数据对象的变化对第二数据对象进行更新,包括:确定所述第一数据对象对应的条件信息;基于所述条件信息,在所述数据仓库的第二数据源中按照所述第一数据对象的变化对第二数据对象进行更新。
- 根据权利要求1-5之一所述的方法,其特征在于,还包括:生成目标远程数据源;响应于检测到针对所述目标远程数据源的数据请求,将所述数据请求对应的目标更新数据,存储到所述目标远程数据源和所述目标远程数据源关联的目标本地数据源中。
- 一种同步数据装置,包括:更新单元,被配置成响应于在数据仓库的第一数据源中检测到第一数据对象发生变化,在所述数据仓库的第二数据源中按照所述第一数据对象的变化对第二数据对象进行更新,以使得所述第二数据对象与所述第一数据对象保持一致;呈现单元,被配置成响应于所述第二数据对象发生变化,对基于所述第二数据对象的第一界面数据对象进行更新并将更新后的所述第一界面数据对象呈现在所述第一界面数据对象对应的第一显示界面中;其中,所述第一数据对象和所述第二数据对象为同一数据对象在不同数据源中的副本。
- 一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述 一个或多个处理器实现如权利要求1-6中任一所述的方法。
- 一种计算机可读介质,其上存储有计算机程序,其中,所述程序被处理器执行时实现如权利要求1-6中任一所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010716142.3 | 2020-07-23 | ||
| CN202010716142.3A CN113971195B (zh) | 2020-07-23 | 2020-07-23 | 同步数据方法、装置、电子设备和介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022017458A1 true WO2022017458A1 (zh) | 2022-01-27 |
Family
ID=79585303
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/107844 Ceased WO2022017458A1 (zh) | 2020-07-23 | 2021-07-22 | 同步数据方法、装置、电子设备和介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN113971195B (zh) |
| WO (1) | WO2022017458A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114579667A (zh) * | 2022-04-28 | 2022-06-03 | 深圳市华曦达科技股份有限公司 | 一种HBase数据增量同步的方法、装置及系统 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114625368A (zh) * | 2022-03-14 | 2022-06-14 | 平安国际智慧城市科技股份有限公司 | 数据同步的方法、装置、电子设备以及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103309818A (zh) * | 2012-03-09 | 2013-09-18 | 腾讯科技(深圳)有限公司 | 存储数据的方法及装置 |
| US20150317372A1 (en) * | 2013-01-15 | 2015-11-05 | Realnetworks, Inc. | Core data synchronization systems and methods |
| CN108845856A (zh) * | 2018-06-11 | 2018-11-20 | 腾讯科技(深圳)有限公司 | 数据绑定方法、装置、存储介质及设备 |
| CN109376163A (zh) * | 2018-09-18 | 2019-02-22 | 广州视源电子科技股份有限公司 | 一种数据双向绑定的方法、装置、终端及存储介质 |
| CN110019279A (zh) * | 2019-04-11 | 2019-07-16 | 北京字节跳动网络技术有限公司 | 在线文档的协同更新方法、装置、设备及存储介质 |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100589455C (zh) * | 2007-03-13 | 2010-02-10 | 中兴通讯股份有限公司 | 一种ims终端上联系人头像呈现方法 |
| CN102014079A (zh) * | 2010-11-24 | 2011-04-13 | 康佳集团股份有限公司 | 一种用户自定义网络头像的方法 |
| CN105553704B (zh) * | 2015-12-10 | 2019-03-12 | 北京润科通用技术有限公司 | 一种多人协同处理故障树的方法及系统 |
| CN105915657B (zh) * | 2016-06-30 | 2020-07-24 | 北京奇虎科技有限公司 | 数据的同步方法、装置及客户端 |
| CN107657419A (zh) * | 2016-07-25 | 2018-02-02 | 武汉票据交易中心有限公司 | 一种业务流程的处理方法及相关装置和服务器 |
| CN106789552B (zh) * | 2016-11-24 | 2020-09-29 | 青岛海信移动通信技术股份有限公司 | 社交账号的好友头像更新方法和装置 |
| US11269662B2 (en) * | 2018-12-04 | 2022-03-08 | Sap Se | Driving different types of user interfaces with a single backend view controller |
| CN111352672A (zh) * | 2018-12-24 | 2020-06-30 | 北京微播视界科技有限公司 | 页面的同步方法、装置、电子设备及计算机可读存储介质 |
-
2020
- 2020-07-23 CN CN202010716142.3A patent/CN113971195B/zh active Active
-
2021
- 2021-07-22 WO PCT/CN2021/107844 patent/WO2022017458A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103309818A (zh) * | 2012-03-09 | 2013-09-18 | 腾讯科技(深圳)有限公司 | 存储数据的方法及装置 |
| US20150317372A1 (en) * | 2013-01-15 | 2015-11-05 | Realnetworks, Inc. | Core data synchronization systems and methods |
| CN108845856A (zh) * | 2018-06-11 | 2018-11-20 | 腾讯科技(深圳)有限公司 | 数据绑定方法、装置、存储介质及设备 |
| CN109376163A (zh) * | 2018-09-18 | 2019-02-22 | 广州视源电子科技股份有限公司 | 一种数据双向绑定的方法、装置、终端及存储介质 |
| CN110019279A (zh) * | 2019-04-11 | 2019-07-16 | 北京字节跳动网络技术有限公司 | 在线文档的协同更新方法、装置、设备及存储介质 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114579667A (zh) * | 2022-04-28 | 2022-06-03 | 深圳市华曦达科技股份有限公司 | 一种HBase数据增量同步的方法、装置及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113971195A (zh) | 2022-01-25 |
| CN113971195B (zh) | 2025-12-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2021051761A1 (zh) | 用于同步节点数据的方法和装置 | |
| CN110909521B (zh) | 在线文档信息的同步处理方法、装置及电子设备 | |
| US20240045879A1 (en) | Presentation method, apparatus and electronic device | |
| CN115344688A (zh) | 业务数据展示方法、装置、电子设备和计算机可读介质 | |
| US20170003829A1 (en) | Graphical user interface facilitating sharing and collaborative editing of electronic documents | |
| WO2023029850A1 (zh) | 一种数据处理方法、装置、电子设备和介质 | |
| CN111596991A (zh) | 交互操作执行方法、装置和电子设备 | |
| WO2022017458A1 (zh) | 同步数据方法、装置、电子设备和介质 | |
| CN111273830A (zh) | 显示数据方法、装置、电子设备和计算机可读介质 | |
| CN111459364A (zh) | 图标更新方法、装置和电子设备 | |
| CN114697285A (zh) | 信息展示和信息发送方法、装置、设备、介质和产品 | |
| CN111262907A (zh) | 服务实例访问方法、装置和电子设备 | |
| CN112230986B (zh) | 项目文件生成方法、装置、电子设备和计算机可读介质 | |
| CN112100211B (zh) | 数据存储方法、装置、电子设备和计算机可读介质 | |
| CN110633324B (zh) | 用于同步数据的方法、装置、电子设备和计算机可读介质 | |
| CN111338827B (zh) | 表格数据的粘贴方法、装置以及电子设备 | |
| CN110619093B (zh) | 确定搜索项目的顺序的方法、装置、电子设备和计算机可读存储介质 | |
| CN110113416B (zh) | 用于展示信息的方法和装置 | |
| CN112115154A (zh) | 数据处理和数据查询方法、装置、设备和计算机可读介质 | |
| CN111596992A (zh) | 导航栏展示方法、装置和电子设备 | |
| CN112148417A (zh) | 页面调整方法、装置、电子设备和计算机可读介质 | |
| CN112100159A (zh) | 数据处理方法、装置、电子设备和计算机可读介质 | |
| CN115248642B (zh) | 信息交互方法、装置和电子设备 | |
| CN112631581A (zh) | 信息处理方法及装置 | |
| CN111797350A (zh) | 数据处理方法、装置和电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21847163 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02.05.2023) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21847163 Country of ref document: EP Kind code of ref document: A1 |