Data Synchronization Method, Apparatus, Computer Device, and Storage Medium
By defining the target domain model of the target business entity and obtaining metadata to generate synchronous configuration data, the problem of inefficiency of traditional data synchronization methods is solved, efficient and accurate data synchronization is achieved, and data readability is improved.
Patent Information
- Application Number
- CN202210181852.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-02-25
AI Technical Summary
Traditional data synchronization methods are inefficient and difficult to accurately determine the data tables that need to be synchronized when there are many data tables and complex associations.
By defining the target domain model of the target business entity, obtaining metadata, and generating synchronous configuration data based on the metadata, extracting the data table to be synchronized, selecting the corresponding target data table, and synchronizing the data in its fields to the data center.
It improves the efficiency of data synchronization, avoids omissions in data tables, is more accurate, and intuitively presents the correlation between data tables, improving the readability of data.
Smart Images

Figure CN114547204B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a data synchronization method, apparatus, computer device, storage medium, and computer program product. Background Art
[0002] With the development of computer technology, it is often necessary to synchronize the data in the business system to the data center. How to accurately determine the data that needs to be synchronized has become an important issue. In traditional technologies, the data tables that need to be synchronized are determined through the association relationships between data tables. However, when the number of data tables to be synchronized is large, due to the relatively complex association relationships between data tables, it takes a long time to determine the data tables that need to be synchronized, and the efficiency of data synchronization is low. Summary of the Invention
[0003] Based on this, in view of the above technical problems, it is necessary to provide a data synchronization method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve efficiency.
[0004] In a first aspect, this application provides a data synchronization method. The method includes:
[0005] In response to a data synchronization operation for a target business entity, obtain metadata of the target business entity from a target domain model for defining the target business entity;
[0006] Extract an identity of a data table to be synchronized from synchronization configuration data generated according to the metadata;
[0007] Select a target data table corresponding to the identity of the data table to be synchronized from the data tables in the business database;
[0008] Synchronize the data in the fields of the target data table to the data center.
[0009] In a second aspect, this application further provides a data synchronization apparatus. The apparatus includes:
[0010] An obtaining module, configured to obtain metadata of a target business entity from a target domain model for defining the target business entity in response to a data synchronization operation for the target business entity;
[0011] An extraction module, configured to extract an identity of a data table to be synchronized from synchronization configuration data generated according to the metadata;
[0012] A selection module, configured to select a target data table corresponding to the identity of the data table to be synchronized from the data tables in the business database;
[0013] A synchronization module, configured to synchronize the data in the fields of the target data table to the data center.
[0014] In one embodiment, the obtaining module is further configured to:
[0015] In response to a selection operation for a candidate domain model, select a target domain model from the candidate domain models, and display all business entities defined by the target domain model;
[0016] In response to a selection operation for the business entity, select a target business entity from the business entities;
[0017] Extract metadata of the target business entity in the target domain model.
[0018] In one embodiment, the extraction module is further configured to:
[0019] Send the metadata to a synchronization configuration terminal;
[0020] Receive synchronization configuration data generated by the synchronization configuration terminal according to the metadata;
[0021] Extract an identification of a data table to be synchronized from the received synchronization configuration data.
[0022] In one embodiment, the apparatus further includes:
[0023] An extraction module, configured to extract data in fields of the target data table from a business library by using an application programming interface;
[0024] A storage module, configured to store the extracted data in a cached data table;
[0025] A synchronization module, further configured to synchronize the data in the cached data table to a data center.
[0026] In one embodiment, the business library and the data center are respectively deployed in different public clouds.
[0027] In one embodiment, the apparatus further includes:
[0028] The obtaining module is further configured to obtain a temporary secret key; the temporary secret key is only valid within a preset time period;
[0029] An encryption module, configured to encrypt the data in the fields of the target data table by using the temporary secret key to obtain encrypted data;
[0030] The synchronization module is further configured to synchronize the encrypted data to the data center.
[0031] In one embodiment, the apparatus further includes:
[0032] The extraction module is further configured to extract the to-be-synchronized field identifier from the synchronization configuration data;
[0033] The synchronization module is further configured to select, from the fields of the target data table, the to-be-synchronized field corresponding to the to-be-synchronized field identifier; and synchronize the data in the to-be-synchronized field to the data center.
[0034] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the following steps are implemented:
[0035] In response to a data synchronization operation for a target business entity, obtain metadata of the target business entity from a target domain model for defining the target business entity;
[0036] Extract a to-be-synchronized data table identifier from the synchronization configuration data generated according to the metadata;
[0037] Select, from the data tables in the business library, a target data table corresponding to the to-be-synchronized data table identifier;
[0038] Synchronize the data in the fields of the target data table to the data center.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0040] In response to a data synchronization operation for a target business entity, obtain metadata of the target business entity from a target domain model for defining the target business entity;
[0041] Extract a to-be-synchronized data table identifier from the synchronization configuration data generated according to the metadata;
[0042] Select, from the data tables in the business library, a target data table corresponding to the to-be-synchronized data table identifier;
[0043] Synchronize the data in the fields of the target data table to the data center.
[0044] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0045] In response to a data synchronization operation for a target business entity, obtain metadata of the target business entity from a target domain model for defining the target business entity;
[0046] Extract the identification of the data table to be synchronized from the synchronization configuration data generated according to the metadata;
[0047] Select the target data table corresponding to the identification of the data table to be synchronized from the data tables in the business database;
[0048] Synchronize the data in the fields of the target data table to the data center.
[0049] In response to a data synchronization operation for a target business entity, the above data synchronization method, device, computer device, storage medium, and computer program product obtain the metadata of the target business entity from the target domain model used to define the target business entity. Since the target business entity is defined in the target domain model, the data tables included in the target business entity can be determined through the metadata of the target business entity. Thus, synchronization configuration can be performed according to the metadata of the target business entity to generate synchronization configuration data, and the data tables that need to be synchronized can be determined based on the synchronization configuration data. Extract the identification of the data table to be synchronized from the synchronization configuration data generated according to the metadata, select the target data table corresponding to the identification of the data table to be synchronized from the data tables in the business database, and synchronize the data in the fields of the target data table to the data center. Thus, the data tables that need to be synchronized can be determined quickly. Compared with determining the data to be synchronized based on the association relationship between data tables, the efficiency of data synchronization is improved, and the omission of data tables can be avoided, with higher accuracy. In addition, since the data tables associated with each business entity are defined in the domain model, the association relationship between data tables is presented more intuitively, making the data in the synchronized data tables more readable. Brief Description of the Drawings
[0050] Figure 1 It is an application environment diagram of the data synchronization method in an embodiment;
[0051] Figure 2 It is a schematic flowchart of the data synchronization method in an embodiment;
[0052] Figure 3 It is a schematic diagram of a business entity in an embodiment;
[0053] Figure 4 It is a schematic diagram of the data synchronization interface in an embodiment;
[0054] Figure 5 It is a schematic diagram of the data synchronization solution in an embodiment;
[0055] Figure 6 It is a schematic diagram of the data synchronization principle in an embodiment;
[0056] Figure 7 It is a schematic diagram of the principle of data synchronization through a data synchronization tool in an embodiment;
[0057] Figure 8 Schematic diagram of data extraction by a data synchronization tool through an application programming interface in an embodiment;
[0058] Figure 9 Schematic diagram of the principle of a data synchronization method in another embodiment;
[0059] Figure 10 Schematic diagram of the process of a data synchronization method in another embodiment;
[0060] Figure 11 Structural block diagram of a data synchronization device in an embodiment;
[0061] Figure 12 Structural block diagram of a data synchronization device in another embodiment;
[0062] Figure 13 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0063] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to 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.
[0064] The data synchronization method provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the server 102 responds to a data synchronization operation for a target business entity, obtains metadata of the target business entity from a target domain model for defining the target business entity; extracts an identity of a data table to be synchronized from the synchronization configuration data generated according to the metadata; selects a target data table corresponding to the identity of the data table to be synchronized from the data tables in the business database; and synchronizes the data in the fields of the target data table to the data center 104. The business database may store data generated in the business system, and the business database may be integrated on the server 102, or may be placed on the cloud or other network servers.
[0065] Among them, the server 102 can be implemented by a server cluster composed of multiple physical servers, and can be implemented by a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0066] In one embodiment, as Figure 2 shown, a data synchronization method is provided, and this method is applied to Figure 1Taking the server in [as an example for illustration, the following steps are included:
[0067] S202, in response to a data synchronization operation for a target business entity, obtain metadata of the target business entity from a target domain model used to define the target business entity.
[0068] Among them, a business entity is an object related to business. For example, it can be a document in an ERP (Enterprise Resource Planning) business system (such as, "Initial Sales Outbound Document" or "Sales Outbound Document", etc.), or the business entity can also be a sold item in an inventory management business system, or the business entity can also be a social account in a social business system, etc. A business entity can include one or more data tables. For example, the "Initial Sales Outbound Document" business entity can include Data Table A, Data Table B, etc. The target business entity can be one or more business entities selected by a user. For example, the target business entity can be "Initial Sales Outbound Document" or "Sales Outbound Document", etc. As Figure 3 shown, a business entity includes a document header, a sub-document header, a document body, and a sub-document body.
[0069] Among them, a domain model is an object model that describes the implementation of business use cases, and is also known as a conceptual model, a domain object model, or an analysis object model. For example, the domain model can be a supply chain model, a tax management model, an employee service model, etc. One or more business entities can be defined in the domain model. For example, business entities such as "Initial Sales Outbound Document" and "Sales Outbound Document" are defined in the supply chain model. Metadata is data used to describe a business entity, including entity type, data table identifier associated with the business entity, primary key, primary key type, etc.
[0070] In one embodiment, S202 specifically includes: in response to a selection operation for a candidate domain model, select a target domain model from the candidate domain model and display all business entities defined by the target domain model; in response to a selection operation for a business entity, select a target business entity from the business entities; extract metadata of the target business entity from the target domain model.
[0071] Among them, the selection operation can be an operation triggered by clicking, dragging, or swiping, etc. For example, as Figure 4As shown, multiple candidate domain models such as "Employee Services", "Financial Accounting", and "Tax Management" are displayed in the data synchronization interface. The selection operation is a click operation on the candidate domain models. Through the selection operation, the target domain model is selected. The selected target domain model can be, for example, "Supply Chain". "Supply Chain" can include business entities such as "Initial Sales Delivery Note" and "Sales Delivery Note". In response to the selection operation for the business entity, the target business entity is selected in the business entity. The target business entity can be, for example, "Initial Sales Delivery Note". The server extracts the metadata of the "Initial Sales Delivery Note" in the "Supply Chain" domain model.
[0072] S204. Extract the identifier of the data table to be synchronized from the synchronization configuration data generated based on the metadata.
[0073] Among them, synchronization configuration is the process of configuring the data tables and fields in the data tables to form a synchronization configuration plan. For example, as Figure 5 shown, the synchronization configuration plan includes the identifier of the field to be synchronized, the field type, and the field description. Synchronization configuration data is the data used to record the synchronization configuration plan, which can be in the JSON (JavaScript Object Notation, JS object notation) format, or it can also be in other formats. The synchronization configuration data can include the identifier of the data table to be synchronized, the identifier of the field to be synchronized in the data table, the field type, and the field description, etc. The identifier of the data table to be synchronized is the identifier used to represent the data table to be synchronized, which can be composed of one or more of numbers, letters, characters, or special symbols. For example, the identifier of the data table to be synchronized is AS001.
[0074] In one embodiment, the server can generate synchronization configuration data based on the metadata. Or, the server can also send the metadata to the synchronization configuration terminal through a data synchronization tool so that the synchronization configuration terminal generates synchronization configuration data based on the metadata.
[0075] S206. Select the target data table corresponding to the identifier of the data table to be synchronized in the data tables of the business library.
[0076] Among them, the business library is the storage space for storing the data in the business system. In one embodiment, multiple business systems are running on the server, and the data generated in each business system is stored in the corresponding business library. The server selects the target data table in the business library according to the identifier of the data table to be synchronized. The multiple business systems running on the server can be deployed in different public clouds respectively, and the corresponding business libraries are also deployed in different public clouds.
[0077] S208. Synchronize the data in the fields of the target data table to the data center.
[0078] Among them, the data center 104 can be implemented by an independent server or a server cluster composed of multiple servers, such as a big data cluster. In one embodiment, the big data cluster can be a big data cluster based on object storage. Object storage is a cloud storage method suitable for storing any type of file, and can be S3 (Simple Storage Service) or OBS (Object Storage Service), etc. The server can synchronize the data extracted from the business databases of multiple business systems to the data center for big data analysis using these data, which can be used for enterprise business decision-making. For example, as Figure 6 shown, the server synchronizes the data extracted from the business databases of business systems 1 - N to the data center. The business system can be an enterprise management system, such as management systems like ERP (Enterprise Resource Planning System), CRM (Customer Relationship Management System), OA (Office Automation System), etc.
[0079] In one embodiment, before S208, it further includes: using the application programming interface to extract the data in the fields of the target data table from the business database; storing the extracted data in the cache data table; S208 specifically includes: synchronizing the data in the cache data table to the data center.
[0080] Among them, the cache data table is a data table that temporarily stores the data in the fields of the target data table. For the data in the fields of multiple target data tables, they can all be temporarily stored in the cache data table, and then the server synchronizes the data in the cache data table to the data center.
[0081] In one embodiment, as Figure 7 shown, the data synchronization tool accesses the business system through the application programming interface of the business system, extracts data from the business database of the business system, then stores the extracted data in the cache data table, and finally uploads the data in the cache data table to the data center. Among them, the data synchronization tool is a software program used to execute data synchronization tasks. The data synchronization tool can access the WebAPI (Web Application Programming Interface) of the business system and extract data from the business database through the WebAPI.
[0082] When the database of the business system and the data center are deployed in different public clouds, due to reasons such as data security, it is often impossible to open external network access in the business system to which the business database belongs. If data is extracted from the business database through tools such as Sqoop or DataX, a set of data centers need to be deployed in the public cloud corresponding to each business database, which is complex to operate and costly. The data synchronization tool can extract data from the business database by using the application programming interface, so that when the business database and the data center are not deployed in the same public cloud, the data in the business database can also be synchronized to the data center, improving the efficiency of data synchronization. In addition, as Figure 8 shown, the data synchronization tool extracts data from the business database by using the application programming interface, rather than directly accessing and operating the business tables of the business database. When the business database does not allow direct access by the terminal for its own security, it is not necessary to build a standby database for the terminal to extract data by accessing the standby database, thus reducing the complexity of the business system, improving the operation and maintenance efficiency of the business system, and improving the security of the data in the business database.
[0083] In the above embodiment, in response to the data synchronization operation for the target business entity, based on the target domain model for defining the target business entity, the metadata of the target business entity is obtained. Since the target business entity is defined in the target domain model, the data tables included in the target business entity can be determined through the metadata of the target business entity. Thus, the synchronization configuration can be performed according to the metadata of the target business entity to generate the synchronization configuration data, and the data tables to be synchronized can be determined based on the synchronization configuration data. In the synchronization configuration data generated according to the metadata, the identifiers of the data tables to be synchronized are extracted. In the data tables of the business database, the target data tables corresponding to the identifiers of the data tables to be synchronized are selected, and the data in the fields of the target data tables is synchronized to the data center. Thus, the data tables to be synchronized can be quickly determined, which improves the efficiency of data synchronization compared with determining the data to be synchronized based on the association relationship between data tables, and can avoid omission of data tables, with higher accuracy. In addition, since the data tables associated with each business entity are defined in the domain model, the association relationship between data tables is presented more intuitively, making the data in the synchronized data tables more readable.
[0084] In one embodiment, S204 specifically includes: sending the metadata to the synchronization configuration terminal; receiving the synchronization configuration data generated by the synchronization configuration terminal according to the metadata; and extracting the identifiers of the data tables to be synchronized from the received synchronization configuration data.
[0085] Among them, the synchronization configuration terminal is the terminal used for synchronization configuration. In one embodiment, as Figure 7As shown, the data synchronization tool sends metadata to the synchronization configuration terminal. The synchronization configuration terminal generates synchronization configuration data based on the metadata and then feeds back the synchronization configuration data to the data synchronization tool. In one embodiment, the data synchronization tool sends metadata to the synchronization configuration terminal via HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer), and the synchronization configuration terminal feeds back the synchronization configuration data to the data synchronization tool via the HTTPS protocol.
[0086] In the above embodiment, the synchronization configuration terminal generates synchronization configuration data based on the metadata, separating the synchronization configuration task from the business system, avoiding the impact of the data synchronization task on the normal operation of the business system, and ensuring the operation security of the business system.
[0087] In one embodiment, before S208, it further includes: obtaining a temporary secret key; the temporary secret key is only valid within a preset time period; encrypting the data in the fields of the target data table with the temporary secret key to obtain encrypted data; S208 specifically includes: synchronizing the encrypted data to the data center.
[0088] Among them, the temporary secret key is a secret key that is only valid within a preset time period and is used to encrypt the synchronized data. For example, the temporary secret key is only valid within a preset one hour. The server encrypts the data in the fields of the target data table with the temporary secret key and uploads the encrypted data to the data center. The server can complete data synchronization within the preset time period, and the secret key becomes invalid after the preset time period, thus avoiding security problems caused by the leakage of the secret key.
[0089] In the above embodiment, the server encrypts the data in the fields of the target data table with the temporary secret key and synchronizes the encrypted data to the data center, thus ensuring the security of data transmission. And since the temporary secret key is used for data encryption and the temporary secret key becomes invalid automatically after the preset time period, no security problem will occur even if the secret key is leaked.
[0090] In one embodiment, before S208, it further includes: extracting the field identifiers to be synchronized from the synchronization configuration data; S208 specifically includes: selecting the fields to be synchronized corresponding to the field identifiers to be synchronized in the fields of the target data table; synchronizing the data in the fields to be synchronized to the data center.
[0091] Among them, a field is a column in a data table, and each field has a corresponding field identifier. The field identifier is a flag used to identify a field and can be composed of one or more of numbers, characters, letters, or special symbols. For example, the field identifier can be FID, FDate, etc. For example, the first column in the data table is the "Name" field, the second column is the "Date" field, etc., and "Name" and "Date" are the field identifiers for the corresponding columns respectively. The server selects the fields to be synchronized corresponding to the field identifiers to be synchronized in the fields of the target data table and synchronizes the data in the fields to be synchronized to the data center. For example, the server selects the "Document Number" field, "Modification Date" field, and "Sales Organization" field in the target data table and synchronizes the data in the selected fields to the data center.
[0092] In the above embodiment, the server extracts the field identifiers to be synchronized from the synchronization configuration data, selects the fields to be synchronized corresponding to the field identifiers to be synchronized in the fields of the target data table, and synchronizes the data in the fields to be synchronized to the data center. Thus, the fields to be synchronized can be quickly determined according to the synchronization configuration data, improving the efficiency of data synchronization.
[0093] In one embodiment, as Figure 9 shown, multiple business systems are deployed in the SaaS (Software-as-a-Service) platform. Each business system can be deployed in the same public cloud or in different public clouds, and the data generated in each business system is stored in the corresponding business database. The server extracts data from the business databases corresponding to each business system through a unified data synchronization tool.
[0094] The data synchronization tool obtains the metadata of the target business entity based on the target domain model used to define the target business entity and sends the metadata to the synchronization configuration terminal. The synchronization configuration terminal generates synchronization configuration data according to the metadata and feeds back the synchronization configuration data to the data synchronization tool. The data synchronization tool extracts the data table identifiers to be synchronized and the field identifiers to be synchronized from the synchronization configuration data, and selects the fields to be synchronized corresponding to the field identifiers to be synchronized in the data table corresponding to the data table identifier to be synchronized. The data synchronization tool extracts the data in the fields to be synchronized from the business databases of the business systems through the WebAPI of each business system respectively, stores the extracted data in the cache data table, and then synchronizes the data in the cache data table to the data center.
[0095] In the above embodiments, the server can extract data from the business databases of business systems deployed in different public clouds through a unified data synchronization tool. Thus, when the business systems do not open external network access, there is no need to deploy a set of data centers in each public cloud. That is, the data in each business system can be synchronized to a unified data center through the data synchronization tool. And the data synchronization tool extracts data from the business database through WebAPI instead of directly accessing the business database, which improves data security.
[0096] In one embodiment, as Figure 10 shown, the data synchronization method includes the following steps:
[0097] S1002, in response to a selection operation for a candidate domain model, select a target domain model from the candidate domain models, and display all business entities defined by the target domain model.
[0098] S1004, in response to a selection operation for a business entity, select a target business entity from the business entities.
[0099] S1006, extract metadata of the target business entity in the target domain model.
[0100] S1008, send the metadata to a synchronization configuration terminal.
[0101] S1010, receive synchronization configuration data generated by the synchronization configuration terminal according to the metadata.
[0102] S1012, in the received synchronization configuration data, extract the identification of the data table to be synchronized and the identification of the field to be synchronized.
[0103] S1014, in the data tables of the business database, select the target data table corresponding to the identification of the data table to be synchronized.
[0104] S1016, in the fields of the target data table, select the field to be synchronized corresponding to the identification of the field to be synchronized.
[0105] S1018, through the data synchronization tool, use the application programming interface to extract data in the field to be synchronized from the business database.
[0106] S1020, store the extracted data in a cache data table, and synchronize the data in the cache data table to the data center.
[0107] The specific content of the above S1002 to S1020 can refer to the specific implementation process described above.
[0108] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0109] Based on the same inventive concept, an embodiment of the present application further provides a data synchronization device for implementing the data synchronization method involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the data synchronization device provided below can refer to the limitations on the data synchronization method in the above text, and will not be repeated here.
[0110] In one embodiment, as Figure 11 shown, a data synchronization device is provided, including: an acquisition module 1102, an extraction module 1104, a selection module 1106, and a synchronization module 1108, where:
[0111] The acquisition module 1102 is configured to, in response to a data synchronization operation for a target business entity, acquire metadata of the target business entity from a target domain model for defining the target business entity;
[0112] The extraction module 1104 is configured to extract an identifier of a data table to be synchronized from the synchronization configuration data generated according to the metadata;
[0113] The selection module 1106 is configured to select a target data table corresponding to the identifier of the data table to be synchronized from the data tables in the business library;
[0114] The synchronization module 1108 is configured to synchronize the data in the fields of the target data table to the data center.
[0115] In the above embodiments, in response to a data synchronization operation for a target business entity, metadata of the target business entity is obtained from a target domain model used to define the target business entity. Since the target business entity is defined in the target domain model, the data tables included in the target business entity can be determined through the metadata of the target business entity. Thus, synchronization configuration can be performed according to the metadata of the target business entity to generate synchronization configuration data, and the data tables that need to be synchronized can be determined based on the synchronization configuration data. In the synchronization configuration data generated according to the metadata, the identifiers of the data tables to be synchronized are extracted. In the data tables of the business database, the target data tables corresponding to the identifiers of the data tables to be synchronized are selected, and the data in the fields of the target data tables is synchronized to the data center. Thus, the data tables that need to be synchronized can be quickly determined. Compared with determining the data to be synchronized based on the association relationships between data tables, the efficiency of data synchronization is improved, and omission of data tables can be avoided, with higher accuracy. In addition, since the data tables associated with each business entity are defined in the domain model, the association relationships between data tables are presented more intuitively, making the data in the synchronized data tables more readable.
[0116] In one embodiment, the obtaining module 1102 is further configured to:
[0117] In response to a selection operation for a candidate domain model, select a target domain model from the candidate domain models, and display all business entities defined by the target domain model;
[0118] In response to a selection operation for a business entity, select a target business entity from the business entities;
[0119] Extract the metadata of the target business entity from the target domain model.
[0120] In one embodiment, the extraction module 1104 is further configured to:
[0121] Send the metadata to a synchronization configuration terminal;
[0122] Receive the synchronization configuration data generated by the synchronization configuration terminal according to the metadata;
[0123] Extract the identifiers of the data tables to be synchronized from the received synchronization configuration data.
[0124] In one embodiment, as Figure 12 shown, the apparatus further includes:
[0125] An extraction module 1110 extracts the data in the fields of the target data tables from the business database by using an application programming interface;
[0126] A storage module 1112 is configured to store the extracted data in a cached data table;
[0127] The synchronization module 1108 is further configured to synchronize the data in the cached data table to the data center.
[0128] In one embodiment, the business library and the data center are respectively deployed in different public clouds.
[0129] In one embodiment, the apparatus further includes:
[0130] The acquisition module 1102 is further configured to acquire a temporary secret key; the temporary secret key is only valid within a preset time period;
[0131] The encryption module 1114 is configured to encrypt the data in the fields of the target data table through the temporary secret key to obtain encrypted data;
[0132] The synchronization module 1108 is further configured to synchronize the encrypted data to the data center.
[0133] In one embodiment, the apparatus further includes:
[0134] The extraction module 1104 is further configured to extract the field identifiers to be synchronized from the synchronization configuration data;
[0135] The synchronization module 1108 is further configured to select the fields to be synchronized corresponding to the field identifiers to be synchronized in the fields of the target data table; synchronize the data in the fields to be synchronized to the data center.
[0136] Each module in the above data synchronization apparatus can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or stored in a memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0137] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 13As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data synchronization data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. The computer program, when executed by the processor, implements a data synchronization method.
[0138] Those skilled in the art can understand that Figure 13 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0139] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented: in response to a data synchronization operation for a target business entity, obtain the metadata of the target business entity from the target domain model for defining the target business entity; extract the identifier of the data table to be synchronized in the synchronization configuration data generated according to the metadata; select the target data table corresponding to the identifier of the data table to be synchronized in the data tables of the business library; synchronize the data in the fields of the target data table to the data center.
[0140] In one embodiment, when the processor executes the computer program, the following steps are further implemented: in response to a selection operation for a candidate domain model, select a target domain model in the candidate domain model and display all business entities defined by the target domain model; in response to a selection operation for a business entity, select a target business entity in the business entity; extract the metadata of the target business entity in the target domain model.
[0141] In one embodiment, when the processor executes the computer program, the following steps are further implemented: send the metadata to a synchronization configuration terminal; receive the synchronization configuration data generated by the synchronization configuration terminal according to the metadata; extract the identifier of the data table to be synchronized in the received synchronization configuration data.
[0142] In one embodiment, when the processor executes the computer program, the following steps are further implemented: extracting data in the fields of the target data table from the business library by using the application programming interface; storing the extracted data into a cache data table; synchronizing the data in the cache data table to the data center.
[0143] In one embodiment, the business library and the data center are respectively deployed in different public clouds.
[0144] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining a temporary secret key; the temporary secret key is only valid within a preset time period; encrypting the data in the fields of the target data table by using the temporary secret key to obtain encrypted data; synchronizing the encrypted data to the data center.
[0145] In one embodiment, when the processor executes the computer program, the following steps are further implemented: extracting the to-be-synchronized field identifier from the synchronization configuration data; selecting the to-be-synchronized field corresponding to the to-be-synchronized field identifier in the fields of the target data table; synchronizing the data in the to-be-synchronized field to the data center.
[0146] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: in response to a data synchronization operation for a target business entity, obtaining metadata of the target business entity from a target domain model for defining the target business entity; extracting a to-be-synchronized data table identifier from the synchronization configuration data generated according to the metadata; selecting a target data table corresponding to the to-be-synchronized data table identifier in the data tables of the business library; synchronizing the data in the fields of the target data table to the data center.
[0147] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: in response to a selection operation for a candidate domain model, selecting a target domain model in the candidate domain model and displaying all business entities defined by the target domain model; in response to a selection operation for a business entity, selecting a target business entity in the business entity; extracting metadata of the target business entity in the target domain model.
[0148] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: sending the metadata to a synchronization configuration terminal; receiving the synchronization configuration data generated by the synchronization configuration terminal according to the metadata; extracting the to-be-synchronized data table identifier from the received synchronization configuration data.
[0149] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: extracting data in the fields of the target data table from the business library by using the application programming interface; storing the extracted data into a cache data table; synchronizing the data in the cache data table to the data center.
[0150] In one embodiment, the service library and the data center are respectively deployed in different public clouds.
[0151] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: obtaining a temporary secret key; the temporary secret key is only valid within a preset time period; encrypting the data in the fields of the target data table through the temporary secret key to obtain encrypted data; synchronizing the encrypted data to the data center.
[0152] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: extracting the field identifiers to be synchronized from the synchronization configuration data; in the fields of the target data table, selecting the fields to be synchronized corresponding to the field identifiers to be synchronized; synchronizing the data in the fields to be synchronized to the data center.
[0153] In one embodiment, a computer program product is provided, including a computer program, which when executed by a processor implements the following steps: in response to a data synchronization operation for a target business entity, obtaining metadata of the target business entity from a target domain model for defining the target business entity; in the synchronization configuration data generated according to the metadata, extracting the data table identifier to be synchronized; in the data tables of the service library, selecting the target data table corresponding to the data table identifier to be synchronized; synchronizing the data in the fields of the target data table to the data center.
[0154] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: in response to a selection operation for a candidate domain model, selecting a target domain model in the candidate domain model and displaying all business entities defined by the target domain model; in response to a selection operation for a business entity, selecting a target business entity in the business entity; extracting metadata of the target business entity in the target domain model.
[0155] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: sending the metadata to a synchronization configuration terminal; receiving the synchronization configuration data generated by the synchronization configuration terminal according to the metadata; extracting the data table identifier to be synchronized in the received synchronization configuration data.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: through a data synchronization tool, using an application programming interface, extracting the data in the fields of the target data table from the service library; storing the extracted data in a cache data table; synchronizing the data in the cache data table to the data center.
[0157] In one embodiment, for at least two service libraries, each service library is respectively deployed in different public clouds.
[0158] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: obtaining a temporary secret key; the temporary secret key is only valid within a preset time period; encrypting the data in the fields of the target data table through the temporary secret key to obtain encrypted data; and synchronizing the encrypted data to the data center.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: extracting the field identifier to be synchronized from the synchronization configuration data; selecting the field to be synchronized corresponding to the field identifier to be synchronized in the fields of the target data table; and synchronizing the data in the field to be synchronized to the data center.
[0160] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.
[0161] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include Read-Only Memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0162] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0163] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A data synchronization method, characterized in that, the method includes: In response to a selection operation for a candidate domain model, select a target domain model from the candidate domain models, and display all business entities defined by the target domain model; In response to a selection operation for the business entity, select a target business entity from the business entities; In the target domain model, extract metadata of the target business entity; In the synchronization configuration data generated according to the metadata, extract the identifier of the data table to be synchronized; In the data tables of the business library, select the target data table corresponding to the identifier of the data table to be synchronized; Synchronize the data in the fields of the target data table to the data center.
2. The method according to claim 1, characterized in that, the extracting the identifier of the data table to be synchronized in the synchronization configuration data generated according to the metadata includes: Send the metadata to a synchronization configuration terminal; Receive the synchronization configuration data generated by the synchronization configuration terminal according to the metadata; In the received synchronization configuration data, extract the identifier of the data table to be synchronized.
3. The method according to claim 1, characterized in that, the method further includes: Using an application programming interface, extract the data in the fields of the target data table from the business library; Store the extracted data in a cached data table; the synchronizing the data in the fields of the target data table to the data center includes: Synchronize the data in the cached data table to the data center.
4. The method according to any one of claims 1 to 3, characterized in that, the business library and the data center are respectively deployed in different public clouds.
5. The method according to claim 1, characterized in that, the method further includes: Obtain a temporary secret key; the temporary secret key is only valid within a preset time period; Encrypt the data in the fields of the target data table through the temporary secret key to obtain encrypted data; the synchronizing the data in the fields of the target data table to the data center includes: Synchronize the encrypted data to the data center.
6. The method according to claim 1, characterized in that, the method further includes: Extract the identifier of the field to be synchronized from the synchronization configuration data; the synchronizing the data in the fields of the target data table to the data center includes: In the fields of the target data table, select the field to be synchronized corresponding to the identifier of the field to be synchronized; Synchronize the data in the field to be synchronized to the data center.
7. A data synchronization device, characterized in that, the device includes: An acquisition module, configured to, in response to a selection operation for a candidate domain model, select a target domain model from the candidate domain models, and display all business entities defined by the target domain model; in response to a selection operation for the business entity, select a target business entity from the business entities; in the target domain model, extract metadata of the target business entity; An extraction module, configured to extract the identifier of the data table to be synchronized from the synchronization configuration data generated according to the metadata; A selection module, configured to select a target data table corresponding to the to-be-synchronized data table identifier from the data tables in the business library; A synchronization module, configured to synchronize the data in the fields of the target data table to the data center.
8. A computer device, including a memory and a processor, where the memory stores a computer program, characterized in that, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, including a computer program, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Data exchange method and system based on data link dynamic construction
CN112035494A
Metadata reusable data modeling method and system
CN114064611A