Data synchronization configuration method and device, computer equipment and medium
By introducing a tree structure option interface in the data synchronization configuration, users can select the data to be synchronized and determine the synchronization method by themselves to generate synchronization configuration content, solving the problems of small application scope and high error rate in the existing technology, and achieving more efficient and automated data synchronization configuration.
Patent Information
- Application Number
- CN202311460923.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-02
- Publication Date
- 2025-05-06
AI Technical Summary
The existing data synchronization configuration solution has a small scope of application and requires manual configuration by professional database operation and maintenance personnel, with a high probability of errors and a long development cycle.
Provide a configuration method for data synchronization. Through the interface of displaying tree structure options, users can select data to be synchronized, determine the target data node and synchronization method, generate synchronization configuration content, and generate mapping configuration content based on mapping statements, ultimately realizing data synchronization from the data source to the target database.
It reduces the probability of errors in configuration content, improves the degree of automation of data synchronization configuration, shortens the configuration cycle, and provides users with a wider range of data synchronization configuration solutions.
Smart Images

Figure CN119938633A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of computer equipment, and in particular, relates to a data synchronization configuration method, a data synchronization configuration device, a computer equipment and a computer-readable storage medium. Background Art
[0002] With the development of Internet technology and the increasing demand of consumers for online shopping, the demand for data storage on major e-commerce platforms is also increasing. At present, both e-commerce platforms and merchants stationed on e-commerce platforms can store online data in their deployed databases, so as to build consumer portraits through big data models and provide data references for product development and marketing strategies. It can be seen that online data is a very important e-commerce resource. In order to avoid the data stored in the database from being destroyed, the data in the data source can be synchronized to the backup database by deploying a backup database, that is, synchronized to the target database for storage.
[0003] However, when implementing data synchronization, professional database operation and maintenance personnel are required to manually configure the data synchronization configuration content using complex interface calls, or use dedicated data synchronization tools to manually synchronize data. For some data synchronization tasks with more complex data relationships, it is necessary to completely rely on the configuration capabilities of the operation and maintenance personnel, which not only has a high probability of error, but also a long development cycle. It can be seen that the existing data synchronization configuration solution has the problem of a small scope of application. Summary of the invention
[0004] In view of this, embodiments of the present application provide a data synchronization configuration method, a data synchronization configuration device, a computer device, and a computer-readable storage medium to solve the problem that existing data synchronization configuration solutions have a small scope of application.
[0005] A first aspect of an embodiment of the present application provides a method for configuring data synchronization, including:
[0006] Displaying a first interface for the user to select data to be synchronized; the first interface includes tree structure options corresponding to the data structure of the data source; the tree structure options include virtual nodes that aggregate data nodes with the same hierarchical attributes;
[0007] In response to a node selection operation triggered by a user in the first interface, a selection result corresponding to the node selection operation is displayed in the first interface, and based on the selection result, a target data node to be operated and a target synchronization mode are determined; the selection result includes a first node designated to perform data synchronization and a second node designated to be prohibited from synchronizing data among the data nodes; the target synchronization mode includes a preset whitelist synchronization mode or a preset blacklist synchronization mode;
[0008] Generate synchronization configuration content with the target data node according to the target synchronization mode; the synchronization configuration content is used to describe the data content synchronized from the data source to the target database;
[0009] In response to a node mapping configuration operation triggered by a user in the first interface, a mapping configuration interface is displayed; the mapping configuration interface is used to input a mapping statement of the first node;
[0010] Generate mapping configuration content according to the mapping statement;
[0011] The target configuration content is generated by using the synchronization configuration content and the mapping configuration content; the target configuration content is used to synchronize the data content in the data source to the target database.
[0012] A second aspect of an embodiment of the present application provides a data synchronization configuration device, including:
[0013] A first display unit is used to display a first interface for users to select data to be synchronized; the first interface includes tree structure options corresponding to the data structure of the data source; the tree structure options include virtual nodes that aggregate data nodes with the same hierarchical attributes;
[0014] a second display unit, for responding to a node selection operation triggered by a user in the first interface, displaying a selection result corresponding to the node selection operation in the first interface, and determining a target data node to be operated and a target synchronization mode based on the selection result; the selection result includes a first node designated to perform data synchronization among the data nodes, and a second node designated to be prohibited from synchronizing data; the target synchronization mode includes a preset whitelist synchronization mode or a preset blacklist synchronization mode;
[0015] A first configuration content unit is used to generate synchronization configuration content with the target data node according to the target synchronization mode; the synchronization configuration content is used to describe the data content synchronized from the data source to the target database;
[0016] A third display unit, configured to display a mapping configuration interface in response to a node mapping configuration operation triggered by a user in the first interface; the mapping configuration interface is used to input a mapping statement of the first node;
[0017] A second configuration content unit, used to generate mapping configuration content according to the mapping statement;
[0018] The third configuration content unit is used to generate target configuration content by using the synchronization configuration content and the mapping configuration content; the target configuration content is used to synchronize the data content in the data source to the target database.
[0019] A third aspect of an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the computer device, wherein the processor implements the steps of the data synchronization configuration method provided in the first aspect when executing the computer program.
[0020] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data synchronization configuration method provided in the first aspect are implemented.
[0021] The implementation of a data synchronization configuration method, a data synchronization configuration device, a computer device, and a computer-readable storage medium provided in the embodiments of the present application has the following beneficial effects:
[0022] A data synchronization configuration method provided in an embodiment of the present application displays a first interface for users to select data to be synchronized. Since the first interface includes a tree structure option corresponding to the data structure of the data source, and the tree structure option includes a virtual node that summarizes data nodes with the same hierarchical attributes, the user can perform node selection operations and node mapping statements on the virtual nodes and data nodes in the tree structure option through the first interface, thereby determining the data content, target synchronization method, and mapping relationship that need to be synchronized in the data source. Generate synchronization configuration content according to the target synchronization method and the target data node, and the synchronization configuration content describes the data content synchronized from the data source to the target database. Generate mapping configuration content according to the mapping statement, and finally generate target configuration content using the synchronization configuration content and the mapping configuration content, and use the target configuration content to synchronize the data content from the data source to the target database. The above scheme provides a way for users to generate synchronization configuration content by interacting with the first interface. Because the tree structure options in the first interface correspond to the data structure of the data source, users can perform node selection operations and mapping configuration operations on the tree structure options in the first interface, and determine the target data nodes and target synchronization methods that need to be operated for data synchronization according to the selection results. Then, according to the target synchronization method and the target data nodes, synchronization configuration content is generated, and mapping configuration content is generated according to the mapping statement corresponding to the mapping configuration operation. Finally, the synchronization configuration content and the mapping configuration content are used to generate the target configuration content, and the target configuration content is used to synchronize the data content from the data source to the target database, thereby reducing the error probability of the configuration content, improving the degree of automation of the data synchronization configuration, effectively shortening the configuration cycle, and providing users with a data synchronization configuration scheme with a wider range of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0024] Figure 1 It is a flow chart of an implementation method of a data synchronization configuration method provided in an embodiment of the present application;
[0025] Figure 2 It is a schematic diagram of the corresponding relationship between the data structure and the tree structure options in the embodiment of the present application;
[0026] Figure 3 is a flowchart of a data synchronization configuration method provided by another embodiment of the present application;
[0027] Figure 4 is a flowchart of a data synchronization configuration method provided in yet another embodiment of the present application;
[0028] Figure 5 This is a schematic diagram of an implementation method of the second interface in the embodiment of the present application;
[0029] Figure 6 is a flowchart of a data synchronization configuration method provided by another embodiment of the present application;
[0030] Figure 7 This is a schematic diagram of an implementation method of the third interface in the embodiment of the present application;
[0031] Figure 8 It is a structural block diagram of a data synchronization configuration device provided in an embodiment of the present application;
[0032] Fig. 9 It is a structural block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0034] The present embodiment provides a data synchronization configuration method, the execution subject is a computer device, specifically a computer device that can access the data source and the target database. The data source computer device can interact with the data source and the target database or configure tasks through a web page. Alternatively, the computer device can interact with the data source and the target database or configure tasks through a client.
[0035] In actual applications, in order to meet the needs of diversified data storage and data empowerment, the data source can usually transfer or back up the data stored in the data source, or even perform data analysis and other operations. In order to meet the data synchronization needs between databases, when implementing data synchronization, professional database operation and maintenance personnel are currently required to manually configure the data synchronization configuration content using complex interface calls, or use dedicated data synchronization tools to manually synchronize data. For some data synchronization tasks with more complex data relationships, it is necessary to completely rely on the configuration content configuration capabilities of the operation and maintenance personnel, which not only has a high probability of error, but also a long development cycle. It can be seen that the existing data synchronization configuration scheme has the problems of high configuration difficulty and small scope of application.
[0036] Based on this, the present embodiment provides a data synchronization configuration method, which displays a first interface for users to select data to be synchronized. Since the first interface includes a tree structure option corresponding to the data structure of the data source, and the tree structure option includes a virtual node that aggregates data nodes with the same hierarchical attributes, the user can perform node selection operations and node mapping statements on the virtual nodes and data nodes in the tree structure option through the first interface, and then determine the data content, target synchronization method and mapping relationship that need to be synchronized in the data source. According to the target synchronization method and the target data node, the synchronization configuration content is generated, and the synchronization configuration content describes the data content synchronized from the data source to the target database. The mapping configuration content is generated according to the mapping statement, and finally the target configuration content is generated using the synchronization configuration content and the mapping configuration content, and the target configuration content is used to synchronize the data content from the data source to the target database. The above scheme provides a way for users to generate synchronization configuration content by interacting with the first interface. Because the tree structure options in the first interface correspond to the data structure of the data source, users can perform node selection operations and mapping configuration operations on the tree structure options in the first interface, and determine the target data nodes and target synchronization methods that need to be operated for data synchronization according to the selection results. Then, according to the target synchronization method and the target data nodes, synchronization configuration content is generated, and mapping configuration content is generated according to the mapping statement corresponding to the mapping configuration operation. Finally, the synchronization configuration content and the mapping configuration content are used to generate the target configuration content, and the target configuration content is used to synchronize the data content from the data source to the target database, thereby reducing the error probability of the configuration content, improving the degree of automation of the data synchronization configuration, effectively shortening the configuration cycle, and providing users with a data synchronization configuration scheme with a wider range of applications.
[0037] A data synchronization configuration method provided by this embodiment is described in detail below through a specific implementation.
[0038] Figure 1 A flowchart of an implementation of a data synchronization configuration method provided in an embodiment of the present application is shown.
[0039] like Figure 1 As shown, the configuration method of data synchronization includes the following steps:
[0040] 110: Displaying a first interface for the user to select data to be synchronized.
[0041] In 110, the first interface includes a tree structure option corresponding to the data structure of the data source. The tree structure option includes a virtual node that aggregates data nodes with the same hierarchical attributes. Here, the data structure of the source data refers to the hierarchical structure or hierarchical relationship of the data stored in the data source. Since the tree structure option corresponds to the data structure, it can be understood that the tree structure option can be regarded as a presentation result obtained by visualizing or imaging the data structure.
[0042] In this embodiment, the virtual nodes in the tree structure option can be used to represent the layers in the data structure, and the data at the same level in the data source can be mapped to the data nodes under the same virtual node. That is, the data node can generally refer to the nodes under each virtual node, and has a one-to-one correspondence with the data in the data source.
[0043] In the specific implementation, the tree structure option can be constructed according to the data level information of the data source stored locally in the computer device, or the tree structure option has been constructed locally in the computer device, and the first interface can be directly rendered. Here, the data at the same level in the data source can be regarded as a data set with commonality. After being summarized by the virtual node in the tree structure option, the corresponding data nodes are arranged under the virtual node, and the data nodes correspond to the data content in the data set one by one. Among them, the data nodes under the virtual node can be named the same as the file name or table name of the data.
[0044] Figure 2 FIG. 1 is a schematic diagram showing the corresponding relationship between the data structure and the tree structure options in the embodiment of the present application. Figure 2 As shown in the figure, the general hierarchical structure in the database may include "instance", "database", and "table". As for the data content in an instance, the data structure may include two layers of "database" and "table". Among them, the "database" corresponds to the virtual node "DATABASES" in the tree structure option, and the "table" corresponds to the virtual node "TABLES" in the tree structure option.
[0045] exist Figure 2 In the example, data nodes with the same hierarchical attributes are processed and summarized under a virtual node, and other virtual nodes can also be summarized in the data node. For example, if the virtual node DATABASES includes a configuration node rw_map, the configuration node rw_map can also include a virtual node TABLES. Data nodes 10 with the same hierarchical attributes are also summarized under the virtual node TABLES.
[0046] It is easy to understand that Figure 2The diagram of the correspondence between the data structure and the tree structure options shown is only used to illustrate the hierarchical correspondence between the data structure of the data source and the tree structure options. Figure 2 In the tree structure option part. In a specific implementation, the computer device can access the server where the data source is located through a web page or a client, and then obtain the data structure of the data source. The computer device can configure a corresponding tree structure mapping strategy, follow the tree structure mapping strategy, and generate corresponding tree structure options according to the data structure.
[0047] In this embodiment, the computer device allows the user to select data to be synchronized through the first interface. The data to be synchronized refers to the data selected by the user to be synchronized from the data source to the target database. It is easy to understand that since the data structure of the data source corresponds to the tree structure option in the first interface, the user can select the nodes in the tree structure option to determine the data to be synchronized from the data source to the target database, that is, determine the data to be synchronized.
[0048] 120: In response to a node selection operation triggered by the user in the first interface, a selection result corresponding to the node selection operation is displayed in the first interface, and based on the selection result, a target data node to be operated and a target synchronization mode are determined.
[0049] In step 120, the node selection operation refers to the selection operation performed by the user on the virtual nodes and data nodes in the tree structure options in the first interface. Here, the selection operation may include a selection operation and / or a non-selection operation on the virtual node or the data node, or include a forward selection operation and a direction selection operation on the virtual node or the data node. The target data node refers to the data node declared in the synchronization configuration content during the data synchronization operation. The target synchronization mode refers to the synchronization rule described by the synchronization configuration content during the data synchronization operation.
[0050] In this embodiment, the selection result may include a positive data node selection result, and may also include a negative data node selection result. For example, the positive data node selection result may be that the user selects which data nodes' corresponding data contents to perform data synchronization by triggering a node selection operation. The negative data node selection result may be that the user selects which data nodes' corresponding data contents to prohibit data synchronization by triggering a node selection operation. Accordingly, the target data node may specifically refer to a node of data to be synchronized declared in the synchronization configuration content, or may refer to a node of data to be prohibited from synchronization declared in the synchronization configuration content. Accordingly, the target synchronization method may specifically be a synchronization rule described in the synchronization configuration content for nodes of data to be synchronized or nodes of data to be prohibited from synchronization, that is, an operation method for nodes of data to be synchronized or nodes of data to be prohibited from synchronization. In specific implementation, the user may click on the virtual nodes and data nodes in the first interface to trigger the node selection operation.
[0051] As an embodiment, a check control corresponding to each node may also be displayed in the first interface for the user to perform a node selection operation.
[0052] by Figure 2 Take the corresponding relationship between the data structure and the tree structure options shown in the figure as an example. Figure 2 In the tree structure options shown, each virtual node and each data node under the virtual node has a corresponding control for the user to select and configure, such as a check control.
[0053] In other embodiments, for each virtual node and each data node, in addition to being configured with a check control, controls for the user to select for configuration may also be configured, such as a rename control.
[0054] Combining the previous example, Figure 2 In the example, the checkbox control can be an element control in the shape of "□". When the user selects a node, the element control in the shape of "□" can be selected or positively selected, and then "√" is displayed in the element control in the shape of "□", indicating that the virtual node or data node has been selected or selected, that is, the data content of the virtual node or data node is selected as the data to be synchronized. Similarly, the user can also unselect or negatively select a node, and the data content corresponding to the node is data that is prohibited from synchronization. For example, "×" can be displayed in the element control in the shape of "□", indicating that the data content corresponding to the virtual node or data node is data that is prohibited from synchronization.
[0055] It is easy to understand that selection or positive selection can be the user's first click operation on the check control "□", and unselection or reverse selection can be the user's second click operation on the check control "□", or performing the first click operation again after performing the first click operation. In specific implementation, those skilled in the art can set different selection specifications according to actual needs or operation requirements, define related operation methods or shortcut keys, and use the operation methods and shortcut keys to determine the data content to be synchronized and the data content prohibited from synchronization, so the node selection operation will not be described in detail here.
[0056] As an embodiment, the selection result includes a first node designated to perform data synchronization and a second node designated to be prohibited from synchronizing data among the data nodes. Step 120 may specifically include:
[0057] If the number of first nodes is greater than the number of second nodes, the second node is used as the target data node to be operated, and the preset blacklist synchronization method is used as the target synchronization method; the preset blacklist synchronization method is used to indicate that the second node is a node prohibited from synchronizing data.
[0058] If the number of first nodes is equal to or less than the number of second nodes, the first node is used as the target data node to be operated, and the preset whitelist synchronization method is used as the target synchronization method; the preset whitelist synchronization method is used to indicate that the first node is the node for the data to be synchronized.
[0059] In this embodiment, the first node refers to all virtual nodes or data nodes that are selected or chosen, and the second node refers to all virtual nodes or data nodes that are not selected or chosen. Here, the node selection operation triggered by the user in the first interface can be a selection operation on a virtual node or a selection operation on a data node. It is easy to understand that when the user performs a selection operation on a virtual node, it means that a selection operation is performed on all data nodes under the virtual node at the same time. The preset blacklist synchronization mode is used to indicate that the second node is a node that is prohibited from synchronizing data, that is, by declaring the second node as a node in the blacklist, the second node is excluded from the set of nodes that need to synchronize data. At this time, since the preset blacklist synchronization mode is used as the target synchronization mode, indicating that the second node is a node that is prohibited from synchronizing data, it is equivalent to excluding the first node from the blacklist, so the first node is a node to be synchronized. The preset whitelist synchronization mode is used to indicate that the first node is a node to be synchronized, that is, by declaring the first node as a node in the whitelist, the first node is excluded from the set of nodes that are prohibited from synchronizing data. At this time, since the preset whitelist synchronization mode is used as the target synchronization mode, indicating that the first node is the node to be synchronized with data, it is equivalent to excluding the second node from the whitelist, so the second node is a node prohibited from synchronizing data.
[0060] It should be noted that when the number of the first node is greater than the number of the second node, it means that there are more data nodes that need to be synchronized. At this time, the second node is used as the target data node to be operated, and the preset blacklist synchronization method is used as the target synchronization method. That is, for the second node with a smaller number, the preset blacklist synchronization method is used as the target synchronization method, and the second node is declared, so that the generated synchronization configuration content is only for the second node with a smaller number, that is, the number of data rows of the synchronization configuration content can be reduced. Similarly, when the number of the first node is equal to or less than the number of the second node, it means that the data nodes that need to be synchronized are equal to the data nodes that do not need to be synchronized, or it means that there are fewer data nodes that need to be synchronized. At this time, the first node is used as the target data node to be operated, and the preset whitelist synchronization method is used as the target synchronization method. That is, for the first node with a smaller number, the preset whitelist synchronization method is used as the target synchronization method, and the first node is declared, so that the generated synchronization configuration content is only for the first node with a smaller number, that is, the number of data rows of the synchronization configuration content can be reduced.
[0061] As another embodiment, step 120 may specifically include:
[0062] If the proportion of the first node in the data nodes is greater than the preset threshold, the second node is used as the target data node to be operated, and the preset blacklist synchronization method is used as the target synchronization method; the preset blacklist synchronization method is used to indicate that the second node is a node prohibited from synchronizing data.
[0063] If the proportion of the first node in the data node set is equal to or less than the preset threshold, the first node is used as the target data node to be operated, and the preset whitelist synchronization method is used as the target synchronization method; the preset whitelist synchronization method is used to indicate that the first node is the node for the data to be synchronized.
[0064] In this embodiment, since virtual nodes can be used to represent layers in a data structure, and data at the same level can be mapped to data nodes under the same virtual node, the data node set can refer to all data nodes in the tree structure option. The preset threshold is used to describe the percentage threshold of using a preset blacklist synchronization method or a preset whitelist synchronization method. When the percentage of the first node in the data node set is greater than the preset threshold, it means that the number of first nodes is large and the number of second nodes is small. At this time, in order to reduce the configuration content, it is appropriate to use the preset blacklist synchronization method as the target synchronization method, indicating that the second node is a node that is prohibited from synchronizing data. When the percentage of the first node in the data node set is equal to or less than the preset threshold, it means that the number of first nodes is small and the number of second nodes is large. At this time, in order to reduce the configuration content, it is appropriate to use the preset whitelist synchronization method as the target synchronization method, indicating that the first node is a node for data to be synchronized.
[0065] In specific implementation, you can specify the first node for data synchronization by selecting or positively selecting the check control, and specify the second node for prohibiting data synchronization by unselecting or negatively selecting the check control. Here, after specifying the first node for data synchronization, the other unselected or negatively selected nodes are the second nodes. Similarly, after specifying the second node for prohibiting data synchronization, the other selected or positively selected nodes are the first nodes.
[0066] In the specific implementation, by comparing the number of first nodes with the number of second nodes, the node with smaller number can be determined as the target data node, and then the preset blacklist synchronization method or the preset whitelist synchronization method can be selected to generate synchronization configuration content with less configuration content, which is beneficial to improving the configuration efficiency of data synchronization.
[0067] 130: Generate synchronization configuration content with the target data node according to the target synchronization mode.
[0068] In 130, the synchronization configuration content is used to describe the data content synchronized from the data source to the target database. Here, the target database refers to the target location to which the data content to be synchronized is synchronized.
[0069] In specific implementation, the data source and the target database can be different types of databases, and the computer device can interact with the data source and the target database respectively through a web page or a client. In the web page or client, the corresponding statement template can be configured according to different target synchronization methods. After determining the target data node and the target synchronization method, the corresponding statement template is selected according to the target synchronization method, and the node information or node name of the target data node is filled into the statement template to generate the synchronization configuration content.
[0070] As an embodiment, the above step 130 may specifically include:
[0071] If the target synchronization mode is a preset blacklist synchronization mode, the target data node is declared as an excluded node by using a declaration statement corresponding to the preset blacklist synchronization mode to obtain synchronization configuration content.
[0072] If the target synchronization mode is a preset whitelist synchronization mode, the target data node is declared as a containing node to obtain synchronization configuration content using a declaration statement corresponding to the preset whitelist synchronization mode.
[0073] In this embodiment, the declaration statement corresponding to the preset blacklist synchronization method is used to declare the node whose data synchronization is prohibited as an excluded node, that is, to exclude the target data node from the set of nodes to be synchronized. The declaration statement corresponding to the preset whitelist synchronization method is used to declare the node whose data is to be synchronized as an included node, that is, to include the target data node in the set of nodes to be synchronized. Here, the blacklist and the whitelist are complementary to each other. When the target data node is declared as an excluded node using the declaration statement corresponding to the preset blacklist synchronization method, the other data nodes are the nodes of the data to be synchronized. When the target data node is declared as an included node using the declaration statement corresponding to the preset whitelist synchronization method, the other data nodes are the nodes whose data synchronization is prohibited.
[0074] It should be noted that, each time data synchronization is configured, only one synchronization method is selected to declare the target data node to obtain the synchronization configuration content. For example, after the target data node is declared as an excluded node to obtain the synchronization configuration content using the declaration statement corresponding to the preset blacklist synchronization method, the target data node is no longer declared as an included node to obtain the synchronization configuration content using the declaration statement corresponding to the preset whitelist synchronization method until the next data synchronization configuration. For another example, after the target data node is declared as an included node to obtain the synchronization configuration content using the declaration statement corresponding to the preset whitelist synchronization method, the target data node is no longer declared as an excluded node to obtain the synchronization configuration content using the declaration statement corresponding to the preset blacklist synchronization method until the next data synchronization configuration.
[0075] 140: In response to a node mapping configuration operation triggered by the user in the first interface, a mapping configuration interface is displayed; the mapping configuration interface is used to input a mapping statement of the first node.
[0076] 150: Generate mapping configuration content according to the mapping statement.
[0077] In this embodiment, the mapping configuration interface is used for the user to input a mapping statement of the first node. Here, the mapping statement and the mapping configuration content are used to indicate the location of the data content corresponding to the first node to be synchronized to the target database.
[0078] In a specific implementation, when there are multiple first nodes, the data contents corresponding to the multiple first nodes can be mapped to one node in the target database through the mapping configuration interface. The data contents corresponding to the multiple first nodes can also be mapped to multiple nodes in the target database through the mapping configuration interface. That is, the mapping configuration content is used to indicate the mapping relationship between the data contents corresponding to the multiple first nodes and the multiple nodes in the target database.
[0079] For example, the data content corresponding to the first node is multiple tables. In the mapping statement of the first node input through the mapping configuration interface, the mapping statement may indicate that the contents of the multiple tables in the data source are synchronized to one table in the target database.
[0080] As an example, when a first node has multiple sub-nodes, a mapping statement of the first node input through the mapping configuration interface can be synchronized to all sub-nodes summarized under the first node.
[0081] For example, the data content corresponding to the first node is N tables. In the mapping statement of the first node input through the mapping configuration interface, the mapping statement can indicate that the contents of the N tables in the data source are synchronized to the N tables in the target database, where N is an integer greater than 1.
[0082] Based on the above example, a first subnode and a second subnode may also be configured under the first node. The first subnode refers to a node that has been additionally configured with a mapping statement, and the second subnode refers to a node that has not been additionally configured with a mapping statement. Here, the mapping statement of the first node input through the mapping configuration interface can be synchronized to the second subnode summarized under the first node. In addition, the first subnode follows the mapping relationship indicated by the additionally configured mapping statement.
[0083] For example, the data content corresponding to the first node is N tables, among which the first table and the second table have been configured with mapping statements, that is, the first table and the second table are the first child nodes. In the mapping statement of the first node input through the mapping configuration interface, the mapping statement can indicate that the content of the third table to the Nth table in the data source is synchronized to the target table in the target database.
[0084] As an embodiment, after the step of displaying the mapping configuration interface in response to the node mapping configuration operation triggered by the user in the first interface, the method further includes:
[0085] According to the mapping statement entered in the mapping configuration interface, the action node corresponding to the mapping relationship indicated by the mapping statement is displayed.
[0086] In this embodiment, the mapping statement is used to indicate the mapping relationship of the first node. The action node may generally refer to the child nodes summarized under the first node that follow the mapping relationship indicated by the mapping statement.
[0087] In specific implementation, the action node corresponding to the mapping relationship indicated by the mapping statement is displayed, and specifically, a distinguishing element may be added to the action node. For example, the action node may be distinguished from other non-action nodes by at least one of color distinction, flashing distinction, and underline distinction.
[0088] 160: Generate synchronization target configuration content using the synchronization configuration content and the mapping configuration content.
[0089] In this embodiment, the target configuration content refers to the combined configuration content of the synchronization configuration content and the mapping configuration content. The synchronization configuration content is used to describe the data content to be synchronized, that is, the data content synchronized from the data source. The mapping configuration content can also be used to indicate that the data content synchronized from the data source is synchronized to the target location in the target database. It can also be understood that the synchronization configuration content describes the table data content synchronized from the data source, and the mapping configuration content indicates which target table in the target database the table data content is synchronized to. It can also be understood that the target configuration content is used to implement synchronization of data content from the data source to the target database. Based on this, the target configuration content specifically refers to the configuration content that is actually executed during the data synchronization process, and the target configuration content indicates the table data content synchronized from the data source, and the target table to which the table data content is synchronized in the target database.
[0090] A data synchronization configuration method provided in this embodiment can automatically generate synchronization configuration content and mapping configuration content according to user operations, and then use the synchronization configuration content and mapping configuration content to generate target configuration content synchronization, providing users with a data synchronization configuration solution with relatively simple human-computer interaction, more flexible and efficient implementation, and a higher degree of automation.
[0091] See also Figure 3 , Figure 3 is a flowchart of a data synchronization configuration method provided by another embodiment of the present application. Figure 1 Compared with the corresponding embodiment, Figure 3 The data synchronization configuration method shown in FIG. 1 further includes step 210 before step 110. Figure 3 As shown, specifically:
[0092] 210: Get the data level information of the data source.
[0093] In step 210, data hierarchy information is used to describe the hierarchical relationship between data contents in the data source.
[0094] In this embodiment, the data level information of the data source is obtained by establishing a connection with the data source through a web page or a client in the computer device and then obtaining the data level information from the data source.
[0095] As an embodiment, the above step 210 may specifically include:
[0096] In response to a first preset instruction triggered by a user, a preset request is sent to a data source, and data level information returned by the data source according to the preset request is received.
[0097] In this embodiment, the first preset instruction refers to an operation triggered by a user on a computer device for sending a preset request. In response to the operation, the computer device sends a preset request to the server where the data source is located through a web page or a client. Here, the preset request is used to request the server to return data level information of the data source to the computer device. The data level information is used to describe the data structure of the data source. After receiving the preset request, the server returns the data level information to the computer device.
[0098] In a specific implementation, the computer device displays a user operation interface through a web page or a client. The user configures the data source address or data source name in the user operation interface, and then sends a preset request to the data source through the web page or the client. When the computer device receives the data level information returned by the server according to the preset request, step 110 is executed immediately.
[0099] As another embodiment, the above step 210 may specifically include:
[0100] In response to a second preset instruction triggered by the user, data level information of the data source is obtained from the local cache.
[0101] In this embodiment, the second preset instruction refers to an operation triggered by a user on a computer device for obtaining data level information of a data source from a local cache, and the computer device obtains data level information of the data source from the local cache in response to the operation. Here, the data level information is used to describe the data structure of the data source. After the computer device obtains the data level information of the data source from the local cache, step 110 is immediately executed.
[0102] As an embodiment, step 110 may specifically include:
[0103] Determine virtual nodes according to data level information. Construct tree structure options based on virtual nodes. Render tree structure options to obtain a first interface, and display the first interface for users to select data to be synchronized.
[0104] In this embodiment, since the data hierarchy information is used to describe the hierarchical relationship between the data content in the data source, that is, the data structure of the data source, the data nodes with the same hierarchical attributes can be aggregated, that is, aggregated under the virtual node, thereby obtaining a tree structure option containing virtual nodes, and the data nodes with the same hierarchical attributes are arranged and aggregated under each virtual node.
[0105] See also Figure 4 , Figure 4 FIG. 1 is a flowchart of a data synchronization configuration method provided in another embodiment of the present application. Figure 1 or Figure 3 Compared with the corresponding embodiment, Figure 4The configuration method of data synchronization shown in the figure further includes steps 310 to 320 after step 120. As an embodiment, the selection result includes a first node designated to perform data synchronization among the data nodes, and a second node designated to prohibit data synchronization. Figure 4 As shown, specifically:
[0106] 310: In response to a node configuration operation triggered by the user in the first interface, a second interface is displayed; the second interface includes a requirement option for configuring a synchronization requirement for the first node.
[0107] 320: In response to the user's check operation on the requirement option, generating, for the first node, node requirement configuration content corresponding to the target requirement option checked by the user.
[0108] In this embodiment, the node configuration operation refers to the configuration operation triggered on the data node in the tree structure option. The node requirement configuration content refers to the configuration content generated based on the target requirement option checked by the user, and is related to the target requirement option.
[0109] For example, you can right-click on a data node to pop up an option window, select the function button for node configuration, and then trigger the node configuration operation. The first node generally refers to the data node selected by the user from the data nodes in the tree structure options when performing the node configuration operation. By displaying the second interface, you can configure the corresponding synchronization requirement requirements for the first node. Here, the second interface refers to the interface for configuring synchronization requirements for data nodes.
[0110] Figure 5 A schematic diagram of an implementation method of the second interface in the embodiment of the present application is shown. Figure 5 As shown, as an example, the requirement options may include options related to the data definition language DDL. Figure 5 The DDL options 20 shown may include: a creation option “Create”, a modification option “Alter”, a delivery option “Drop”, a rename option “Rename”, and a truncation option “Truncate”.
[0111] In some embodiments, the requirement options may also include a data manipulation language DML option. Figure 5 Taking the second interface shown in the figure as an example, the second interface also includes a data manipulation language DML option 30. Figure 5 As shown, the DML options 30 may include: a data insert option “Insert”, a data update option “Update”, and a data delete option “Delete”.
[0112] In the specific implementation, users can configure DDL options or DML options separately to meet specific data synchronization requirements. After the configuration is completed, users can view all sibling nodes of the node by clicking the window that pops up in the node, select the corresponding sibling nodes as needed, and then apply the same configuration to the selected sibling nodes in batches, thereby improving the efficiency and consistency of the configuration.
[0113] In this embodiment, by displaying the second interface in the form of requirement options for the user to configure the synchronization requirements for the first node, and then by responding to the user's check operation on the requirement options, generating node requirement configuration content corresponding to the target requirement options checked by the user for the first node, the degree of automation of data synchronization configuration can be further improved, thereby improving the efficiency of data synchronization configuration.
[0114] See also Figure 6 , Figure 6 FIG. 1 is a flowchart of a data synchronization configuration method provided by another embodiment of the present application. Figure 4 Compared with the corresponding embodiment, Figure 6 The data synchronization configuration method shown in FIG. 1 further includes steps 410 to 420 after step 320. Figure 5 As shown, specifically:
[0115] 410: In response to a multi-node configuration operation triggered by the user in the first interface, a third interface is displayed; the third interface includes configuration options for synchronizing node requirement configuration content to a third node; the third node and the first node are aggregated under the same virtual node.
[0116] 420: In response to the user's selection operation on the configuration option in the third interface, the node requirement configuration content is synchronized to the third node.
[0117] In this embodiment, the third interface can be understood as a configuration interface that provides users with a way to batch synchronize synchronization requirements to other data nodes after configuring synchronization requirements. After the user triggers a multi-node configuration operation in the first interface, the third interface containing the first node is displayed, allowing the user to select a third node through the third interface to synchronize configuration requirements.
[0118] It is understandable that the first node and the third node are under the same virtual node. After the user configures the synchronization requirements for the first node, the node requirement configuration content corresponding to the synchronization requirements can be synchronized to other data nodes under the virtual node through the third interface.
[0119] Figure 7 A schematic diagram of an implementation method of the third interface in the embodiment of the present application is shown. Figure 7In the example, the node rw_map is the first node, and each node in the node set 40 is a third node under the same virtual node as the first node. The user can select the third node in the node set 40, that is, trigger the selection operation of the configuration option in the third interface, to synchronize the node requirement configuration content of the first node to the third node.
[0120] In this embodiment, by responding to a multi-node configuration operation triggered by the user in the first interface, a third interface is displayed, and the third interface is used for the user to select a third node for which node demand configuration content synchronization is required. Then, by responding to the user's selection operation on the configuration option in the third interface, the node demand configuration content is synchronized to the third node, thereby achieving rapid synchronization of the synchronization requirements of data nodes under the same virtual node and improving the efficiency of data synchronization configuration.
[0121] See also Figure 8 , Figure 8 1 is a structural block diagram of a data synchronization configuration device provided in an embodiment of the present application. In this embodiment, the data synchronization configuration device includes various units for executing Figure 1 , Figure 3 , Figure 4 as well as Figure 6 For details, please refer to the steps in the corresponding embodiment. Figure 1 , Figure 3 , Figure 4 as well as Figure 6 ,as well as Figure 1 , Figure 3 , Figure 4 as well as Figure 6 For the convenience of explanation, only the parts related to this embodiment are shown. Figure 8 , a data synchronization configuration device includes: a first display unit 801, a second display unit 802, a first configuration content unit 803, a third display unit 804, a second configuration content unit 805 and a third configuration content unit 806.
[0122] The first display unit 801 is used to display a first interface for users to select data to be synchronized; the first interface includes tree structure options corresponding to the data structure of the data source; the tree structure options include virtual nodes that aggregate data nodes with the same hierarchical attributes.
[0123] The second display unit 802 is used to respond to the node selection operation triggered by the user in the first interface, display the selection result corresponding to the node selection operation in the first interface, and determine the target data node to be operated and the target synchronization mode based on the selection result; the selection result includes the first node among the data nodes that is designated to perform data synchronization, and the second node that is designated to prohibit data synchronization; the target synchronization mode includes a preset whitelist synchronization mode or a preset blacklist synchronization mode.
[0124] The first configuration content unit 803 is used to generate synchronization configuration content with the target data node according to the target synchronization mode; the synchronization configuration content is used to describe the data content synchronized from the data source to the target database.
[0125] The third display unit 804 is used to display a mapping configuration interface in response to a node mapping configuration operation triggered by the user in the first interface; the mapping configuration interface is used to input a mapping statement of the first node.
[0126] The second configuration content unit 805 is used to generate mapping configuration content according to the mapping statement.
[0127] The third configuration content unit 806 is used to generate target configuration content by using the synchronization configuration content and the mapping configuration content; the target configuration content is used to synchronize the data content from the data source to the target database.
[0128] As an embodiment, the data synchronization configuration device further includes:
[0129] The first acquisition unit is used to acquire data level information of a data source; the data level information is used to describe the hierarchical relationship between data contents in the data source.
[0130] Accordingly, the first display unit 801 is specifically used to determine a virtual node according to the data hierarchy information; construct a tree structure option based on the virtual node; render the tree structure option to obtain a first interface, and display the first interface for the user to select the data to be synchronized.
[0131] As an embodiment, the data synchronization configuration device further includes:
[0132] The fourth display unit is used to display a second interface in response to a node configuration operation triggered by a user in the first interface; the second interface includes a requirement option for configuring synchronization requirements for a third node.
[0133] The fourth configuration content unit is used to generate, in response to a user's check operation on the requirement option, node requirement configuration content corresponding to the target requirement option checked by the user for the third node.
[0134] As an embodiment, the data synchronization configuration device further includes:
[0135] A fourth display unit is used to display a third interface in response to a multi-node configuration operation triggered by a user in the first interface; the third interface includes a configuration option for synchronizing the node requirement configuration content to a fourth node; the fourth node and the third node are aggregated under the same virtual node.
[0136] A configuration content synchronization unit is used to synchronize the node requirement configuration content to the fourth node in response to a user's selection operation on the configuration option in the third interface.
[0137] It should be understood that the data synchronization configuration device provided in this embodiment has each unit configured to execute Figure 1 , Figure 3 , Figure 4 as well as Figure 6 The steps in the corresponding embodiments, and for Figure 1 , Figure 3 , Figure 4 as well as Figure 6 Each step in the corresponding embodiment has been explained in detail in the above embodiment. Figure 1 , Figure 3 , Figure 4 as well as Figure 6 ,as well as Figure 1 , Figure 3 , Figure 4 as well as Figure 6 The relevant descriptions in the corresponding embodiments are not repeated here.
[0138] Fig. 9 is a structural block diagram of a computer device provided in an embodiment of the present application. Fig. 9 As shown, the computer device 5 of this embodiment includes: a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50, such as a program of a data synchronization configuration method. When the processor 50 executes the computer program 52, the steps of each embodiment of the above-mentioned data synchronization configuration method are implemented, such as Figure 1 The steps shown, or Figure 3 , Figure 4 as well as Figure 6 Alternatively, the processor 50 implements the above steps when executing the computer program 52 Figure 8 The functions of each unit in the corresponding embodiment. Please refer to Figure 8 The relevant descriptions in the corresponding embodiments are not repeated here.
[0139] Exemplarily, the computer program 52 may be divided into one or more units, which are stored in the memory 51 and executed by the processor 50 to complete the present application. The one or more units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 52 in the computer device 5. For example, the computer program 52 may be divided into a first display unit, a second display unit, a first configuration content unit, a third display unit, a second configuration content unit, and a third configuration content unit, and the specific functions of each unit are as described above.
[0140] The computer device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will appreciate that Fig. 9 It is only an example of the computer device 5 and does not constitute a limitation of the computer device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0141] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0142] The memory 51 may be an internal storage unit of the computer device 5, such as a hard disk or memory of the computer device 5. The memory 51 may also be an external storage device of the computer device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the computer device 5. The memory 51 is used to store the computer program and other programs and data required by the computer device. The memory 51 may also be used to temporarily store data that has been output or is to be output.
[0143] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data synchronization configuration method, characterized in that: include: Displaying a first interface for the user to select data to be synchronized; the first interface includes tree structure options corresponding to the data structure of the data source; The tree structure options include virtual nodes that aggregate data nodes with the same level attributes; In response to a node selection operation triggered by a user in the first interface, a selection result corresponding to the node selection operation is displayed in the first interface, and based on the selection result, a target data node to be operated and a target synchronization mode are determined; the selection result includes a first node designated to perform data synchronization and a second node designated to be prohibited from synchronizing data among the data nodes; the target synchronization mode includes a preset whitelist synchronization mode or a preset blacklist synchronization mode; Generate synchronization configuration content with the target data node according to the target synchronization mode; the synchronization configuration content is used to describe the data content synchronized from the data source to the target database; In response to a node mapping configuration operation triggered by a user in the first interface, displaying a mapping configuration interface; The mapping configuration interface is used to input the mapping statement of the first node; Generate mapping configuration content according to the mapping statement; Generate target configuration content using the synchronization configuration content and the mapping configuration content; The target configuration content is used to synchronize the data content from the data source to the target database.
2. The method according to claim 1, characterized in that The method further comprises: Acquire data level information of a data source; the data level information is used to describe the hierarchical relationship between data contents in the data source; The first interface for displaying the first interface for the user to select the data to be synchronized includes: Determine a virtual node according to the data level information; Constructing a tree structure option based on the virtual nodes; The tree structure options are rendered to obtain a first interface, and the first interface is displayed for the user to select data to be synchronized.
3. The method according to claim 2, characterized in that The obtaining of data level information of the data source includes: In response to a first preset instruction triggered by a user, sending a preset request to a data source, and receiving data level information returned by the data source according to the preset request; or In response to a second preset instruction triggered by the user, data level information of the data source is obtained from the local cache.
4. The method according to claim 1, characterized in that The step of determining the target data node to be operated and the target synchronization mode based on the selection result includes: If the number of the first nodes is greater than the number of the second nodes, the second nodes are used as target data nodes to be operated, and a preset blacklist synchronization mode is used as the target synchronization mode; the preset blacklist synchronization mode is used to indicate that the second nodes are nodes that are prohibited from synchronizing data; If the number of the first nodes is less than the number of the second nodes, the first nodes are used as target data nodes to be operated, and the preset whitelist synchronization method is used as the target synchronization method; the preset whitelist synchronization method is used to indicate that the first node is the node for data to be synchronized.
5. The method according to claim 1, characterized in that The step of determining the target data node to be operated and the target synchronization mode based on the selection result includes: If the proportion of the first node in the data node set is greater than a preset threshold, the second node is used as the target data node to be operated, and a preset blacklist synchronization mode is used as the target synchronization mode; the preset blacklist synchronization mode is used to indicate that the second node is a node that is prohibited from synchronizing data; If the proportion of the first node in the data node set is less than a preset threshold, the first node is used as the target data node to be operated, and the preset whitelist synchronization method is used as the target synchronization method; the preset whitelist synchronization method is used to indicate that the first node is the node for data to be synchronized.
6. The method according to claim 4 or 5, characterized in that: The step of generating synchronization configuration content with the target data node according to the target synchronization mode includes: If the target synchronization mode is the preset blacklist synchronization mode, using the declaration statement corresponding to the preset blacklist synchronization mode, the target data node is declared as an excluded node to obtain synchronization configuration content; If the target synchronization mode is the preset whitelist synchronization mode, the target data node is declared as a containing node to obtain synchronization configuration content by using a declaration statement corresponding to the preset whitelist synchronization mode.
7. The method according to claim 1, characterized in that After the step of displaying the mapping configuration interface in response to the node mapping configuration operation triggered by the user in the first interface, the method further includes: According to the mapping statement input in the mapping configuration interface, the action node corresponding to the mapping relationship indicated by the mapping statement is displayed.
8. A data synchronization configuration device, characterized in that: include: A first display unit, used to display a first interface for a user to select data to be synchronized; The first interface includes tree structure options corresponding to the data structure of the data source; The tree structure options include virtual nodes that aggregate data nodes with the same level attributes; a second display unit, for responding to a node selection operation triggered by a user in the first interface, displaying a selection result corresponding to the node selection operation in the first interface, and determining a target data node to be operated and a target synchronization mode based on the selection result; the selection result includes a first node designated to perform data synchronization among the data nodes, and a second node designated to be prohibited from synchronizing data; the target synchronization mode includes a preset whitelist synchronization mode or a preset blacklist synchronization mode; A first configuration content unit is used to generate synchronization configuration content with the target data node according to the target synchronization mode; the synchronization configuration content is used to describe the data content synchronized from the data source to the target database; A third display unit, configured to display a mapping configuration interface in response to a node mapping configuration operation triggered by a user in the first interface; The mapping configuration interface is used to input the mapping statement of the first node; A second configuration content unit, used to generate mapping configuration content according to the mapping statement; The third configuration content unit is used to generate target configuration content by using the synchronization configuration content and the mapping configuration content; the target configuration content is used to synchronize the data content in the data source to the target database.
9. A computer device, characterized in that: The computer device comprises: a memory, a processor, and a computer program stored in the memory and executable on the computer device, and the processor implements the steps of the data synchronization configuration method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the data synchronization configuration method according to any one of claims 1 to 7 are implemented.