A data synchronization method, device, equipment, medium and product

By filtering and verifying buffered data between the master and slave nodes of the distributed database, the data synchronization problem in large ships and industrial systems is solved, and more efficient data checks and synchronization is achieved, improving the stability and operating efficiency of the system.

CN119782412APending Publication Date: 2025-04-08THE 711TH RES INST OF CHINA STATE SHIPBUILDING CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411753128.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In large-scale marine and industrial systems, the data synchronization problem of distributed databases has affected the system operation efficiency and stability.

Method used

By implementing buffered data filtering between the master and slave nodes, filtered data is generated and synchronized when the data is missing. The specific steps include filtering the buffered data by the master node and slave node, generating information about the filtered data, and the master node checks whether the timing database data is missing based on this information, and synchronizes the data when it is missing.

Benefits of technology

This method not only reduces the amount of data that needs to be stored in the timing database, but also improves the efficiency of data checksum synchronization and improves the overall operating efficiency and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782412A_ABST
    Figure CN119782412A_ABST
Patent Text Reader

Abstract

The present application discloses a data synchronization method, device, equipment, medium and product, the method comprising: the master node and the slave node filter the buffered data to obtain the filtered data, wherein the buffered data is the data received by the master node or the slave node in real time and stored in the buffer; when the slave node receives the status query message of the master node, it sends a status message to the master node, and the status message includes the information of the filtered data; the master node verifies whether the time series database data on the master node and / or the slave node is missing according to the information of the filtered data; when the verification result indicates that the time series database data on the master node and / or the slave node is missing, the master node and / or the slave node are synchronized based on the filtered data. The method provided by the present application can reduce the amount of stored data and improve the efficiency of data synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a data synchronization method, device, equipment, medium and product. Background Art

[0002] In large ships and industrial systems, it is necessary to use distributed databases to achieve data persistence while avoiding single node failures. Data synchronization between various databases is an important basis for improving system operation efficiency and stability. The systems in the industrial and ship fields are complex, and the failure of a single database will cause system-level abnormalities, which requires the deployment of databases at different nodes in the system to achieve persistent storage of data. Traditional database solutions can only guarantee the normal operation of their own services. If the equipment is shut down or the service fails, local data will be lost. Therefore, based on the distributed database, a data synchronization method is urgently needed. Summary of the invention

[0003] The present application provides a data synchronization method, device, equipment, medium and product, aiming to effectively solve the above-mentioned technical problems.

[0004] According to a first aspect of the present application, the present application provides a data synchronization method, comprising:

[0005] The master node and the slave node filter the buffered data to obtain filtered data, wherein the buffered data is data received by the master node or the slave node in real time and stored in a buffer;

[0006] When receiving the status query message from the master node, the slave node sends a status message to the master node, wherein the status message includes information of the filtered data;

[0007] The master node verifies whether the time series database data on the master node and / or the slave node is missing according to the information of the filtered data;

[0008] When the verification result indicates that the time series database data on the master node and / or the slave node is missing, data synchronization is performed on the master node and / or the slave node based on the filtered data.

[0009] Furthermore, the master node and the slave node filter the buffered data, including:

[0010] The master node and the slave node filter the buffered data within a preset time according to the preset backtracking time to obtain filtered data, and store the filtered data in their respective time series databases and generate information about the filtered data.

[0011] Furthermore, the backtracking time includes a first backtracking time and a second backtracking time, and the time interval between the first backtracking time and the second backtracking time is positively correlated with the amount of the filtered data.

[0012] Furthermore, the buffered data includes a real-time value and a recording time; the master node and the slave node filter the buffered data within a preset time, including:

[0013] When both the recording time and the real-time value change, the master node and the slave node filter the buffered data within a preset time.

[0014] Further, synchronizing the data of the master node and / or the slave node based on the filtered data includes:

[0015] The master node obtains the filtered data from the time series database of the master node and / or the slave node according to the information of the filtered data and synchronizes them.

[0016] Further, when the verification result indicates that data in the time series database of the master node is missing, the master node obtains the filtered data from the time series database of the slave node according to information of the filtered data and stores the filtered data in the time series database of the master node;

[0017] When the verification result indicates that data in the time series database of the slave node is missing, the master node obtains the filtered data from the time series database of the master node according to the information of the filtered data and sends it to the slave node, and the slave node stores the filtered data in the time series database of the slave node.

[0018] Further, the recording time includes the latest recording time and the last recording time, and the real-time value includes the latest real-time value and the last real-time value;

[0019] The master node and the slave node compare the latest recorded time with the last recorded time to determine whether the recorded time has changed; and when the recorded time has changed, compare the latest real-time value with the last real-time value to determine whether the real-time value has changed.

[0020] Furthermore, when the verification result indicates that the time series database data of the master node and the slave node are not missing, the master node sends a new status query message to the slave node.

[0021] According to a second aspect of the present application, the present application further provides a data synchronization device, including:

[0022] A data filtering module, used for the master node and the slave node to filter the buffered data to obtain filtered data, wherein the buffered data is data received by the master node or the slave node in real time and stored in a buffer;

[0023] A message sending module, used for the slave node to send a status message to the master node when receiving a status query message from the master node, wherein the status message includes information of the filtered data;

[0024] A verification module, used by the master node to verify whether the time series database data on the master node and / or the slave node is missing according to the information of the filtered data;

[0025] The data synchronization module is used to synchronize the data of the master node and / or the slave node based on the filtered data when the verification result indicates that the time series database data on the master node and / or the slave node is missing.

[0026] According to the third aspect of the present application, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.

[0027] According to a fourth aspect of the present application, the present application also provides a storage medium, in which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to execute the steps of the above method.

[0028] According to a fifth aspect of the present application, the present application also provides a computer program product, comprising a computer program, wherein the computer program implements the steps of the above method when executed by a processor.

[0029] Through one or more of the above-mentioned embodiments in the present application, at least the following technical effects can be achieved: in the data synchronization method provided by the embodiments of the present application, the master node and the slave node filter the buffered data collected in real time, and the master node subsequently verifies whether the time series database on the master node and the slave node is missing data based on the information of the filtered data, and in the case of missing data, synchronizes the data on the master node and / or the slave node, which not only reduces the amount of data that needs to be stored in the time series database, but also improves the data verification efficiency, thereby improving the data synchronization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The technical solution and other beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0031] Figure 1 One of the flow charts of the data synchronization method provided in the embodiment of the present application;

[0032] Figure 2 A schematic diagram of the backtracking time provided in the embodiment of the present application;

[0033] Figure 3 One of the schematic diagrams of time series database synchronization provided in an embodiment of the present application;

[0034] Figure 4 The second schematic diagram of the time series database synchronization provided by the embodiment of the present application;

[0035] Figure 5 The second flowchart of the data synchronization method provided in the embodiment of the present application;

[0036] Figure 6 A schematic diagram of the structure of data synchronization provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0038] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.

[0039] In order to facilitate understanding of the data synchronization method, device, equipment, medium and product provided in the embodiments of the present application, the following terms are first introduced:

[0040] Time series databases are database systems designed specifically for processing data that changes over time. This type of data typically includes metrics from servers and applications, readings from IoT sensors, user interactions on a website or application, or trading activity on financial markets. Time series databases optimize the ingestion, processing, and storage of data and are particularly well suited for processing data with timestamps.

[0041] A database node refers to an entity used to store and process data in a distributed database system. Each node is an independent server or computer with its own processing power and storage space. Among them, the master node is a node in the database cluster, responsible for coordinating the operation of the entire cluster. The master node is usually responsible for managing the metadata of the cluster, processing client requests, and forwarding requests to other nodes for processing. The master node is also responsible for monitoring the status of other nodes in the cluster and performing failover when a node fails. The slave node is a node in the database cluster, responsible for processing read operations requested by clients. The slave node copies data from the master node and maintains data consistency with the master node. Slave nodes are usually used to provide load balancing and fault recovery for read operations.

[0042] Figure 1 A flowchart of a data synchronization method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, a data synchronization method comprises the following steps:

[0043] S101, the master node and the slave node filter the buffered data to obtain filtered data.

[0044] The buffered data is data received by the master node or the slave node in real time and stored in a buffer.

[0045] Specifically, the master node and each slave node include a buffer and a time series database, and the master node and each slave node can collect data from ships or industrial systems in real time. The master node and the slave node store the real-time data in the buffer to form buffer data, and filter the buffer data to obtain filtered data. For example, if the data at the current moment is repeated with the data at the previous moment, the data at the previous moment is filtered, or data within a period of time is intercepted, and the filtered data is subsequently stored in the time series database of each node, and the data is verified to be missing based on the filtered data during the data synchronization process of the master node and / or the slave node.

[0046] In addition, the time series database may specifically be InfluxDB, Prometheus, Apache IoTDB, TimescaleDB, TDengine, etc., without limitation.

[0047] S102, when receiving the status query message from the master node, the slave node sends a status message to the master node, where the status message includes information of filtered data.

[0048] In this step, the master node sends a status query message to each slave node, and the slave node responds to the status query message and sends a status message to the master node. The status message fed back by the slave node contains information about the filtered data, such as the recording time of the filtered data, the information of the slave node where the filtered data is located, etc. The information about the filtered data can reflect the status of the data stored in the time series database.

[0049] S103, the master node verifies whether the time series database data on the master node and the slave node are missing according to the information of the filtered data.

[0050] In this step, after receiving the status messages from all slave nodes, the master node verifies whether the data in the time series database on the master node and / or slave node is missing based on the information of the filtered data in the status message. Specifically, the filtered data information is compared to determine whether the data is missing.

[0051] S104: When the verification result indicates that the time series database data on the master node and / or the slave node is missing, synchronize the data on the master node and / or the slave node based on the filtered data.

[0052] It should be noted that the master node and the slave node filter the buffered data in real time, so as to update the filtered data and the information of the filtered data in real time.

[0053] In the data synchronization method provided in the embodiment of the present application, the master node and the slave node filter the buffered data collected in real time, and the master node subsequently verifies whether the time series database on the master node and the slave node is missing data based on the information of the filtered data, and synchronizes the data on the master node and / or the slave node when data is missing, which not only reduces the amount of data that needs to be stored in the time series database, but also improves the data verification efficiency, thereby improving the data synchronization efficiency.

[0054] In some embodiments of the present application, the master node and the slave node filter the buffered data, including:

[0055] The master node and the slave node filter the buffered data within a preset time according to the preset backtracking time to obtain filtered data, and store the filtered data in their respective time series databases and generate information about the filtered data.

[0056] Specifically, the backtracking time includes a first backtracking time and a second backtracking time, and the time interval between the first backtracking time and the second backtracking time is positively correlated with the amount of the filtered data. That is, the longer the time interval between the first backtracking time and the second backtracking time is, the larger the amount of filtered data is, and the shorter the time interval is, the smaller the amount of filtered data is.

[0057] like Figure 2 As shown, taking the preset time of 1 minute as an example, the master node and the slave node will obtain 1 minute of buffered data from the buffer in real time for filtering, specifically by setting the first backtracking time lastSencond1 and the second backtracking time lastSencond2, which can adjust the data filtering ratio. The time interval between the first backtracking time lastSencond1 and the second backtracking time lastSencond2 is less than or equal to the preset time period of 1 minute.

[0058] Among them, the larger the lastSencond1, Figure 2 The closer the lastSencond1 label is to the 1min time cutoff, the longer the time span for each node (including the master node and the slave node) to judge the validity is, and the more data is filtered per minute, indicating that the data update frequency of the time series database that the entire business system needs to store is slow, and a longer time span is required to determine whether the node is valid, and vice versa. The larger the lastSencond2, Figure 2 The closer the label of lastSencond1 is to the time cutoff point of 1min, the smaller the time span of each node to judge the validity is, and the less data needs to be discarded, that is, the more data needs to be stored and recorded, indicating that the data update frequency of the database that the entire business system needs to store is faster, and vice versa. In addition, the data between lastSencond2 and 0min can be considered as too old data and can be discarded; the data between lastSencond1 and 1min can be considered as valid data, which can be stored in the time series database corresponding to the time information, or filtered out to reduce the amount of data.

[0059] It should be noted that lastSencond1 and lastSencond2 are for the entire distributed database system. The master node and each slave node filter data according to their own lastSencond1 and lastSencond2. This ensures that when only one node has data changes, the entire system can perceive the data changes during the traversal process, thereby completing the recording of the data file and providing a basis for subsequent data verification.

[0060] After the filtered data is successfully entered into the time series database every minute, the consistency of the data in the time series database can be determined by directly comparing the entered data files. This operation avoids repeated read and write operations of the time series database, improves the comparison efficiency, and reduces the operation load of the time series database as much as possible in a large system, ensuring efficient and fast real-time data recording.

[0061] In addition, in other embodiments of the present application, buffer data of different durations such as 2 minutes and 5 minutes may be filtered, and the present application does not limit this.

[0062] It should be noted that the first backtracking time and the second backtracking time of different nodes may be the same or different, and may be set according to the time series database update frequency required by each node, and the present application does not limit this. In addition, in another embodiment of the present application, there may be only the first backtracking time, that is, the data between the first backtracking time and the cutoff time point is retained, and the data before the first backtracking time is filtered out. Taking the 0-1min time period as an example, the first backtracking time can be set to 0, and the second backtracking time can be set to 1min, at which time all data will be retained. In addition, after filtering the current 1min buffered data, the node will filter the next 1min buffered data, thereby updating the time series database in real time.

[0063] In some embodiments of the present application, the buffered data includes a real-time value and a recording time; the master node and the slave node filter the buffered data within a preset time, including:

[0064] When both the recording time and the real-time value change, the master node and the slave node filter the buffered data within a preset time.

[0065] Specifically, the recording time includes the latest recording time and the last recording time, and the real-time value includes the latest real-time value and the last real-time value.

[0066] The master node and the slave node compare the latest recorded time with the last recorded time to determine whether the recorded time has changed; and when the recorded time has changed, compare the latest real-time value with the last real-time value to determine whether the real-time value has changed.

[0067] In this embodiment, the master node and the slave node both obtain the data reported by different devices in real time through the encapsulated data operation interface. Each node has a node identifier so that the master node can check which slave node's time series database has missing data. When the node obtains the corresponding real-time data, it will mark the update time (that is, the recording time) of the real-time data (that is, the real-time value). The node will store the parsed real-time data and the corresponding recording time in the buffer zone, thereby forming buffered data. The node will traverse the buffered data in the buffer zone according to the preset time interval (such as 1min, 2min, etc.). If the record time in the buffered data is updated effectively, the buffered data will be extracted according to the key-value pair relationship of the node identifier-real-time value, and all buffered data with valid record time updates will be packaged and stored into a marked file. Within one minute, if the real-time value in the packaged buffered data does not change, the packaged buffered data will not be inserted into the node's time series database. It will only be inserted into the time series database in real time when the real-time value changes, thereby reducing the amount of data in the database.

[0068] In some embodiments of the present application, synchronizing data on the master node and / or the slave node based on the filtered data includes:

[0069] The master node obtains the filtered data from the time series database of the master node and / or the slave node according to the information of the filtered data and synchronizes the data.

[0070] In some embodiments of the present application, when the verification result indicates that the time series database of the master node is missing data, the master node obtains the filtered data from the time series database of the slave node according to the information of the filtered data and stores it in the time series database of the master node. Figure 4 As shown, taking a situation where there is a master node and two slave nodes as an example, database 1 is the time series database on the master node, and databases 2 and 3 are the time series databases on the slave nodes. After the master node determines that database 1 is missing data4, it obtains the corresponding data4 from database 2 according to the first backtracking time and the second backtracking time, and inserts the obtained data4 into the corresponding position in database 1.

[0071] When the verification result indicates that the time series database of the slave node is missing data, the master node obtains the filtered data from the time series database of the master node according to the information of the filtered data and sends it to the slave node, and the slave node stores the filtered data in the time series database of the slave node. Figure 3As shown, database 1 is the time series database on the master node, database 2 and database 3 are the time series databases on the slave nodes, and the master node determines that database 2 is missing data2. The master node sends data2 in database 1 to the corresponding slave node, so that data 2 can insert the original data into the corresponding position according to the first backtracking time and the second backtracking time corresponding to data2.

[0072] In addition, when the verification result indicates that the time series database data of the master node and the slave node are not missing, the master node sends a new status query message to the slave node.

[0073] like Figure 5 As shown, the present application also provides a data synchronization method, which includes the following steps:

[0074] S501, the master node sends a status query message to multiple slave nodes.

[0075] S502, after receiving the status query message sent by the master node, the slave node responds to the status query message and feeds back the status information of the slave node to the master node in the form of a message.

[0076] S503, after receiving the status message from the slave node, the master node verifies all slave nodes according to the information of the filtered data in the status message, and resets the cluster synchronization start flag.

[0077] S504: If the verification result shows that there is no data missing between the master node and all slave nodes, the cluster synchronization start flag is corrected and the process proceeds to step S501.

[0078] S505, if the verification result shows that the slave node has missing data, the original data (that is, the filtered data) is extracted from the time series database of the master node according to the time interval, and packaged and sent to the slave node with missing data, and then enters step S506.

[0079] S506, after receiving the original data, the slave node inserts it into the time series database of the slave node according to the time interval and adds an index mark.

[0080] S507, if the verification result shows that the master node has missing data, the master node sends a request to the slave node to obtain the original data. After receiving the request, the slave node responds to the request and extracts the corresponding original data from the local time series database according to the time interval, packages it and sends it to the master node, and then enters step S508.

[0081] S508, after receiving the original data, the master node inserts it into the time series database and adds an index mark.

[0082] In addition, it should be noted that in addition to the case where both the master node and the slave node have no valid data, the cluster synchronization start flag needs to be reset. The cluster synchronization start flag also needs to be reset when the master node changes or a new slave node comes online.

[0083] like Figure 6 As shown, the present application also provides a data synchronization device, the device comprising:

[0084] The data filtering module 601 is used for the master node and the slave node to filter the buffered data to obtain filtered data, wherein the buffered data is the data received by the master node or the slave node in real time and stored in the buffer.

[0085] The message sending module 602 is used for the slave node to send a status message to the master node when receiving the status query message from the master node, and the status message includes information of filtered data.

[0086] The verification module 603 is used for the master node to verify whether the time series database data on the master node and / or the slave node is missing according to the information of the filtered data.

[0087] The data synchronization module 604 is used to synchronize data on the master node and / or the slave node based on the filtered data when the verification result indicates that the time series database data on the master node and / or the slave node is missing.

[0088] It should be noted that the data synchronization device provided in this embodiment corresponds to the above-mentioned data synchronization method, which will not be described in detail here.

[0089] Based on any of the above embodiments, another embodiment of the present invention further provides an electronic device, which may include: a processor, a communications interface, a memory, and a communication bus, wherein the processor, the communications interface, and the memory communicate with each other via the communication bus. The processor may call logic instructions in the memory to execute the above data synchronization method.

[0090] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0091] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0092] On the other hand, an embodiment of the present invention further provides a storage medium on which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to execute the data synchronization method provided in the above embodiments.

[0093] In addition, the logic instructions in the above-mentioned storage medium can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0094] On the other hand, an embodiment of the present application further provides a computer program product, and when the program code contained in the computer program product is executed by a processor in an electronic device, the data synchronization method provided in the above embodiments is implemented.

[0095] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0097] In summary, although the present application has been disclosed as above with preferred embodiments, the above preferred embodiments are not intended to limit the present application. Ordinary technicians in this field can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined in the claims.

Claims

1. A data synchronization method, characterized in that: include: The master node and the slave node filter the buffered data to obtain filtered data, wherein the buffered data is data received by the master node or the slave node in real time and stored in a buffer; When receiving the status query message from the master node, the slave node sends a status message to the master node, wherein the status message includes information of the filtered data; The master node verifies whether the time series database data on the master node and / or the slave node is missing according to the information of the filtered data; When the verification result indicates that the time series database data on the master node and / or the slave node is missing, data synchronization is performed on the master node and / or the slave node based on the filtered data.

2. The method according to claim 1, characterized in that The master node and the slave node filter the buffered data, including: The master node and the slave node filter the buffered data within a preset time according to the preset backtracking time to obtain filtered data, and store the filtered data in their respective time series databases and generate information about the filtered data.

3. The method according to claim 2, characterized in that The backtracking time includes a first backtracking time and a second backtracking time, and the time interval between the first backtracking time and the second backtracking time is positively correlated with the amount of the filtered data.

4. The method according to claim 1, characterized in that The buffered data includes a real-time value and a recording time; the master node and the slave node filter the buffered data within a preset time, including: when the recording time and the real-time value both change, the master node and the slave node filter the buffered data within a preset time.

5. The method according to claim 1, characterized in that The step of synchronizing data on the master node and / or the slave node based on the filtered data includes: The master node obtains the filtered data from the time series database of the master node and / or the slave node according to the information of the filtered data and synchronizes the data.

6. The method according to claim 5, characterized in that When the verification result indicates that data in the time series database of the master node is missing, the master node obtains the filtered data from the time series database of the slave node according to information of the filtered data and stores the filtered data in the time series database of the master node; When the verification result indicates that data in the time series database of the slave node is missing, the master node obtains the filtered data from the time series database of the master node according to the information of the filtered data and sends it to the slave node, and the slave node stores the filtered data in the time series database of the slave node.

7. The method according to claim 4, characterized in that The recording time includes the latest recording time and the last recording time, and the real-time value includes the latest real-time value and the last real-time value; The master node and the slave node compare the latest recorded time with the last recorded time to determine whether the recorded time has changed; and when the recorded time has changed, compare the latest real-time value with the last real-time value to determine whether the real-time value has changed.

8. The method according to claim 1, characterized in that When the verification result indicates that the time series database data of the master node and the slave node are not missing, the master node sends a new status query message to the slave node.

9. A data synchronization device, characterized in that: include: A data filtering module, used for the master node and the slave node to filter the buffered data to obtain filtered data, wherein the buffered data is data received by the master node or the slave node in real time and stored in a buffer; A message sending module, used for the slave node to send a status message to the master node when receiving a status query message from the master node, wherein the status message includes information of the filtered data; A verification module, used by the master node to verify whether the time series database data on the master node and / or the slave node is missing according to the information of the filtered data; The data synchronization module is used to synchronize the data of the master node and / or the slave node based on the filtered data when the verification result indicates that the time series database data on the master node and / or the slave node is missing.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.