A data synchronization method and related apparatus
By using timestamps for incremental data synchronization through the customer experience platform, the network consumption and cost issues caused by third-party integration tools have been resolved, achieving efficient data transmission and processing.
Patent Information
- Application Number
- CN202411716960.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-11-27
AI Technical Summary
In existing technologies, data synchronization through third-party integration tools can easily increase network bandwidth consumption and data processing pressure, and also incur significant costs.
The customer experience platform sends a data acquisition request to the target data source. The request includes a first timestamp to indicate the time of the last synchronization. The system receives and responds to data synchronization requests, performs incremental data synchronization, and updates data using timestamps to reduce the transmission of full data.
Incremental data synchronization reduces network bandwidth consumption and data processing pressure, decreases data synchronization time and resource costs, and avoids the use of third-party integration tools.
Smart Images

Figure CN119544728B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, and in particular, to a data synchronization method and related apparatus. BACKGROUND
[0002] In the current digital era, customer experience is crucial in the field of finance, for example, analyzing customer experience data such as customer suggestions and feelings for credit cards in the financial field helps to improve products and services.
[0003] Customer experience data can be scattered in different data sources, for example, customer experience data related to credit cards can be scattered in data sources of a sales management system, data sources of a customer relationship management system, and data sources of a UnionPay platform, etc. Currently, the data of these different data sources can be synchronized through a third-party integration tool. However, the third-party integration tool will synchronize the data of different data sources in full, that is, in the case that the data of any data source has changed, the third-party integration tool will synchronize all the data of the data source, on the one hand, it is easy to increase network bandwidth consumption and data processing pressure, on the other hand, using the third-party integration tool will also cause additional cost overhead. SUMMARY
[0004] Therefore, the embodiments of the present application provide a data synchronization method and related apparatus, which aims to reduce network bandwidth consumption and data processing pressure in the process of data synchronization, and also reduce the cost overhead caused by using a third-party integration tool.
[0005] In a first aspect, the embodiments of the present application provide a data synchronization method applied to a customer experience platform, the method comprising:
[0006] sending a data acquisition request to an electronic device comprising a target data source;
[0007] The data acquisition request comprises a first timestamp, the first timestamp is used to indicate the time of the last data synchronization from the target data source, and the data acquisition request is used to indicate that the electronic device determines the to-be-synchronized data included in the target data source based on the first timestamp; the target data source is used to store financial business data;
[0008] receiving a data synchronization request sent by the electronic device; the data synchronization request comprises to-be-synchronized data included in the target data source and a second timestamp, the second timestamp is used to indicate the time when the latest data in the to-be-synchronized data is updated;
[0009] In response to receiving the data synchronization request, performing data synchronization based on the to-be-synchronized data, and updating the first timestamp to the second timestamp.
[0010] In a possible implementation, the data synchronization method further includes:
[0011] establishing a connection with the target data source;
[0012] establishing a standard data structure;
[0013] mapping a target data structure of the target data source to the standard data structure to obtain a mapping relationship between the target data structure and the standard data structure.
[0014] In a possible implementation, the data synchronization based on the to-be-synchronized data includes:
[0015] mapping a target data structure of the to-be-synchronized data to a standard data structure based on the mapping relationship between the target data structure and the standard data structure;
[0016] determining that the mapped to-be-synchronized data includes to-be-added data, and adding the to-be-added data to a database of the customer experience platform;
[0017] determining that the mapped to-be-synchronized data includes to-be-modified data, and modifying original data included in the database based on the to-be-modified data, the to-be-modified data corresponding to the original data.
[0018] In a possible implementation, the to-be-synchronized data includes first to-be-synchronized data and second to-be-synchronized data, the first to-be-synchronized data and the second to-be-synchronized data both corresponding to a same target original data of a database of the customer experience platform; the first to-be-synchronized data corresponds to a first transaction, and the second to-be-synchronized data corresponds to a second transaction, a time of a data synchronization request of the first transaction being earlier than a time of a data synchronization request of the second transaction; the data synchronization based on the to-be-synchronized data includes:
[0019] acquiring, by the first transaction and the second transaction, a timestamp corresponding to the target original data;
[0020] determining, by the first transaction, that the acquired timestamp is the same as a timestamp currently corresponding to the target original data, performing data synchronization on the target original data based on the first to-be-synchronized data, and updating the timestamp corresponding to the target original data based on the timestamp corresponding to the first to-be-synchronized data;
[0021] determining, by the second transaction, that the acquired timestamp is different from the timestamp currently corresponding to the target original data, and rejecting the data synchronization request of the second transaction.
[0022] In a possible implementation, the sending of the data acquisition request to the electronic device comprising the target data source comprises:
[0023] The data acquisition request is sent to the electronic device comprising the target data source according to a preset period.
[0024] In a second aspect, an embodiment of the present application provides a data synchronization method applied to an electronic device, the electronic device comprising a target data source, and the method comprises:
[0025] receiving a data acquisition request sent by a customer experience platform;
[0026] The data acquisition request comprises a first timestamp, the first timestamp is used to indicate a time when the customer experience platform last synchronizes data from the target data source, and the data acquisition request is used to indicate that the electronic device determines, based on the first timestamp, that the target data source comprises to-be-synchronized data; and the target data source is used to store financial business data.
[0027] In response to receiving the data acquisition request, determining a third timestamp corresponding to the latest data from the target data source;
[0028] If the third timestamp is later than the first timestamp, the third timestamp is taken as a second timestamp, and data with a timestamp later than the first timestamp from the target data source is taken as the to-be-synchronized data;
[0029] sending a data synchronization request to the customer experience platform; the data synchronization request comprises the to-be-synchronized data and the second timestamp.
[0030] In a possible implementation, the data processing method further comprises:
[0031] If the third timestamp is earlier than the first timestamp, sending, to the customer experience platform, indication information used to indicate that the target data source does not have to-be-synchronized data.
[0032] In a third aspect, an embodiment of the present application provides a data synchronization system, the data synchronization system comprising a customer experience platform and an electronic device, the electronic device comprising a target data source;
[0033] The customer experience platform is configured to send a data acquisition request to the electronic device comprising the target data source;
[0034] The data acquisition request includes a first timestamp, the first timestamp is used to indicate a time of last synchronization of data from the target data source, and the data acquisition request is used to indicate that the electronic device determines that the target data source includes to-be-synchronized data based on the first timestamp; and the target data source is used to store financial business data.
[0035] The electronic device is configured to receive a data acquisition request sent by the customer experience platform.
[0036] The electronic device is configured to determine a third timestamp corresponding to the latest data in the target data source in response to receiving the data acquisition request.
[0037] The electronic device is configured to determine that the third timestamp is later than the first timestamp, take the third timestamp as the second timestamp, and take data with a timestamp later than the first timestamp in the target data source as the to-be-synchronized data.
[0038] The electronic device is configured to send a data synchronization request to the customer experience platform, the data synchronization request including the to-be-synchronized data and the second timestamp.
[0039] The customer experience platform is configured to receive the data synchronization request sent by the electronic device, and the second timestamp is used to indicate a time at which the latest data in the to-be-synchronized data is updated.
[0040] The customer experience platform is configured to perform data synchronization based on the to-be-synchronized data and update the first timestamp to the second timestamp in response to receiving the data synchronization request.
[0041] In a fourth aspect, an embodiment of the present application provides a data synchronization device, the device including a memory and a processor.
[0042] The memory is configured to store a computer program and transmit the computer program to the processor.
[0043] The processor is configured to execute the computer program to enable the device to perform the data synchronization method of the first aspect.
[0044] In a fifth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, and when the computer program is executed, a device executing the computer program implements the data synchronization method of the first aspect.
[0045] Compared with the prior art, the embodiment of the present application has the following beneficial effects:
[0046] The embodiment of the present application provides a data synchronization method and a related device, which are applied to a customer experience platform, in the method, the customer experience platform first sends a data acquisition request to an electronic device including a target data source; wherein the data acquisition request includes a first timestamp, the first timestamp is used for indicating the time when the customer experience platform last synchronizes data from the target data source, and the data acquisition request is used for instructing the electronic device to determine the to-be-synchronized data included by the target data source based on the first timestamp; and the target data source is used for storing financial business data. Then, the customer experience platform receives a data synchronization request sent by the electronic device, the data synchronization request includes the to-be-synchronized data included by the target data source and a second timestamp, the second timestamp is used for indicating the time when the latest data in the to-be-synchronized data is updated; and subsequently, the customer experience platform can perform data synchronization based on the to-be-synchronized data and update the first timestamp to the second timestamp in response to receiving the data synchronization request.
[0047] In this way, the first timestamp can represent the time when the customer experience platform last synchronizes data from the target data source, the customer experience platform can determine the incremental data generated by the target data source compared with the last synchronization data based on the first timestamp, and then incremental synchronization can be performed accordingly. Therefore, the data synchronization method provided by the present application can reduce the data transmission amount during data synchronization, and further reduce network bandwidth consumption and data processing pressure, on the basis of ensuring accurate data synchronization.
[0048] In addition, only the incremental data changed in the target data source needs to be transmitted, which can also reduce the time and resource cost of data synchronization. Moreover, the third-party integration tool is no longer needed for data synchronization, and cost expenditure can be reduced. BRIEF DESCRIPTION OF DRAWINGS
[0049] To make the technical solutions in the embodiments or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only constitute some embodiments of the present application, and other accompanying drawings can be obtained by those skilled in the art without any creative effort.
[0050] Figure 1 An application scenario of the data synchronization method provided by the embodiment of the present application;
[0051] Figure 2 A flowchart of the data synchronization method provided by the embodiment of the present application;
[0052] Figure 3 A schematic diagram of the data stored in the target data source provided by the embodiment of the present application;
[0053] Figure 4 A schematic diagram of a concurrent update processing mechanism provided by an embodiment of the present application;
[0054] Figure 5 A flowchart of another data synchronization method provided by an embodiment of the present application;
[0055] Figure 6 A schematic diagram of a data synchronization method provided by an embodiment of the present application;
[0056] Figure 7 A structural schematic diagram of a data synchronization system provided by an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work fall within the scope of protection of the present application.
[0058] At present, the existing data synchronization method is to synchronize the data of the data source by using a third-party integration tool. In the case that the data of the data source changes, the data of the data source needs to be synchronized in full. On the one hand, this is likely to increase network bandwidth consumption and data processing pressure, and on the other hand, the use of the third-party integration tool will also cause additional cost overhead.
[0059] Based on this, in order to solve the above problems, the present application provides a data synchronization method and related device, which are applied to a customer experience platform. In the method, the customer experience platform first sends a data acquisition request to an electronic device including a target data source; wherein the data acquisition request includes a first timestamp, the first timestamp is used to indicate the time when the customer experience platform last synchronizes data from the target data source, and the data acquisition request is used to instruct the electronic device to determine the to-be-synchronized data included in the target data source based on the first timestamp; the target data source is used to store financial business data. Then, the customer experience platform receives a data synchronization request sent by the electronic device, the data synchronization request includes the to-be-synchronized data included in the target data source and a second timestamp, the second timestamp is used to indicate the time when the latest data in the to-be-synchronized data is updated; subsequently, the customer experience platform can perform data synchronization based on the to-be-synchronized data in response to receiving the data synchronization request, and update the first timestamp to the second timestamp.
[0060] Thus, the first timestamp can represent a time when the customer experience platform last synchronizes data from the target data source, and the customer experience platform can determine, based on the first timestamp, incremental data generated by the target data source since the last synchronization, and then can perform targeted incremental synchronization. Therefore, the data synchronization method provided in this application can ensure accurate data synchronization, and only needs to transmit incremental data that has changed in the target data source, thereby reducing the amount of data transmission during data synchronization, and further reducing network bandwidth consumption and data processing pressure.
[0061] In addition, only the incremental data that has changed in the target data source needs to be transmitted, which can also reduce the time and resource cost of data synchronization. Moreover, the data synchronization no longer needs to be performed through a third-party integration tool, thereby reducing the cost overhead.
[0062] For example, the embodiments of the application can be applied to the scenario as shown in FIG. 1. Figure 1 The scenario includes a customer experience platform 101 and a server 102. The server 102 can include a target data source, and the customer experience platform 101 can be deployed on a terminal device or a server. The customer experience platform 101 can perform data synchronization with the target data source included in the server 102 by using the embodiments provided in this application. The server 102 can also use the embodiments provided in this application to enable the customer experience platform 101 to perform data synchronization with the target data source.
[0063] The server 102 can be a standalone server, a cluster server, or a cloud server, etc. The terminal device can be a smartphone, a computer, a tablet computer, etc.
[0064] First, in the above application scenario, the server 102 including the target data source is only an example, and the terminal device can also include the target data source. The customer experience platform and the target data source can be deployed on different electronic devices (the electronic devices can include terminal devices and servers, etc.), and the customer experience platform and the target data source can also be deployed on the same terminal device or server.
[0065] Second, the above scenario is only one example of the scenario provided in the embodiments of the application, and the embodiments of the application are not limited to this scenario. For example, there can be multiple target data sources, which are respectively deployed in different electronic devices, and the customer experience platform 101 can perform data synchronization with the multiple target data sources.
[0066] The specific implementation of the data synchronization method and the related apparatus in the embodiments of the application will be described in detail below with reference to the accompanying drawings. Referring to FIG. 2, Figure 2 FIG. 2 is a flowchart of a data synchronization method provided in the embodiments of the application, which is applied to a customer experience platform, and is combined with FIG. 1. Figure 2As shown, the specific embodiments can include:
[0067] S201: The customer experience platform sends a data acquisition request to an electronic device including a target data source.
[0068] In the embodiments of the present application, the target data source can be used to store financial service data. In some embodiments, the financial service data can include credit card service data, savings card service data, etc. For ease of understanding, the data synchronization method provided by the embodiments of the present application is introduced below by taking credit card service data as an example.
[0069] In some embodiments, the target data source can include a customer database, a transaction system, a customer service platform, a marketing channel, etc. These target data sources can provide different types of data about credit card transactions, customer and credit card related data, credit card services, etc.
[0070] As an example, refer to Figure 3 , which is a schematic diagram of data stored by a target data source according to an embodiment of the present application. As Figure 3 shown, the target data source can store credit card transaction data, customer and credit card related data, and credit card service data.
[0071] Among them, the credit card transaction data can include transaction amount, transaction time, and transaction location, etc. credit card transaction record data; the customer and credit card related data can include name, contact information, and credit score, etc. information; the credit card service data can include customer complaints, customer suggestions, and solutions, etc. interaction records between credit card customer service.
[0072] It should be noted that the target data source can include more or less types of data than the above examples, which are not limited by the present application.
[0073] It should be emphasized that in the specific embodiments of the present application, the customer information (including but not limited to customer personal information such as name, contact information) and data (including but not limited to credit card transaction data, credit card service data, etc.) involved are all authorized by the customer or fully authorized by all parties when the above embodiments of the present application are applied to specific products or technologies. The collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0074] Among them, the data acquisition request includes a first timestamp, and the first timestamp is used to indicate the time when the customer experience platform last synchronizes data from the target data source.
[0075] In the next embodiment, each data of the target data source can include a field for recording the time of the last update of the data. Exemplarily, the field can be timestamp, which is not limited in the present application, and is referred to as the timestamp corresponding to the data in the following embodiments, which is used to record the time of the last update of the data.
[0076] In some embodiments, the first timestamp can be used to indicate the timestamp of the latest data in the data synchronized last time from the target data source on the customer experience platform (i.e., the second timestamp mentioned later). Exemplarily, 10 data are synchronized last time, and the timestamps corresponding to the 10 data are t1-t10, t10 being the latest, indicating that the data corresponding to t10 is the latest data of the target data source at the time of the last synchronization, for example, the data modified latest at t10 or the data added latest at t10. Therefore, the first timestamp when the data acquisition request is sent next time can be t10.
[0077] The data acquisition request is used to instruct the electronic device including the target data source to determine the to-be-synchronized data included by the target data source based on the first timestamp, that is, the electronic device can determine the incremental data based on the first timestamp after receiving the data acquisition request, for subsequent incremental synchronization. For specific implementation manners, refer to Figure 5 The corresponding embodiments will not be expanded here.
[0078] In some embodiments, the data acquisition request sent by the customer experience platform to the electronic device can be a GET request based on the Hyper Text Transfer Protocol (HTTP).
[0079] S202: The customer experience platform receives the data synchronization request sent by the electronic device.
[0080] The data synchronization request includes the to-be-synchronized data included by the target data source and a second timestamp, and the second timestamp is used to indicate the time when the latest data in the to-be-synchronized data is updated.
[0081] In the embodiments of the present application, the second timestamp is later than the first timestamp, indicating that the to-be-synchronized data is updated to the target data source after the last synchronization.
[0082] The data synchronization request is used to instruct the customer experience platform to perform data synchronization based on the to-be-synchronized data and update the first timestamp based on the second timestamp.
[0083] For the introduction of the to-be-synchronized data and the second timestamp, refer to the following Figure 5 The corresponding embodiments will not be expanded here.
[0084] S203: Upon receiving the data synchronization request, the customer experience platform performs data synchronization based on the data to be synchronized and updates the first timestamp to the second timestamp.
[0085] In some embodiments, the data to be synchronized can be synchronized to the database of the customer experience platform, and the first timestamp can be updated to the second timestamp to indicate the time of data synchronization from the target data source, indicating that all data in the target data source prior to the latest first timestamp has been synchronized to the customer experience platform.
[0086] In addition, in one possible implementation, the data synchronization method may further include: the customer experience platform establishing a connection with the target data source; the customer experience platform establishing a standard data structure; and the customer experience platform mapping the target data structure of the target data source to the standard data structure to obtain the mapping relationship between the target data structure and the standard data structure.
[0087] Once the customer experience platform connects to the target data source, it can identify the data within the data source, such as the data mentioned above. Figure 3 The presented data is used to analyze and understand the data structure stored in the data source. The customer experience platform can establish a standard data structure (also known as a unified data model) that describes the relationships between credit card transaction data, customer and credit card-related data, credit card service data, etc. The customer experience platform can then obtain the mapping relationship between the target data structure and the standard data structure, enabling the synchronization of data from the target data source to the customer experience platform.
[0088] In some embodiments, this application does not limit the number of target data sources. The target data sources may include multiple target data sources. In this case, the customer experience platform can perform the above operations for each of the multiple target data sources to obtain the mapping relationship between each target data structure and the standard data structure.
[0089] Therefore, considering the inconsistency in data structures stored from different data sources, establishing a unified standard data structure on the customer experience platform facilitates data integration and understanding, and helps improve data synchronization performance.
[0090] In some embodiments, the standard data structure may include standard fields and standard data types, and the target data structure may include target fields and target data types. The following embodiments will use this as an example.
[0091] It should be noted that standard data structures and target data structures may include more or less content than the examples above, and this application does not limit this. For example, they may also include data format, data length, etc.
[0092] In a possible implementation of the present application, the "performing data synchronization based on the to-be-synchronized data" in S203 can include: mapping, by the customer experience platform, a target data structure of the to-be-synchronized data into a standard data structure based on a mapping relationship between the target data structure and the standard data structure; determining, by the customer experience platform, that the mapped to-be-synchronized data includes to-be-added data, and adding the to-be-added data to a database of the customer experience platform; determining, by the customer experience platform, that the mapped to-be-synchronized data includes to-be-modified data, and modifying original data included in the database based on the to-be-modified data, the to-be-modified data corresponding to the original data.
[0093] For example, one data of the to-be-synchronized data includes a field 1, a data type of a value of the field 1 is an integer type, and in the target data structure, the field 1 is used to store a contact of a customer. In the standard data structure, a field 2 is used to store the contact of the customer, and a data type of a value of the field 2 is a floating point type. Therefore, the customer experience platform can first map the field 1 into the field 2, and then map the data type of the value of the field 1 into the floating point type.
[0094] In the case that the data is to-be-added data, the customer experience platform can directly add the data to the database as new data.
[0095] In the case that the data is to-be-modified data, for example, the original data is a contact of a customer, which is 132xxxxxxxx, and the to-be-modified data is a new contact of the customer, which is "188xxxxxxxx". Therefore, the customer experience platform can modify the value of the field 2 of the original data into "188xxxxxxxx".
[0096] Each data (also referred to as each piece of data) has identification information, which is used to identify the data from a plurality of data. The customer experience platform can determine, based on the identification information of the to-be-synchronized data, whether the to-be-synchronized data is to-be-added data or to-be-modified data.
[0097] In a possible implementation of the present application, the to-be-synchronized data includes first to-be-synchronized data and second to-be-synchronized data, the first to-be-synchronized data and the second to-be-synchronized data both correspond to a same target original data of a database of the customer experience platform, the first to-be-synchronized data corresponds to a first transaction, the second to-be-synchronized data corresponds to a second transaction, and a time of a data synchronization request of the first transaction is earlier than a time of a data synchronization request of the second transaction.
[0098] Correspondingly, the "performing data synchronization based on the to-be-synchronized data" in S203 can include: the customer experience platform first acquires the timestamp corresponding to the target original data through the first transaction and the second transaction; the customer experience platform then determines, through the first transaction, that the acquired timestamp is the same as the timestamp currently corresponding to the target original data, performs data synchronization on the target original data based on the first to-be-synchronized data, and updates the timestamp corresponding to the target original data based on the timestamp corresponding to the first to-be-synchronized data; and the customer experience platform then determines, through the second transaction, that the acquired timestamp is different from the timestamp currently corresponding to the target original data, and rejects the data synchronization request of the second transaction.
[0099] For example, the first to-be-synchronized data is to-be-modified data, such as depositing a credit card, increasing the account balance of a customer, and the second to-be-synchronized data is also to-be-modified data, such as withdrawing a credit card, reducing the account balance of the same customer, and therefore the first transaction and the second transaction corresponding to the two pieces of data both need to modify the same target original data.
[0100] For example, as shown in FIG. 2, Figure 4 The figure is a schematic diagram of a concurrent update processing mechanism provided by an embodiment of the present application. The target original data stores an account balance, and the timestamp corresponding to the target original data is timestamp 1. The first transaction and the second transaction both read timestamp 1. The time of the data synchronization request of the first transaction is earlier than the time of the data synchronization request of the second transaction. The first transaction determines that the timestamp corresponding to the target original data is still timestamp 1, and then operation A of the first transaction can be performed, that is, the account balance of the customer is increased, and the timestamp 1 corresponding to the target original data is updated to the timestamp 2 corresponding to the first to-be-synchronized data (which can also be referred to as a save timestamp). Subsequently, the second transaction determines that the timestamp corresponding to the target original data is timestamp 2 (that is, not timestamp 1), and then the data synchronization request of the second transaction can be rejected, that is, operation B does not need to be performed, and a prompt to re-execute the second transaction can be given, that is, re-operation.
[0101] In this way, the concurrent update processing mechanism can effectively process multiple transactions with similar data synchronization request times, ensure the consistency and integrity of the data, reduce data competition and conflict caused by concurrent updates, and help maintain the stability and reliability of the customer experience platform.
[0102] In a possible implementation manner of the present application, S201 can specifically include: the customer experience platform sends a data acquisition request to an electronic device including the target data source multiple times according to a preset period. In some embodiments, the preset period can be 45 minutes or 1 hour, and can be set based on business requirements and the data update frequency of the target data source.
[0103] Different preset periods can be set for different target data sources.
[0104] In this way, compared with the third-party integration tool that performs data synchronization based on pre-configured rules and cannot be modified at any time, the data synchronization method provided in the application can flexibly set the preset period based on business requirements and the data update frequency of different target data sources, can timely capture changes in the target data source, and thus ensures the real-time performance and accuracy of data synchronization.
[0105] In addition, in some embodiments, each data synchronization process can be logged, for example, the execution of polling (i.e., the sending of a data acquisition request according to a preset period) is recorded, whether data synchronization is performed or not, the number of transactions in data synchronization (i.e., the number of data to be synchronized) can also be recorded, abnormal information whether data synchronization is successful, and processing time of data synchronization and the like are recorded for subsequent auditing, troubleshooting and performance optimization.
[0106] Referring to Figure 5 The figure is a flowchart of another data synchronization method provided in the embodiments of the application, applied to an electronic device including a target data source, in combination with Figure 5 As shown in the figure, the method can specifically include the following steps.
[0107] S501: The electronic device receives a data acquisition request sent by a customer experience platform.
[0108] The data acquisition request includes a first timestamp, the first timestamp is used to indicate the time when the customer experience platform last synchronized data from the target data source, and the data acquisition request is used to indicate that the electronic device determines the data to be synchronized included in the target data source based on the first timestamp; and the target data source is used to store financial business data.
[0109] It should be noted that the specific implementation of S501 can refer to the introduction of S201, which will not be described here.
[0110] S502: The electronic device determines a third timestamp corresponding to the latest data from the target data source in response to receiving the data acquisition request.
[0111] In some embodiments, the target data source includes a plurality of data, and each data includes a corresponding timestamp, which is used to indicate the time of the last update of the data.
[0112] Exemplarily, each data includes a field timestamp, and the value of the field timestamp is used to indicate the time of the last update of the data.
[0113] After the electronic device receives the data acquisition request, the electronic device can query the timestamps corresponding to the respective data in the target data source, determine the latest timestamp as the third timestamp, and determine the data corresponding to the third timestamp as the latest data that is most recently updated in the target data source.
[0114] S503: The electronic device determines that the third timestamp is later than the first timestamp, and determines the third timestamp as the second timestamp, and determines the data with a timestamp later than the first timestamp in the target data source as the to-be-synchronized data.
[0115] The electronic device determines that the third timestamp is later than the first timestamp, which indicates that the target data source has been updated, such as data modification or data addition, since the last data synchronization from the target data source on the customer experience platform, and thus the data with a timestamp later than the first timestamp in the target data source is the to-be-synchronized data. Therefore, the third timestamp can be determined as the second timestamp to perform the subsequent steps.
[0116] S504: The electronic device sends a data synchronization request to the customer experience platform.
[0117] The data synchronization request includes the to-be-synchronized data and the second timestamp.
[0118] It should be noted that the specific implementation of S504 can refer to the description of S202, and thus will not be described herein.
[0119] As an example, refer to Figure 6 The figure is a schematic diagram of a data synchronization method provided by an embodiment of the present application. After the electronic device receives a data acquisition request, the electronic device acquires timestamps of respective data in a target data source, determines that there is a timestamp later than a first timestamp, for example, the first timestamp is lastUpdateTime, determines the data with a timestamp later than lastUpdateTime as to-be-synchronized data, and determines the largest timestamp as a second timestamp, for example, the second timestamp is latestSyncTime. Then, the electronic device sends a data synchronization request including the to-be-synchronized data and latestSyncTime to a customer experience platform. The customer experience platform receives the data synchronization request, performs incremental synchronization based on the to-be-synchronized data, updates lastUpdateTime to latestSyncTime, and then records logs of the data synchronization process.
[0120] In addition, in a possible implementation of the present application, the data synchronization method can further include: determining, by the electronic device, that the third timestamp is earlier than the first timestamp, and sending, to the customer experience platform, indication information indicating that the target data source does not have data to be synchronized.
[0121] The determination that the third timestamp is earlier than the first timestamp indicates that the target data source has not been subjected to data update operations such as data modification or data addition since the last data synchronization from the target data source on the customer experience platform, so that data synchronization is not required this time, and therefore the electronic device can send, to the customer experience platform, indication information indicating that the target data source does not have data to be synchronized.
[0122] The above are some specific implementations of the data synchronization method provided by the embodiments of the present application, based on which the present application further provides a corresponding data synchronization system. The data synchronization system provided by the embodiments of the present application will be introduced from the perspective of functional modularization.
[0123] Referring to Figure 7 The figure is a structural schematic diagram of a data synchronization system provided by an embodiment of the present application. The data synchronization system 700 can include a customer experience platform 710 and an electronic device 720, wherein the electronic device 720 includes a target data source.
[0124] The customer experience platform 710 is configured to send a data acquisition request to the electronic device including the target data source.
[0125] The data acquisition request includes a first timestamp, and the first timestamp is used to indicate the time of the last data synchronization from the target data source. The data acquisition request is used to instruct the electronic device to determine the data to be synchronized included in the target data source based on the first timestamp. The target data source is used to store financial business data.
[0126] The electronic device 720 is configured to receive the data acquisition request sent by the customer experience platform.
[0127] The electronic device 720 is configured to determine, in response to receiving the data acquisition request, a third timestamp corresponding to the latest data in the target data source.
[0128] The electronic device 720 is configured to determine that the third timestamp is later than the first timestamp, take the third timestamp as the second timestamp, and take the data with a timestamp later than the first timestamp in the target data source as the data to be synchronized.
[0129] The electronic device 720 is configured to send a data synchronization request to the customer experience platform; the data synchronization request comprises the to-be-synchronized data and the second timestamp.
[0130] The customer experience platform 710 is configured to receive the data synchronization request sent by the electronic device; the second timestamp is used to indicate the time when the latest data in the to-be-synchronized data is updated.
[0131] The customer experience platform 710 is configured to, in response to receiving the data synchronization request, perform data synchronization based on the to-be-synchronized data, and update the first timestamp to the second timestamp.
[0132] As an implementation manner, the customer experience platform 710 is further configured to: establish a connection with a target data source; establish a standard data structure; and map a target data structure of the target data source to the standard data structure to obtain a mapping relationship between the target data structure and the standard data structure.
[0133] As an implementation manner, the customer experience platform 710 is specifically configured to:
[0134] map the target data structure of the to-be-synchronized data to a standard data structure based on the mapping relationship between the target data structure and the standard data structure;
[0135] determine that the mapped to-be-synchronized data comprises to-be-added data, and add the to-be-added data to a database of the customer experience platform;
[0136] determine that the mapped to-be-synchronized data comprises to-be-modified data, and modify original data comprised in the database based on the to-be-modified data, the to-be-modified data corresponding to the original data.
[0137] As an implementation manner, the to-be-synchronized data comprises first to-be-synchronized data and second to-be-synchronized data, the first to-be-synchronized data and the second to-be-synchronized data both corresponding to a same target original data of a database of the customer experience platform; the first to-be-synchronized data corresponds to a first transaction, and the second to-be-synchronized data corresponds to a second transaction, a time of a data synchronization request of the first transaction being earlier than a time of a data synchronization request of the second transaction; the customer experience platform 710 is specifically configured to:
[0138] obtain a timestamp corresponding to the target original data through the first transaction and the second transaction;
[0139] In the first transaction, it is determined that the obtained timestamp is the same as the timestamp currently corresponding to the target raw data, and then data synchronization is performed on the target raw data based on the first to-be-synchronized data, and the timestamp corresponding to the target raw data is updated based on the timestamp corresponding to the first to-be-synchronized data.
[0140] In the second transaction, it is determined that the obtained timestamp is different from the timestamp currently corresponding to the target raw data, and then the data synchronization request of the second transaction is rejected.
[0141] As an implementation manner, the customer experience platform 710 is specifically configured to:
[0142] According to a preset period, a data acquisition request is sent to an electronic device including the target data source multiple times.
[0143] As an implementation manner, the electronic device 720 is specifically configured to:
[0144] When it is determined that the third timestamp is earlier than the first timestamp, the electronic device sends indication information indicating that there is no to-be-synchronized data in the target data source to the customer experience platform.
[0145] The application also provides a corresponding data synchronization device and a computer readable storage medium, which are used to implement the scheme provided in the application.
[0146] The data synchronization device includes a memory and a processor, the memory is configured to store a computer program, and the processor is configured to execute the computer program, so that the device executes the data synchronization method provided in any embodiment of the application.
[0147] The computer readable storage medium stores a computer program, and when the computer program is executed, the device executing the computer program implements the data synchronization method provided in any embodiment of the application.
[0148] The "first" and "second" in the names mentioned in the embodiments of the application are only used for name identification, and do not represent the first and second in order.
[0149] Those skilled in the art can clearly understand that all or part of the steps of the above-mentioned method in the embodiments can be implemented by means of software plus a general hardware platform, from the description of the above-mentioned embodiments. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product. The computer software product can be stored in a readable storage medium, such as a read-only memory (English: read-only memory, ROM) / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network communication device such as a router) execute the method described in each embodiment or some parts of the embodiments of the present application.
[0150] It should be noted that each of the embodiments in the specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts refer to the part of the description of the method embodiments. The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separated, and the components prompted as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. According to the actual needs, some or all of the modules can be selected to achieve the purpose of the present embodiment. Those skilled in the art can understand and implement it without creative labor.
[0151] The above is only one specific embodiment of the present application, but the protection scope of the present application is not limited to this. Any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data synchronization method, characterized by, Applied to a customer experience platform, comprising: sending a data acquisition request to an electronic device comprising a target data source; wherein the data acquisition request comprises a first timestamp, the first timestamp being used to indicate the time of the last synchronization of data from the target data source, and the data acquisition request being used to instruct the electronic device to determine the to-be-synchronized data included in the target data source based on the first timestamp; the target data source is used to store financial business data; receiving a data synchronization request sent by the electronic device; the data synchronization request comprises to-be-synchronized data included in the target data source and a second timestamp, the second timestamp being used to indicate the time when the latest data in the to-be-synchronized data is updated; in response to receiving the data synchronization request, performing data synchronization based on the to-be-synchronized data, and updating the first timestamp to the second timestamp.
2. The method of claim 1, wherein, Also comprising: establishing a connection with the target data source; establishing a standard data structure; mapping the target data structure of the target data source to the standard data structure to obtain the mapping relationship between the target data structure and the standard data structure.
3. The method of claim 2, wherein, The data synchronization based on the to-be-synchronized data comprises: mapping the target data structure of the to-be-synchronized data to a standard data structure based on the mapping relationship between the target data structure and the standard data structure; determining that the mapped to-be-synchronized data includes to-be-added data, and adding the to-be-added data to the database of the customer experience platform; determining that the mapped to-be-synchronized data includes to-be-modified data, and modifying the original data included in the database based on the to-be-modified data, the to-be-modified data corresponding to the original data.
4. The method of claim 1, wherein, The to-be-synchronized data comprises first to-be-synchronized data and second to-be-synchronized data, and the first to-be-synchronized data and the second to-be-synchronized data both correspond to the same target original data of the database of the customer experience platform; The first to-be-synchronized data corresponds to a first transaction, and the second to-be-synchronized data corresponds to a second transaction, and the time of the data synchronization request of the first transaction is earlier than the time of the data synchronization request of the second transaction; The data synchronization based on the to-be-synchronized data comprises: acquiring the timestamp corresponding to the target original data through the first transaction and the second transaction; through the first transaction, it is determined that the acquired timestamp is the same as the timestamp currently corresponding to the target original data, then the target original data is synchronized based on the first to-be-synchronized data, and the timestamp corresponding to the target original data is updated based on the timestamp corresponding to the first to-be-synchronized data; through the second transaction, it is determined that the acquired timestamp is different from the timestamp currently corresponding to the target original data, then the data synchronization request of the second transaction is rejected.
5. The method according to any one of claims 1 to 4, characterized in that, The sending of the data acquisition request to the electronic device comprising a target data source comprises: sending a data acquisition request to an electronic device comprising the target data source according to a preset period.
6. A data synchronization method, characterized by, Applied to an electronic device, the electronic device comprising a target data source, comprising: receiving a data acquisition request sent by a customer experience platform; The data acquisition request includes a first timestamp, the first timestamp is used to indicate a time when the customer experience platform last synchronizes data from the target data source, and the data acquisition request is used to instruct the electronic device to determine, based on the first timestamp, that the target data source includes to-be-synchronized data. In response to receiving the data acquisition request, a third timestamp corresponding to the latest data in the target data source is determined. If the third timestamp is later than the first timestamp, the third timestamp is taken as the second timestamp, and data with a timestamp later than the first timestamp in the target data source is taken as the to-be-synchronized data. A data synchronization request is sent to the customer experience platform, and the data synchronization request includes the to-be-synchronized data and the second timestamp.
7. The method of claim 6, wherein, Further comprising: If the third timestamp is earlier than the first timestamp, indication information indicating that the target data source does not have to-be-synchronized data is sent to the customer experience platform.
8. A data synchronization system, characterized by The data synchronization system includes a customer experience platform and an electronic device, and the electronic device includes a target data source. The customer experience platform is configured to send a data acquisition request to the electronic device including the target data source. The data acquisition request includes a first timestamp, the first timestamp is used to indicate a time when the customer experience platform last synchronizes data from the target data source, and the data acquisition request is used to instruct the electronic device to determine, based on the first timestamp, that the target data source includes to-be-synchronized data. The electronic device is configured to receive the data acquisition request sent by the customer experience platform. In response to receiving the data acquisition request, the electronic device is configured to determine a third timestamp corresponding to the latest data in the target data source. If the third timestamp is later than the first timestamp, the third timestamp is taken as the second timestamp, and data with a timestamp later than the first timestamp in the target data source is taken as the to-be-synchronized data. The electronic device is configured to send a data synchronization request to the customer experience platform, and the data synchronization request includes the to-be-synchronized data and the second timestamp. The customer experience platform is configured to receive the data synchronization request sent by the electronic device, and the second timestamp is used to indicate a time when the latest data in the to-be-synchronized data is updated. In response to receiving the data synchronization request, the customer experience platform is configured to perform data synchronization based on the to-be-synchronized data, and update the first timestamp to the second timestamp.
9. A data synchronization device, characterized by The device includes a memory and a processor: The memory is configured to store a computer program and transmit the computer program to the processor. The processor is configured to execute the computer program to enable the device to perform the steps of the data synchronization method according to any one of claims 1-5 or the steps of the data synchronization method according to any one of claims 6-7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program. When the computer program is run, a device running the computer program implements the steps of the data synchronization method according to any one of claims 1-5, or implements the steps of the data synchronization method according to any one of claims 6-7.
Citation Information
Patent Citations
Data synchronization method, device, server and storage medium
CN107172169A
Data synchronization method, synchronization end, to-be-synchronized end, equipment and storage medium
CN110674146A