The invention belongs to the technical field of
electric signal data processing, and discloses a data automatic synchronization method and
system for an active-active architecture real-time
database, and the method comprises the steps: after a real-time
database service is started, one end of a main
database is responsible for
processing a
time sequence data write-in request of a
client, and after the main database receives data, the main database is responsible for
processing a
time sequence data write-in request of the
client; writing the data into a synchronous data
queue, and writing the data into storage; when data exists in the synchronous data
queue, writing the data into a synchronous cache file, and preparing to send the data to a slave
library for synchronization; comparing the
metadata information of the master
library with the
metadata information of the slave
library, querying whether the
metadata versions are consistent or not, and when the metadata are not synchronized, pausing
data synchronization and performing metadata synchronization; under the metadata synchronization condition, the
data synchronization process continues; and after receiving the synchronous data, the slave library writes the synchronous data. According to the method, the
data synchronization rate of the two ends of the real-time database of the active-active architecture is improved, and the complete consistency and
high availability of the data are ensured.