Disclosure of Invention
The specification provides a data synchronization method, a data synchronization device and electronic equipment, breaks through the limitation of a unique data source and simplifies the problem of data synchronization.
The present specification provides a data synchronization method, including:
Acquiring basic data;
The basic data are landed on a central server and/or an application system, and a central time stamp of the basic data is obtained;
Judging whether the data source time of the basic data is updated compared with the center time stamp;
When the data source time of the basic data is updated compared with the central time stamp, the updated basic data is updated to the central server and/or the application system, and the central time stamp is updated based on the data source time.
Optionally, the step of landing the base data on a central server and/or an application system to obtain a central timestamp of the base data includes:
the basic data is landed on a central server once, unique identifiers which are mapped with the basic data landed once are obtained, and a central time stamp of the basic data landed once is recorded;
And secondarily landing the primary-landed basic data on an application system, and establishing a mapping relation between the secondarily landed basic data and the unique identifier.
Optionally, when the data source time of the base data is updated compared with the central time stamp, updating the updated base data to the central server and/or the application system, and updating the central time stamp based on the data source time, including:
the basic data of the ground comprises the basic data of primary ground and the basic data of secondary ground;
When the data source time of the basic data which falls to the ground at one time is updated compared with the center time stamp, updating the updated basic data to the center server, and updating the center time stamp based on the data source time;
and updating the updated basic data to the application system based on the basic data of which the unique identification is matched with the secondary landing.
Optionally, when the data source time of the base data is updated compared with the central time stamp, updating the updated base data to the central server and/or the application system, and updating the central time stamp based on the data source time, further including:
when the data source time of the basic data of the secondary landing is updated compared with the center time stamp, updating the updated basic data to the center server based on the basic data of the primary landing matched with the unique identification, and updating the center time stamp based on the data source time;
and updating the updated basic data to the application system based on the basic data of which the unique identification is matched with the secondary landing.
Optionally, the updating the updated basic data to the application system based on the basic data with the unique identifier matched to the secondary floor includes:
acquiring field information of the basic data of the secondary landing;
Judging whether the updated field information of the basic data is consistent with the field information of the basic data which falls to the ground for the second time;
When the updated field information of the basic data is inconsistent with the field information of the basic data of the secondary landing, the updated field information of the basic data is forcedly converted into the field information consistent with the field information of the basic data of the secondary landing;
And updating the updated basic data subjected to forced conversion to the application system.
The present specification provides a data synchronization apparatus including:
the acquisition module is used for acquiring the basic data;
The grounding module is used for grounding the basic data on a central server and/or an application system to obtain a central time stamp of the basic data;
the judging module is used for judging whether the data source time of the basic data is updated compared with the center time stamp;
And the updating module is used for updating the updated basic data to the central server and/or the application system when the data source time of the basic data is updated compared with the central time stamp, and updating the central time stamp based on the data source time.
Optionally, the floor module includes:
The primary landing unit is used for landing the basic data on the central server once to obtain unique identifiers which are mapped with the basic data which is landed once one by one, and recording the central time stamp of the basic data which is landed once;
and the secondary grounding unit is used for secondarily grounding the primary grounding basic data to an application system and establishing a mapping relation between the secondary grounding basic data and the unique identifier.
Optionally, the updating module includes:
the basic data of the ground comprises the basic data of primary ground and the basic data of secondary ground;
A primary updating unit, configured to update the updated base data to the central server when a data source time of the primary dropped base data is updated compared with the central timestamp, and update the central timestamp based on the data source time;
And the secondary updating unit is used for updating the updated basic data to the application system based on the basic data with the unique identification matched to the secondary landing.
Optionally, the updating module further includes:
A matching unit that applies, when a data source time of the base data of the secondary landing is updated compared with the center timestamp, updates the updated base data to the center server based on the base data of the primary landing being matched with the unique identification, and updates the center timestamp based on the data source time;
and the synchronization unit is used for updating the updated basic data to the application system based on the basic data with the unique identification matched to the secondary ground.
Optionally, the secondary updating unit includes:
acquiring field information of the basic data of the secondary landing;
Judging whether the updated field information of the basic data is consistent with the field information of the basic data which falls to the ground for the second time;
When the updated field information of the basic data is inconsistent with the field information of the basic data of the secondary landing, the updated field information of the basic data is forcedly converted into the field information consistent with the field information of the basic data of the secondary landing;
And updating the updated basic data subjected to forced conversion to the application system.
The specification also provides an electronic device, wherein the electronic device includes:
Processor, and
A memory storing computer executable instructions that, when executed, cause the processor to perform any of the methods described above.
The present specification also provides a computer readable storage medium storing one or more programs which when executed by a processor implement any of the methods described above.
The invention breaks the limit of a unique data source by adopting a secondary landing innovative method, does not invade an application system through a central server, does not need to change the application system in a large amount, establishes a mapping relation between the unique identification code and basic data, improves the matching efficiency and simplifies the problem of data synchronization.
Detailed Description
The following description is presented to enable one of ordinary skill in the art to make and use the invention. The preferred embodiments in the following description are by way of example only and other obvious variations will occur to those skilled in the art. The basic principles of the invention defined in the following description may be applied to other embodiments, variations, modifications, equivalents, and other technical solutions without departing from the spirit and scope of the invention.
Exemplary embodiments of the present invention are described more fully below in connection with fig. 1-4. However, the exemplary embodiments can be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the invention to those skilled in the art. The same reference numerals in the drawings denote the same or similar elements, components or portions, and thus a repetitive description thereof will be omitted.
The features, structures, characteristics or other details described in a particular embodiment do not exclude that may be combined in one or more other embodiments in a suitable manner, without departing from the technical idea of the invention.
In the description of specific embodiments, features, structures, characteristics, or other details described in the present invention are provided to enable one skilled in the art to fully understand the embodiments. It is not excluded that one skilled in the art may practice the present invention without one or more of the specific features, structures, characteristics, or other details.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The term "and/or" and/or "includes all combinations of any one or more of the associated listed items.
Fig. 1 is a schematic diagram of a data synchronization method according to an embodiment of the present disclosure, including:
S110, acquiring basic data;
S120, the basic data are landed on a central server and/or an application system, and a central time stamp of the basic data is obtained;
optionally, the S120 includes:
the basic data is landed on a central server once, unique identifiers which are mapped with the basic data landed once are obtained, and a central time stamp of the basic data landed once is recorded;
And secondarily landing the primary-landed basic data on an application system, and establishing a mapping relation between the secondarily landed basic data and the unique identifier.
In the specific embodiment of the present disclosure, the basic data may be obtained by uploading, or may be data formed after use by the user. And firstly, the basic data is firstly landed on a central server, a uuid is allocated to establish a mapping relation with the basic data landed once, and a central time stamp is stamped. And then pushing the basic data to an application system for secondary landing, and simultaneously establishing a mapping relation between the uuid and the secondarily landed basic data. And the unique data source is limited through the mapping relation between uuid and primary and secondary landed basic data.
S130, judging whether the data source time of the basic data is updated compared with the center time stamp;
and S140, when the data source time of the basic data is updated compared with the center time stamp, updating the updated basic data to the center server and/or the application system, and updating the center time stamp based on the data source time.
Optionally, the S140 includes:
the basic data of the ground comprises the basic data of primary ground and the basic data of secondary ground;
When the data source time of the basic data which falls to the ground at one time is updated compared with the center time stamp, updating the updated basic data to the center server, and updating the center time stamp based on the data source time;
and updating the updated basic data to the application system based on the basic data of which the unique identification is matched with the secondary landing.
In the specific embodiment of the specification, the data source time of the basic data is updated in comparison with the center time stamp, the updated basic data is landed on the center server again in real time, and the center time stamp is updated. And then, based on the base data with the unique identification matched to the secondary landing, pushing the updated base data to the corresponding application system.
Optionally, the updating the updated basic data to the application system based on the basic data with the unique identifier matched to the secondary floor includes:
acquiring field information of the basic data of the secondary landing;
Judging whether the updated field information of the basic data is consistent with the field information of the basic data which falls to the ground for the second time;
When the updated field information of the basic data is inconsistent with the field information of the basic data of the secondary landing, the updated field information of the basic data is forcedly converted into the field information consistent with the field information of the basic data of the secondary landing;
And updating the updated basic data subjected to forced conversion to the application system.
In this specification, field information includes, but is not limited to, field type, field length, field format. Judging whether the field information of the updated basic data meets the field rule or not, referring to the field information of the secondary ground basic data, and performing forced conversion on the updated basic information based on the field rule when the field information of the updated basic data and the field information of the secondary ground basic data are inconsistent.
Optionally, the step S140 further includes:
when the data source time of the basic data of the secondary landing is updated compared with the center time stamp, updating the updated basic data to the center server based on the basic data of the primary landing matched with the unique identification, and updating the center time stamp based on the data source time;
and updating the updated basic data to the application system based on the basic data of which the unique identification is matched with the secondary landing.
In the specific embodiment of the present disclosure, after the secondary grounding basic data is updated, the central server obtains the updated secondary grounding basic data from the application system based on the unique identifier, and performs grounding. And then, the central server pushes the updated basic data to the rest of application systems for updating.
The invention breaks the limit of a unique data source by adopting a secondary landing innovative method, does not invade an application system through a central server, does not need to change the application system in a large amount, establishes a mapping relation between the unique identification code and basic data, improves the matching efficiency and simplifies the problem of data synchronization.
Fig. 2 is a schematic diagram of a data synchronization device according to an embodiment of the present disclosure, including:
An acquisition module 10 for acquiring basic data;
A landing module 20, configured to land the base data on a central server and/or an application system, to obtain a central timestamp of the base data;
A judging module 30, configured to judge whether the data source time of the base data that falls to the ground is updated compared with the center timestamp;
An updating module 40, configured to update the updated base data to the central server and/or the application system when the data source time of the base data is compared with the central time stamp, and update the central time stamp based on the data source time.
Optionally, the floor module includes:
The primary landing unit is used for landing the basic data on the central server once to obtain unique identifiers which are mapped with the basic data which is landed once one by one, and recording the central time stamp of the basic data which is landed once;
and the secondary grounding unit is used for secondarily grounding the primary grounding basic data to an application system and establishing a mapping relation between the secondary grounding basic data and the unique identifier.
Optionally, the updating module includes:
the basic data of the ground comprises the basic data of primary ground and the basic data of secondary ground;
A primary updating unit, configured to update the updated base data to the central server when a data source time of the primary dropped base data is updated compared with the central timestamp, and update the central timestamp based on the data source time;
And the secondary updating unit is used for updating the updated basic data to the application system based on the basic data with the unique identification matched to the secondary landing.
Optionally, the updating module further includes:
A matching unit configured to update, when a data source time of the base data of the secondary landing is updated compared with the center timestamp, the updated base data to the center server based on the base data of the primary landing being matched with the unique identifier, and update the center timestamp based on the data source time;
and the synchronization unit is used for updating the updated basic data to the application system based on the basic data with the unique identification matched to the secondary ground.
Optionally, the secondary updating unit includes:
acquiring field information of the basic data of the secondary landing;
Judging whether the updated field information of the basic data is consistent with the field information of the basic data which falls to the ground for the second time;
When the updated field information of the basic data is inconsistent with the field information of the basic data of the secondary landing, the updated field information of the basic data is forcedly converted into the field information consistent with the field information of the basic data of the secondary landing;
And updating the updated basic data subjected to forced conversion to the application system.
The functions of the apparatus according to the embodiments of the present invention have been described in the foregoing method embodiments, so that the descriptions of the embodiments are not exhaustive, and reference may be made to the related descriptions in the foregoing embodiments, which are not repeated herein.
Based on the same inventive concept, the embodiments of the present specification also provide an electronic device.
The following describes an embodiment of an electronic device according to the present invention, which may be regarded as a specific physical implementation of the above-described embodiment of the method and apparatus according to the present invention. The details described in the embodiments of the electronic device according to the invention should be regarded as additions to the embodiments of the method or the apparatus described above, and the details not disclosed in the embodiments of the electronic device according to the invention may be realized by referring to the embodiments of the method or the apparatus described above.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. An electronic device 300 according to this embodiment of the present invention is described below with reference to fig. 3. The electronic device 300 shown in fig. 3 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 3, the electronic device 300 is embodied in the form of a general purpose computing device. The components of electronic device 300 may include, but are not limited to, at least one processing unit 310, at least one memory unit 320, a bus 330 connecting the different system components (including memory unit 320 and processing unit 310), a display unit 340, and the like.
Wherein the storage unit stores program code that is executable by the processing unit 310 such that the processing unit 310 performs the steps according to various exemplary embodiments of the invention described in the above processing method section of the present specification. For example, the processing unit 310 may perform the steps shown in fig. 1.
The memory unit 320 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 3201 and/or cache memory 3202, and may further include Read Only Memory (ROM) 3203.
The storage unit 320 may also include a program/utility 3204 having a set (at least one) of program modules 3205, such program modules 3205 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 330 may be one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 300 may also communicate with one or more external devices 400 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 300, and/or any device (e.g., router, modem, etc.) that enables the electronic device 300 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 350. Also, electronic device 300 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 360. The network adapter 360 may communicate with other modules of the electronic device 300 via the bus 330. It should be appreciated that although not shown in FIG. 3, other hardware and/or software modules may be used in connection with electronic device 300, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
From the above description of embodiments, those skilled in the art will readily appreciate that the exemplary embodiments described herein may be implemented in software, or may be implemented in software in combination with necessary hardware. Thus, the technical solution according to the embodiments of the present invention may be embodied in the form of a software product, which may be stored in a computer readable storage medium (may be a CD-ROM, a usb disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, or a network device, etc.) to perform the above-mentioned method according to the present invention. The computer program, when executed by a data processing device, enables the computer readable medium to carry out the above-described method of the invention, i.e. the method as shown in fig. 1.
Fig. 4 is a schematic diagram of a computer readable medium according to an embodiment of the present disclosure.
A computer program implementing the method shown in fig. 1 may be stored on one or more computer readable media. The computer readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of a readable storage medium include an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
In summary, the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components in accordance with embodiments of the present invention may be implemented in practice using a general purpose data processing device such as a microprocessor or Digital Signal Processor (DSP). The present invention can also be implemented as an apparatus or device program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program embodying the present invention may be stored on a computer readable medium, or may have the form of one or more signals. Such signals may be downloaded from an internet website, provided on a carrier signal, or provided in any other form.
The above-described specific embodiments further describe the objects, technical solutions and advantageous effects of the present invention in detail, and it should be understood that the present invention is not inherently related to any particular computer, virtual device or electronic apparatus, and various general-purpose devices may also implement the present invention. The foregoing description of the embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.