A data differential synchronization method, device, system and master node device
By creating an external data table with inheritance relationship and a slave data table of a slave node device on the master node device, and establishing a mapping relationship, differentiated data synchronization between databases is achieved, and the problems of high synchronization complexity and low efficiency in the existing technology are solved.
Patent Information
- Application Number
- CN202111194565.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-13
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2041-10-13
AI Technical Summary
In the prior art, data differentiation synchronization has high complexity and low efficiency, making it difficult to effectively realize differentiated data synchronization between databases.
Create multiple external data tables with inheritance relationships with the master data table on the master node device, and correspond to the slave data tables of the slave node device one by one to establish a mapping relationship. When new data is inserted into the main data table, the data is distributed to the corresponding external data table according to the preset data distribution rules, and synchronizes to the corresponding slave data table according to the mapping relationship.
Differentiated data synchronization between databases is realized, synchronization complexity and development costs are reduced, and synchronization efficiency is improved.
Smart Images

Figure CN113961642B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database technology in computer technology, and in particular to a data differential synchronization method, device, system and master node equipment. Background Art
[0002] In actual database applications, it is often necessary to synchronize the data in the database, which can be master-master synchronization or master-slave synchronization. At present, the data synchronization of some databases is consistency synchronization. For example, in some solutions of master-slave synchronization and master-master synchronization, whether it is self-owned log replication, stream synchronization replication, or third-party product Bucardo and other synchronization tools, only the consistency synchronization of multiple databases is achieved. In order to achieve differential synchronization, other methods can only be used to indirectly achieve differential synchronization of databases.
[0003] The currently available differential synchronization method is the ETL (Extract Transform and Load) method: periodically synchronizing the differential data of database A to database B based on timestamps. The disadvantage of this method is that there will be a certain data delay according to the setting of the extraction cycle, and a set of ETL programs needs to be developed. Depending on the degree of replication of the differences, the development cost is high.
[0004] You can also use the AB database simultaneous writing method: develop in the data collection stage, and write data to the database of multiple nodes at the same time. The disadvantage of this method is that the workload of data collection development is large, when data writing is abnormal, it is not easy to locate the problem of data writing abnormality, and the efficiency of writing data to multiple nodes at the same time is low.
[0005] You can also develop middleware based on listening to pre-write logs or listening to additions, deletions, and modifications: this method is the most complex, has a high development cost, and differentiated data is not easy to filter and control.
[0006] In summary, currently known data differentiation synchronization solutions generally have the problems of high implementation complexity and low efficiency. Summary of the invention
[0007] In view of this, embodiments of the present invention provide a data differential synchronization method, apparatus, system and master node device to solve the problems of high complexity and low efficiency of data differential synchronization in the prior art.
[0008] In a first aspect, an embodiment of the present invention provides a data differentiation synchronization method, characterized in that it is applied to a master node device, the master node device has a master data table, the master node device is connected to multiple slave node devices, each slave node device has a slave data table with the same structure as the master data table, the master node device also has multiple external data tables, and there is an inheritance relationship between each external data table and the master data table, the multiple external data tables correspond to the multiple slave node devices one by one, and there is a mapping relationship between each external data table and the slave data table of the corresponding slave node device, the method includes:
[0009] When new data is inserted into the main data table, the new data is distributed to the external data table that meets the data distribution rule according to the preset data distribution rule, and the external data table to which the new data is distributed is used as the external data table to be synchronized;
[0010] According to the mapping relationship, the new data in the external data table to be synchronized is synchronized to the slave data table that has a mapping relationship with the external data table to be synchronized.
[0011] According to a specific implementation of an embodiment of the present invention, before distributing the new data to an external data table that satisfies the data distribution rule according to the preset data distribution rule, the method further includes:
[0012] Based on the creation information input by the user, create the master data table in the PostgreSQL database of the master node device;
[0013] Based on the number of the plurality of slave node devices connected to the master node device, creating, in a PostgreSQL database of the master node device, a plurality of external data tables having an inheritance relationship with the master data table in the same number;
[0014] For each external data table, a mapping relationship between the external data table and the slave data table of the corresponding slave node device is established.
[0015] According to a specific implementation of an embodiment of the present invention, distributing the new data to an external data table that satisfies the data distribution rule according to a preset data distribution rule includes:
[0016] Obtaining the time period to which the generation time of the new data belongs;
[0017] According to the preset data distribution rules, determine the external data table corresponding to the time period;
[0018] The new data is distributed to the external data table corresponding to the time period.
[0019] According to a specific implementation of an embodiment of the present invention, distributing the new data to an external data table that satisfies the data distribution rule according to a preset data distribution rule includes:
[0020] Acquire attribute information of the new data;
[0021] According to the preset data distribution rules, determine the external data table corresponding to the attribute information;
[0022] The new data is distributed to the external data table corresponding to the attribute information.
[0023] In a second aspect, an embodiment of the present application further provides a data differentiation synchronization device, which is applied to a master node device, wherein the master node device has a master data table, the master node device is connected to a plurality of slave node devices, each of the slave node devices has a slave data table with the same structure as the master data table, the master node device also has a plurality of external data tables, and there is an inheritance relationship between each external data table and the master data table, the plurality of external data tables correspond one-to-one to the plurality of slave node devices, and there is a mapping relationship between each external data table and the slave data table of the corresponding slave node device, the device comprises:
[0024] A data distribution module is used to distribute the new data to an external data table that meets the data distribution rule when new data is inserted into the main data table, and the external data table to which the new data is distributed is used as the external data table to be synchronized;
[0025] The data synchronization module is used to synchronize the new data in the external data table to be synchronized to the slave data table that has a mapping relationship with the external data table to be synchronized according to the mapping relationship.
[0026] A specific implementation method according to an embodiment of the present invention further includes:
[0027] A data table creation module is used to create the master data table in the PostgreSQL database of the master node device based on the creation information input by the user; based on the number of multiple slave node devices connected to the master node device, create multiple external data tables of the same number that have an inheritance relationship with the master data table in the PostgreSQL database of the master node device; for each external data table, establish a mapping relationship between the external data table and the slave data table of the corresponding slave node device.
[0028] According to a specific implementation method of an embodiment of the present invention, the data distribution module is specifically used to obtain the time period to which the generation time of the new data belongs; determine the external data table corresponding to the time period according to a preset data distribution rule; and distribute the new data to the external data table corresponding to the time period.
[0029] According to a specific implementation method of an embodiment of the present invention, the data distribution module is specifically used to obtain attribute information of the new data; determine the external data table corresponding to the attribute information according to a preset data distribution rule; and distribute the new data to the external data table corresponding to the attribute information.
[0030] On the third aspect, an embodiment of the present application also provides a master node device, comprising: a shell, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit is used to supply power to each circuit or device of the above-mentioned master node device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute any of the above-mentioned data differentiation synchronization methods.
[0031] In a fourth aspect, an embodiment of the present application also provides a data differentiation synchronization system, comprising: the above-mentioned master node device and multiple slave node devices.
[0032] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement any of the above-mentioned data differential synchronization methods.
[0033] In a sixth aspect, an embodiment of the present invention further provides an application program, which is executed to implement the method described in any embodiment of the present invention.
[0034] In the solution provided by the embodiment of the present invention, multiple external data tables having an inheritance relationship with the main data table are created on the main node device, and for each external data table, there is a mapping relationship between the external data table and the slave data table of the corresponding slave node device, and a data distribution rule is preset, so that when new data is inserted into the main data table, the new data can be distributed to the external data table that meets the data distribution rule according to the preset data distribution rule, and then the new data in the external data table can be synchronized to the slave data table that has a mapping relationship with the external data table according to the mapping relationship, while other external data tables that do not meet the data distribution rule will not be distributed with the new data, and the new data will not be synchronized to the slave data table that has a mapping relationship with other external data tables, that is, differentiated synchronization of data is achieved, and it is based on the inheritance and mapping relationship between the data tables of the database itself, so the implementation complexity is lower and the efficiency is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A flowchart of a data differential synchronization method provided by an embodiment of the present invention;
[0037] Figure 2 A flowchart of a data differential synchronization method provided by another embodiment of the present invention;
[0038] Figure 3 A schematic diagram of a data differential synchronization method provided by an embodiment of the present invention;
[0039] Figure 4 A schematic diagram of the structure of a data differential synchronization device provided by an embodiment of the present invention;
[0040] Figure 5 A schematic diagram of the structure of a data differential synchronization device provided by another embodiment of the present invention;
[0041] Figure 6 A schematic diagram of the structure of a master node device provided by an embodiment of the present invention;
[0042] Figure 7 A schematic diagram of the structure of a data differential synchronization system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. It should be clear that the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] This embodiment provides a data differentiation synchronization method, which is applied to a master node device. The master node device has a master data table. The master node device is connected to multiple slave node devices. Each slave node device has a slave data table with the same structure as the master data table. The master node device also has multiple external data tables, and there is an inheritance relationship between each external data table and the master data table. The multiple external data tables correspond to the multiple slave node devices one by one, and there is a mapping relationship between each external data table and the slave data table of the corresponding slave node device, such as Figure 1 As shown, the method includes:
[0045] Step 11: When new data is inserted into the main data table, the new data is distributed to the external data table that meets the data distribution rule according to the preset data distribution rule, and the external data table to which the new data is distributed is used as the external data table to be synchronized.
[0046] Step 12: According to the mapping relationship, synchronize the new data in the external data table to be synchronized to the slave data table that has a mapping relationship with the external data table to be synchronized.
[0047] The above-mentioned embodiment provided by the present application Figure 1 The data differential synchronization method shown, creates multiple external data tables with inheritance relationship with the main data table on the master node device, and for each external data table, there is a mapping relationship between the external data table and the corresponding slave data table of the slave node device, and a data distribution rule is preset, so that when new data is inserted into the main data table, the new data can be distributed to the external data table that meets the data distribution rule according to the preset data distribution rule, and then the new data in the external data table can be synchronized to the slave data table with a mapping relationship with the external data table according to the mapping relationship, while other external data tables that do not meet the data distribution rule will not be distributed with the new data, and the new data will not be synchronized to the slave data table with a mapping relationship with other external data tables, that is, the differential synchronization of data is realized. In addition, the method is implemented based on the inheritance and mapping relationship between the data tables of the database itself, and the implementation complexity is lower and the efficiency is higher.
[0048] In the embodiment of the present application, it can be implemented based on a PostgreSQL database. The PostgreSQL database has powerful extended functions, such as table inheritance and mapping. Based on these extended functions, the method provided in the embodiment of the present application can be implemented, which is described in detail below.
[0049] The present application also provides a method for data differentiation synchronization. Figure 2 As shown, the following steps may be included:
[0050] Step 21: Based on the creation information input by the user, a master data table is created in the PostgreSQL database of the master node device.
[0051] In an embodiment of the present application, an interface for creating a data table can be displayed to the user. The interface may include some options and text input boxes for creating the data table, for the user to input creation information by selecting and entering text content, and based on the creation information input by the user, a main data table is created in the PostgreSQL database of the main node device. The creation information input by the user can be input based on actual needs.
[0052] like Figure 3 As shown in the figure, a master data table named table_sync is created on the master node device.
[0053] Step 22: Based on the number of the multiple slave node devices connected to the master node device, create the same number of multiple external data tables that have an inheritance relationship with the master data table in the PostgreSQL database of the master node device.
[0054] like Figure 3 As shown, taking three slave node devices as an example, in the PostgreSQL database of the master node device, three external data tables that have an inheritance relationship with the main data table are created, namely external data table 1 named foreign_table_sync1, external data table 2 named foreign_table_sync2, and external data table 3 named foreign_table_sync3.
[0055] Furthermore, there is a one-to-one correspondence between the three external data tables and the three slave node devices. For example, Figure 3 As shown, external data table 1 corresponds to slave node device 1, external data table 2 corresponds to slave node device 2, and external data table 3 corresponds to slave node device 3.
[0056] Step 23: For each external data table, a mapping relationship between the external data table and the slave data table of the corresponding slave node device is established.
[0057] like Figure 3 As shown, a slave data table is created on each of the three slave node devices, and the structure of the slave data table is the same as that of the master data table, namely, slave data table 1, slave data table 2 and slave data table 3. In order to facilitate the use of the slave data table by each slave node device, the name of each slave data table can be the same as the name of the master data table, which is table_sync. In this way, the software code for using the master data table running on the master node device can be directly copied to the slave node device, so that the software code can directly use the slave data table without the need to improve the software code.
[0058] In this step, if Figure 3 As shown, a mapping relationship between external data table 1 and slave data table 1, a mapping relationship between external data table 2 and slave data table 2, and a mapping relationship between external data table 3 and slave data table 3 are established respectively.
[0059] Step 24: When new data is inserted into the main data table, an external data table that satisfies the data distribution rule is determined according to the preset data distribution rule.
[0060] In the embodiment of the present application, the preset data distribution rules can be flexibly set based on the needs of each slave node device for actual application of the data in the data table.
[0061] For example, the data distribution rule may be set based on the time period to which the data generation time belongs. Accordingly, in this step, the time period to which the new data generation time belongs may be obtained, and the external data table corresponding to the time period may be determined according to the preset data distribution rule.
[0062] For another example, data distribution rules may be set based on the attribute information of the data. Accordingly, in this step, the attribute information of the new data may be obtained, and the external data table corresponding to the attribute information may be determined according to the preset data distribution rules.
[0063] Step 25: Distribute the new data to the corresponding external data table, and the external data table to which the new data is distributed serves as the external data table to be synchronized.
[0064] Since the external data table inherits from the main data table, the new data can be distributed to the corresponding external data table according to the inheritance relationship.
[0065] Step 26: According to the mapping relationship, synchronize the new data in the external data table to be synchronized to the slave data table that has a mapping relationship with the external data table to be synchronized.
[0066] In the embodiment of the present application, the structure of the slave data table is the same as that of the master data table, so that data synchronization can be achieved according to the mapping relationship.
[0067] As for other slave data tables, since the new data is not distributed in the corresponding external data tables, the new data will not be synchronized either, thereby achieving differentiated synchronization of data between the slave data table and other slave data tables.
[0068] In the embodiment of the present application, by utilizing the powerful extension function of the PostgreSQL database, an external table extension can be installed on the PostgreSQL database, and the "external table inheritance + rules" method can be used to achieve data differential synchronization, and without the help of a third party, it can have higher reliability and security; data differential synchronization can be achieved by simply creating table inheritance and rules, with low cost, low complexity, and higher efficiency.
[0069] Based on the same inventive concept, according to the above-mentioned data differentiation synchronization method provided by an embodiment of the present invention, an embodiment of the present invention also provides a data differentiation synchronization device, which is applied to a master node device, the master node device has a master data table, the master node device is connected to multiple slave node devices, each slave node device has a slave data table with the same structure as the master data table, the master node device also has multiple external data tables, and there is an inheritance relationship between each external data table and the master data table, the multiple external data tables correspond one-to-one to the multiple slave node devices, and there is a mapping relationship between each external data table and the slave data table of the corresponding slave node device, such as Figure 4 As shown, including:
[0070] The data distribution module 41 is used to distribute the new data to the external data table that meets the data distribution rule according to the preset data distribution rule when new data is inserted into the main data table, and the external data table to which the new data is distributed is used as the external data table to be synchronized;
[0071] The data synchronization module 42 is used to synchronize the new data in the external data table to be synchronized to the slave data table that has a mapping relationship with the external data table to be synchronized according to the mapping relationship.
[0072] According to a specific implementation of the embodiment of the present invention, Figure 5 As shown, it also includes:
[0073] The data table creation module 43 is used to create a master data table in the PostgreSQL database of the master node device based on the creation information input by the user; based on the number of multiple slave node devices connected to the master node device, create multiple external data tables of the same number that have an inheritance relationship with the master data table in the PostgreSQL database of the master node device; for each external data table, establish a mapping relationship between the external data table and the slave data table of the corresponding slave node device.
[0074] According to a specific implementation method of an embodiment of the present invention, the data distribution module 41 is specifically used to obtain the time period to which the new data is generated; determine the external data table corresponding to the time period according to a preset data distribution rule; and distribute the new data to the external data table corresponding to the time period.
[0075] According to a specific implementation method of an embodiment of the present invention, the data distribution module 41 is specifically used to obtain attribute information of new data; determine the external data table corresponding to the attribute information according to a preset data distribution rule; and distribute the new data to the external data table corresponding to the attribute information.
[0076] The device of this embodiment can be used to perform Figure 1 and Figure 2 The technical solution of the method embodiment shown has similar implementation principles and technical effects, which will not be repeated here.
[0077] The present application also provides a master node device, such as Figure 6 As shown, the present invention can be implemented Figure 1 and Figure 2 The process of the embodiment shown is as follows: Figure 6 As shown, the above-mentioned master node device may include: a shell 61, a processor 62, a memory 63, a circuit board 64 and a power supply circuit 65, wherein the circuit board 64 is arranged inside the space enclosed by the shell 61, and the processor 62 and the memory 63 are arranged on the circuit board 64; the power supply circuit 65 is used to supply power to various circuits or devices of the above-mentioned master node device; the memory 63 is used to store executable program codes; the processor 62 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 63, so as to execute the data differentiation synchronization method described in any of the above-mentioned embodiments.
[0078] For details on the specific execution process of the above steps by the processor 62 and the steps further executed by the processor 62 by running the executable program code, please refer to the present invention. Figure 1 and Figure 2 The description of the illustrated embodiment will not be repeated here.
[0079] The master node device exists in various forms, including but not limited to:
[0080] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0081] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0082] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0083] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0084] (5) Other master node devices with data interaction functions.
[0085] In a fourth aspect, the present application also provides a data differentiation synchronization system, such as Figure 7 As shown, it includes: any one of the above-mentioned master node devices 71 and multiple slave node devices 72.
[0086] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement any of the above-mentioned data differential synchronization methods.
[0087] In a sixth aspect, an embodiment of the present invention further provides an application, which is executed to implement the method provided by any embodiment of the present invention.
[0088] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0089] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0090] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0091] For the convenience of description, the above device is described by dividing the functions into various units / modules. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.
[0092] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0093] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A data differential synchronization method, characterized in that: Applied to a master node device, the master node device has a master data table, the master node device is connected to a plurality of slave node devices, each slave node device has a slave data table with the same structure as the master data table, the master node device also has a plurality of external data tables, and there is an inheritance relationship between each external data table and the master data table, the plurality of external data tables correspond to the plurality of slave node devices one by one, and there is a mapping relationship between each external data table and the slave data table of the corresponding slave node device, the method comprises: When new data is inserted into the main data table, the new data is distributed to the external data table that meets the data distribution rule according to the preset data distribution rule, and the external data table to which the new data is distributed is used as the external data table to be synchronized; According to the mapping relationship, synchronizing the new data in the external data table to be synchronized to the slave data table that has a mapping relationship with the external data table to be synchronized; Before distributing the new data to the external data table satisfying the data distribution rule according to the preset data distribution rule, the method further includes: Based on the creation information input by the user, create the master data table in the PostgreSQL database of the master node device; Based on the number of the plurality of slave node devices connected to the master node device, creating, in a PostgreSQL database of the master node device, a plurality of external data tables having an inheritance relationship with the master data table in the same number; For each external data table, a mapping relationship between the external data table and the slave data table of the corresponding slave node device is established.
2. The data differential synchronization method according to claim 1, characterized in that: The step of distributing the new data to an external data table that satisfies the data distribution rule according to a preset data distribution rule includes: Obtaining the time period to which the generation time of the new data belongs; According to the preset data distribution rules, determine the external data table corresponding to the time period; The new data is distributed to the external data table corresponding to the time period.
3. The data differential synchronization method according to claim 1, characterized in that: The step of distributing the new data to an external data table that satisfies the data distribution rule according to a preset data distribution rule includes: Acquire attribute information of the new data; According to the preset data distribution rules, determine the external data table corresponding to the attribute information; The new data is distributed to the external data table corresponding to the attribute information.
4. A data differentiation synchronization device, characterized in that: Applied to a master node device, the master node device has a master data table, the master node device is connected to a plurality of slave node devices, each slave node device has a slave data table with the same structure as the master data table, the master node device also has a plurality of external data tables, and there is an inheritance relationship between each external data table and the master data table, the plurality of external data tables correspond to the plurality of slave node devices one by one, and there is a mapping relationship between each external data table and the slave data table of the corresponding slave node device, the device comprises: A data distribution module is used to distribute the new data to an external data table that meets the data distribution rule when new data is inserted into the main data table, and the external data table to which the new data is distributed is used as the external data table to be synchronized; A data synchronization module, configured to synchronize the new data in the external data table to be synchronized to a slave data table that has a mapping relationship with the external data table to be synchronized according to the mapping relationship; Also includes: A data table creation module is used to create the master data table in the PostgreSQL database of the master node device based on the creation information input by the user; based on the number of multiple slave node devices connected to the master node device, create multiple external data tables of the same number that have an inheritance relationship with the master data table in the PostgreSQL database of the master node device; for each external data table, establish a mapping relationship between the external data table and the slave data table of the corresponding slave node device.
5. The data differential synchronization device according to claim 4, characterized in that: The data distribution module is specifically used to obtain the time period to which the new data is generated; determine the external data table corresponding to the time period according to the preset data distribution rule; and distribute the new data to the external data table corresponding to the time period.
6. The data differential synchronization device according to claim 4, characterized in that: The data distribution module is specifically used to obtain the attribute information of the new data; determine the external data table corresponding to the attribute information according to the preset data distribution rule; and distribute the new data to the external data table corresponding to the attribute information.
7. A master node device, characterized in that: The master node device includes: a shell, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned master node device; the memory is used to store executable program code; the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method described in any of the preceding claims 1-3.
8. A data differentiation synchronization system, characterized in that: include: A master node device as described in claim 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method of any one of claims 1 to 3.
Citation Information
Patent Citations
Management method and system of distributed databases
CN102831223A
Data searching method and device
CN103488778A