CN109684405B - Data synchronization method, device, equipment and computer readable storage medium - Google Patents

Data synchronization method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN109684405B
CN109684405B CN201811041734.9A CN201811041734A CN109684405B CN 109684405 B CN109684405 B CN 109684405B CN 201811041734 A CN201811041734 A CN 201811041734A CN 109684405 B CN109684405 B CN 109684405B
Authority
CN
China
Prior art keywords
synchronization
data synchronization
data
task
channel party
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811041734.9A
Other languages
Chinese (zh)
Other versions
CN109684405A (en
Inventor
付舒婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811041734.9A priority Critical patent/CN109684405B/en
Publication of CN109684405A publication Critical patent/CN109684405A/en
Application granted granted Critical
Publication of CN109684405B publication Critical patent/CN109684405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a data synchronization method, a device, equipment and a computer readable storage medium, wherein the method comprises the following steps: shifting out data synchronization logic to a preset storage area in a main flow of a data synchronization system, and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system; after the data synchronization task is added, introducing a preset trigger task, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task; calling a strategy of a target channel party corresponding to the data synchronization task in a configuration table through the data synchronization logic, and determining a synchronization method of the target channel party according to the strategy of the target channel party; and executing a synchronization process on the data according to the synchronization method of the target channel party. The invention improves the convenience, intelligence and timeliness of data synchronization.

Description

Data synchronization method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of data synchronization technologies, and in particular, to a data synchronization method, apparatus, device, and computer readable storage medium.
Background
Data synchronization between existing systems is generally achieved by adding a new partner and redeveloping the new partner, i.e., modifying the existing data synchronization logic to add data synchronization functionality to the partner. In the butt joint mode, workload can be increased, modification risks are increased due to the fact that a common data synchronization module is modified, correspondingly, workload for subsequent testing is increased, and obviously, an existing data synchronization mode is complex in operation and low in efficiency and intelligence.
Disclosure of Invention
The invention mainly aims to provide a data synchronization method, a data synchronization device, data synchronization equipment and a computer readable storage medium, and aims to solve the technical problems of complex operation, and low efficiency and intelligence of the existing data synchronization mode.
In order to achieve the above object, the present invention provides a data synchronization method, including:
shifting out data synchronization logic to a preset storage area in a main flow of a data synchronization system, and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system;
after the data synchronization task is added, introducing a preset trigger task, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task;
calling a strategy of a target channel party corresponding to the data synchronization task in a configuration table through the data synchronization logic, and determining a synchronization method of the target channel party according to the strategy of the target channel party;
and executing a synchronization process on the data according to the synchronization method of the target channel party.
Optionally, before the step of moving out the data synchronization logic to the preset storage area in the main flow of the data synchronization system, and adding the data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system, the method further includes:
acquiring data synchronization information of each channel party, and adding the data synchronization information of each channel party into a configuration table, wherein the data synchronization information of the channel party comprises channel codes and synchronization address information;
and acquiring the data synchronization requirements of each channel party through a display interface, configuring a strategy according to the data synchronization requirements of each channel party, and adding the configured strategy into the configuration table so as to store the strategy configured by each channel party in association with the channel party identifier.
Optionally, the trigger task is added with mark information, where the mark information includes mark information triggered at regular time or mark information triggered in real time;
the step of triggering the data synchronization task by the trigger task includes:
if the mark information added in the trigger task is the mark information triggered at regular time, triggering the data synchronization task by the trigger task in a timed polling manner;
and if the mark information added in the trigger task is the mark information triggered in real time, triggering the data synchronization task in real time through the trigger task.
Optionally, the step of calling, by the data synchronization logic, a policy of a target channel party corresponding to the data synchronization task in a configuration table, and determining a synchronization method of the target channel party according to the policy of the target channel party includes:
receiving transaction data corresponding to the data synchronization task, and analyzing the transaction data to identify a target channel party identifier contained in the transaction data;
and calling a strategy of a target channel party corresponding to the target channel party identification in the configuration table through the data synchronization logic so as to determine a synchronization method of the target channel party according to the strategy of the target channel party.
Optionally, the step of performing a synchronization process on the data according to the synchronization method of the target channel side includes:
if the strategy of the target channel party is a general strategy, preprocessing and assembling the transaction data to obtain assembly data;
sending the assembly data to a synchronous address of a target channel side through a general interface;
and receiving a synchronization result returned by the synchronization address of the target channel party.
Optionally, the step of performing a synchronization process on the data according to the synchronization method of the target channel side further includes:
if the strategy of the target channel party is an individualized strategy, preprocessing and assembling the transaction data to obtain assembled data;
acquiring a target interface corresponding to the data type of the transaction data, and sending the assembly data to a synchronous address of a target channel party through the target interface;
and receiving a synchronization result returned by the synchronization address of the target channel party.
Optionally, after the step of receiving the synchronization result returned by the synchronization address of the target channel side, the method further includes;
converting the received synchronization result according to a standardized processing mode;
identifying a synchronization state corresponding to the converted synchronization result, wherein the synchronization state comprises a synchronization successful state or a synchronization failed state;
recording the synchronization state of the synchronization result in a log table of data synchronization, wherein different synchronization states record different mark information;
if the mark information of the synchronous state is a first mark, determining that the data synchronization is finished;
and if the mark information of the synchronization state is a second mark, the compensation task captures the transaction data of the second mark in the log table, and the data synchronization task is triggered again so as to execute the data synchronization process on the transaction data which fails in synchronization again.
In addition, to achieve the above object, the present invention further provides a data synchronization apparatus, including:
the data synchronization system comprises a first processing module, a second processing module and a data synchronization module, wherein the first processing module is used for shifting out data synchronization logic to a preset storage area in a main flow of the data synchronization system and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system;
the second processing module is used for introducing a preset trigger task after the data synchronization task is added, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task;
the calling module is used for calling the strategy of a target channel party corresponding to the data synchronization task in a configuration table through the data synchronization logic;
the determining module is used for determining a synchronization method of the target channel party according to the strategy of the target channel party;
and the execution module is used for executing a synchronization process on the data according to the synchronization method of the target channel party.
In addition, in order to achieve the above object, the present invention further provides a data synchronization device, which includes a memory, a processor, a communication bus, and a data synchronization program stored on the memory and operable on the processor;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute the data synchronization program to implement the steps of the data synchronization method as described above.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a data synchronization program which, when executed by a processor, implements the steps of the data synchronization method as described above.
According to the data synchronization method provided by the invention, the data synchronization logic in the main flow of the data synchronization system is firstly stripped to the preset storage area, then the data synchronization task is added, then the data synchronization task is triggered through the introduced trigger task, the configuration table is called by the data synchronization task to execute the data synchronization operation, the whole process is automatically executed, a docking interface does not need to be re-developed for a new channel party, the operation is more convenient and faster, the intelligence is higher, the workload and the risk are not increased, and the data synchronization timeliness is higher.
Drawings
FIG. 1 is a schematic diagram of a data synchronization device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a data synchronization method according to a first embodiment of the present invention;
fig. 3 is a detailed flowchart of step S30 in fig. 2.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
The solution of the embodiment of the invention is mainly as follows: shifting out data synchronization logic to a preset storage area in a main flow of a data synchronization system, and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system; after the data synchronization task is added, introducing a preset trigger task, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task; calling a strategy of a target channel party corresponding to the data synchronization task in a configuration table through the data synchronization logic, and determining a synchronization method of the target channel party according to the strategy of the target channel party; and executing a synchronization process on the data according to the synchronization method of the target channel party. The problems of complex operation and low efficiency and intelligence of the existing data synchronization mode are solved.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a data synchronization device of a hardware operating environment according to an embodiment of the present invention.
The data synchronization equipment in the embodiment of the invention can be a PC, and can also be equipment with a display function, such as a smart phone, a tablet personal computer, a portable computer and the like.
As shown in fig. 1, the data synchronization apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface (e.g., for connecting a wired Keyboard, a wired mouse, etc.), a wireless interface (e.g., for connecting a wireless Keyboard, a wireless mouse). The network interface 1004 may optionally include a standard wired interface (for connecting to a wired network), a wireless interface (e.g., a WI-FI interface, a bluetooth interface, an infrared interface, etc., for connecting to a wireless network). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the device may also include a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, wiFi modules, and the like.
Those skilled in the art will appreciate that the data synchronization device configuration shown in fig. 1 does not constitute a limitation of the conversion device, and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a data synchronization program. The operating system is a program for managing and controlling the data synchronization equipment and software resources, and supports the operation of a network communication module, a user interface module, a data synchronization program and other programs or software; the network communication module is used for managing and controlling the network interface 1002; the user interface module is used to manage and control the user interface 1003.
In the data synchronization apparatus shown in fig. 1, the data synchronization apparatus calls a data synchronization program stored in a memory 1005 through a processor 1001 to implement the steps of the data synchronization method as described below.
Based on the hardware structure of the data synchronization device, the data synchronization method of the present invention is provided in various embodiments.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data synchronization method according to a first embodiment of the present invention.
In this embodiment, the data synchronization method includes:
step S10, shifting out data synchronization logic to a preset storage area in a main flow of a data synchronization system, and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system;
step S20, after the data synchronization task is added, introducing a preset trigger task, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task;
step S30, a strategy of a target channel party corresponding to the data synchronization task in a configuration table is called through the data synchronization logic, and a synchronization method of the target channel party is determined according to the strategy of the target channel party;
and S40, executing a synchronization process on the data according to the synchronization method of the target channel party.
In this embodiment, the data synchronization method is applied to a data synchronization apparatus such as the data synchronization apparatus shown in fig. 1.
In this embodiment, before the step S10, the method further includes:
step A, acquiring data synchronization information of each channel party, and adding the data synchronization information of each channel party into a configuration table, wherein the data synchronization information of the channel party comprises channel codes and synchronization address information;
and step B, acquiring the data synchronization requirement of each channel party through a display interface, configuring the strategy according to the data synchronization requirement of each channel party, and adding the configured strategy into the configuration table so as to store the strategy configured by each channel party in association with the channel party identifier.
In this embodiment, before data synchronization is performed, related information of each channel party is added to a configuration table, specifically, data synchronization information of each channel party is obtained first, the data synchronization information of the channel party includes a channel code and synchronization address information, the channel code and the synchronization address information of each channel party are different, and one channel party corresponds to only one channel code and one synchronization address information. After the data synchronization information of the channel parties is acquired, the data synchronization information of each channel party is added into a configuration table, the data synchronization information of each channel party is stored in the configuration table in a way of being associated with the channel party identification, then the data synchronization requirements of each channel party input by a user are acquired through a display interface, and the strategy is configured according to the data synchronization requirements of each channel party, wherein the strategy comprises a general strategy or a personalized strategy, after the corresponding strategy is configured for each channel party, the relevant information of each channel party is added into the configuration table, and as the strategies of a plurality of channel parties can be stored in the configuration table, when the strategy of a channel party is added into the configuration table, the strategy configured by each channel party needs to be stored in a way of being associated with the channel party identification of the channel party, and when the strategy is called from the configuration table subsequently, the strategy can be called according to the channel party identification.
The following are specific steps of implementing data synchronization in this embodiment:
step S10, shifting out data synchronization logic to a preset storage area in a main flow of a data synchronization system, and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system;
in this embodiment, after the configuration table stores the data synchronization information and the policy of each channel, the data synchronization device may automatically implement the data synchronization process, specifically: the data synchronization device firstly moves the data synchronization logic out of a main flow of the data synchronization system to a preset storage area, the preset storage area is not limited, the data synchronization device is set according to actual needs, and after the data synchronization logic is moved out of the preset storage area, the data synchronization device adds a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system. And the data synchronization task calls a data synchronization logic, so that the data synchronization process of the newly added channel side is realized conveniently in the follow-up process.
Step S20, after the data synchronization task is added, introducing a preset trigger task, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task;
after the addition of the data synchronization task is completed, a preset trigger task is introduced, in this embodiment, the trigger task includes a timing trigger task and a real-time trigger task, different mark information is added to the two trigger tasks, and the mark information includes mark information triggered at timing or mark information triggered in real time. After the timing trigger task is introduced, the data synchronization task is triggered by the introduced trigger task, and in this embodiment, the step of triggering the data synchronization task by the trigger task includes:
in a first mode, if the mark information added in the trigger task is the mark information triggered at regular time, the data synchronization task is triggered by the trigger task in a timed polling manner;
and secondly, if the mark information added in the trigger task is the mark information triggered in real time, triggering the data synchronization task in real time through the trigger task.
After the data synchronization task is triggered through the introduced trigger task, the data synchronization task calls a data synchronization logic to realize the subsequent data synchronization process.
Step S30, a strategy of a target channel party corresponding to the data synchronization task in a configuration table is called through the data synchronization logic, and a synchronization method of the target channel party is determined according to the strategy of the target channel party;
specifically, the strategy of a target channel party corresponding to the data synchronization task in the configuration table is called through the data synchronization logic, specifically, the strategy of which channel party needs to be called is called according to the channel party identification information, and after the strategy of the target channel party is called, the synchronization method of the target channel party is determined according to the strategy of the target channel party. Specifically, referring to fig. 3, the step S30 includes:
step S31, receiving transaction data corresponding to the data synchronization task, and analyzing the transaction data to identify a target channel party identifier contained in the transaction data;
step S32, the strategy of the target channel party corresponding to the target channel party identification is called in the configuration table through the data synchronization logic, so that the synchronization method of the target channel party is determined according to the strategy of the target channel party.
The data synchronization device receives transaction data corresponding to the data synchronization task, the transaction data can be selected from transaction data received in an interface of the data synchronization device or transaction data transmitted from an external device, after the transaction data is received, the received transaction data is analyzed to identify a target channel party identifier contained in the transaction data, then a target channel party strategy corresponding to the target channel party identifier is called in a configuration table through data synchronization logic, and a synchronization method of the target channel party is determined according to a measurement strategy of the target channel party.
In this embodiment, it should be noted that, when the policy is a general policy or an individualized policy, the synchronization method of the two policies is basically divided into the following three steps: firstly, pretreating and assembling; secondly, sending the assembled data to a synchronous address of a channel side; and thirdly, receiving a synchronization result fed back by the synchronization address of the channel side. The synchronization method of the two strategies is basically the three steps, and the difference is that: the three steps of the personalization strategy, only the details of which are different, are specifically represented as: in the first step, the data preprocessed and assembled by each channel side is different, the interfaces for sending the data in the second step are different, and/or the result identifications of the received synchronization results in the third part are different.
And S40, executing a synchronization process on the data according to the synchronization method of the target channel party.
And after determining the synchronization method of the channel side according to the strategy of the channel side, executing a synchronization process on the data of the channel side according to the determined synchronization method. In the embodiment, the strategies comprise a general strategy or an individual strategy, when the strategies configured by different channel parties are all the general strategies, each channel party adopts three steps of a synchronization method in the general strategies to carry out data synchronization, and because each channel party adopts the same strategy, the data synchronization modes of each channel party are basically consistent;
when the policies configured by different channeling parties are personalized policies, the personalized policies of each channeling party are configured according to the data synchronization requirements of each channeling party, so that the data synchronization methods of different channeling parties are different, and the synchronization methods are roughly the three steps, but the details in the data synchronization process are different, specifically, the implementation manner of the step S40 includes:
1) In the first embodiment, the step S40 includes:
step a, if the strategy of the target channel party is a general strategy, preprocessing and assembling the transaction data to obtain assembly data;
if the strategy of the target channel party is a general strategy, firstly, preprocessing transaction data according to the first step in the target channel party synchronization method, wherein the preprocessing mode comprises data denoising, data screening and the like, and after preprocessing the transaction data, assembling the preprocessed transaction data to obtain the assembled data.
Step b, the assembly data is sent to a synchronous address of a target channel party through a general interface;
after the assembly data are obtained, the assembly data are sent to the synchronous address of the target channel side according to the second step in the channel side synchronization method.
And c, receiving a synchronization result returned by the synchronization address of the target channel party.
And after the assembly data is sent to the synchronous address of the target channel party through the universal interface, receiving a synchronous result returned by the synchronous address of the target channel party according to the third step in the synchronous method of the target channel party, wherein the returned synchronous result comprises two results of successful synchronization and failed synchronization.
2) In the second embodiment, the step S40 includes:
step d, if the strategy of the target channel party is an individualized strategy, preprocessing and assembling the transaction data to obtain assembly data;
step e, acquiring a target interface corresponding to the data type of the transaction data, and sending the assembly data to a synchronous address of a target channel party through the target interface;
and f, receiving a synchronization result returned by the synchronization address of the target channel party. When a first channel party and a second channel party adopt different personalized strategies, the first step of the first channel party is to preprocess and assemble first class data in transaction data to obtain first assembly data, and the first step of the second channel party is to preprocess and assemble second class data in the transaction data to obtain second assembly data;
the second step of the first channel side is to send the first assembly data to the synchronous address of the first channel side through a first target interface, and the second step of the second channel side is to send the second assembly data to the synchronous address of the second channel side through a second target interface;
the third step of the first channel party receives the synchronous result identifier returned by the synchronous address of the first channel party as the first type identifier, and the third step of the second channel party receives the synchronous result identifier returned by the synchronous address of the second channel party as the second type identifier.
For better understanding, the following are exemplified:
A. in the synchronization method corresponding to the personalized strategies of the two channel parties, the first step of the channel party A is as follows: preprocessing and assembling the insurance policy in the transaction data; the first step of the channel B party is: preprocessing and assembling the insurance policy, the customer data and the product information in the transaction data;
the second step of the channel A side is as follows: sending the assembly data to a synchronous address of a channel A party through an http (Hypertext Transfer Protocol) interface; the second step of the channel B side is as follows: sending the assembly data to a synchronous address of a channel B party through a webservice (a programmable web-based application program) interface;
the third step of the channel A party is as follows: receiving a synchronization result returned by the synchronization address of the channel A party, wherein the synchronization result is 00 or 01, and the 00 or 01 represents synchronization success or synchronization failure; the third step of the channel B side is as follows: the synchronization result returned by the synchronization address of the receiving channel B party is 000 or 111, wherein 000 or 111 represents the synchronization success or the synchronization failure.
According to the data synchronization method, the data synchronization logic in the main flow of the data synchronization system is firstly stripped to the preset storage area, then the data synchronization task is added, the data synchronization task is triggered through the introduced trigger task, the configuration table is called by the data synchronization task to execute the data synchronization operation, the whole process is automatically executed, a docking interface does not need to be re-developed for a new channel side, the operation is more convenient and faster, the intelligence is higher, the workload and the risk are not increased, and the data synchronization timeliness is higher.
Further, a second embodiment of the data synchronization method of the present invention is proposed based on the first embodiment.
The second embodiment of the data synchronization method differs from the first embodiment of the data synchronization method in that after the "receiving the synchronization result returned by the synchronization address of the target channel side", the method further comprises:
step C, converting the received synchronous result according to a standardized processing mode;
step D, identifying a synchronization state corresponding to the converted synchronization result, wherein the synchronization state comprises a state of successful synchronization or a state of failed synchronization;
step E, recording the synchronization state of the synchronization result in a log table of data synchronization, wherein different synchronization states record different mark information;
step F, if the mark information of the synchronous state is a first mark, determining that the data synchronization is finished;
and G, if the mark information of the synchronization state is a second mark, the compensation task captures the transaction data of the second mark in the log table, and the data synchronization task is triggered again so as to execute the data synchronization process on the transaction data which fails in synchronization again.
In this embodiment, after receiving the synchronization result returned by the synchronization address of the channel side according to the third step in the channel side synchronization method, because the identification of the synchronization result returned by different channel sides is different, for example, the synchronization result returned by the synchronization address of the channel side a is 00 or 01, and the synchronization result returned by the synchronization address of the channel side b is 000 or 111, although the synchronization results actually all indicate that synchronization is successful or failed, because the identification of the synchronization result of multiple channel sides is different, when subsequent recording is performed, more and more data are recorded and are redundant.
In this embodiment, in order to make the subsequently recorded data more uniform, after receiving the synchronization result fed back by the channel side, the received synchronization result is converted according to a standardized processing manner, which converts the synchronization result of each channel side into a specific synchronization state, where the synchronization result that is successfully synchronized in each channel side is converted into a synchronization state that is successfully synchronized, and the synchronization result that is failed in synchronization in each channel side is converted into a synchronization state that is failed to synchronize. And after converting the synchronization result into the synchronization state, identifying the synchronization state corresponding to the converted synchronization result, wherein the synchronization state comprises a state of successful synchronization or a state of failed synchronization. And then, recording the synchronization state of the synchronization result in a log table of data synchronization, recording different mark information in different synchronization states, recording mark information corresponding to the synchronization state with successful synchronization as a first mark, and recording mark information corresponding to the synchronization state with failed synchronization as a second mark. Therefore, if the mark information of the synchronous state is the first mark, the completion of the data synchronization can be indicated, and if the mark information of the synchronous state is the second mark, the failure of the data synchronization process of the channel side is indicated. And under the condition that the data synchronization fails, capturing the transaction data of the second mark in the log table by the compensation task, and triggering the data synchronization task again to perform the data synchronization process on the transaction data which fails to be synchronized again, wherein the data synchronization process is basically consistent with the data synchronization process in the above, and the details are not repeated here. In the embodiment, the data synchronization results of all channel parties are subjected to standardized conversion, so that the subsequently recorded data are more uniform, and the flexibility of data synchronization is improved.
The present invention also provides a data synchronization apparatus, comprising:
the data synchronization system comprises a first processing module, a second processing module and a data synchronization module, wherein the first processing module is used for shifting out data synchronization logic to a preset storage area in a main flow of the data synchronization system and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system;
the second processing module is used for introducing a preset trigger task after the data synchronization task is added, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task;
the calling module is used for calling the strategy of a target channel party corresponding to the data synchronization task in a configuration table through the data synchronization logic;
the determining module is used for determining a synchronization method of the target channel party according to the strategy of the target channel party;
and the execution module is used for executing a synchronization process on the data according to the synchronization method of the target channel party.
The specific implementation of the data synchronization apparatus of the present invention is substantially the same as the embodiments of the data synchronization method, and is not described herein again.
An embodiment of the present invention further provides a computer-readable storage medium, where a data synchronization program is stored on the computer-readable storage medium, and when the data synchronization program is executed by a processor, the data synchronization method is implemented.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the data synchronization method described above, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent structures or equivalent processes performed by the present invention or directly or indirectly applied to other related technical fields are also included in the scope of the present invention.

Claims (9)

1. A data synchronization method, characterized in that the data synchronization method comprises:
shifting out data synchronization logic to a preset storage area in a main flow of a data synchronization system, and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system;
after the data synchronization task is added, introducing a preset trigger task, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task;
calling a strategy of a target channel party corresponding to the data synchronization task in a configuration table through the data synchronization logic, and determining a synchronization method of the target channel party according to the strategy of the target channel party;
executing a synchronization process on data according to the synchronization method of the target channel party;
before the step of moving out the data synchronization logic to the preset storage area in the main flow of the data synchronization system and adding the data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system, the method further includes:
acquiring data synchronization information of each channel party, and adding the data synchronization information of each channel party into a configuration table, wherein the data synchronization information of the channel party comprises channel codes and synchronization address information;
and acquiring the data synchronization requirement of each channel party, configuring a strategy according to the data synchronization requirement of each channel party, and adding the configured strategy into the configuration table so as to store the strategy configured by each channel party in association with the channel party identifier.
2. The data synchronization method according to claim 1, wherein the trigger task is added with mark information, and the mark information comprises mark information triggered at regular time or mark information triggered in real time;
the step of triggering the data synchronization task by the trigger task includes:
if the mark information added in the trigger task is the mark information triggered at fixed time, triggering the data synchronization task by the trigger task through the timed polling;
and if the mark information added in the trigger task is the mark information triggered in real time, triggering the data synchronization task in real time through the trigger task.
3. The data synchronization method of claim 1, wherein the step of invoking a policy of a target channel party corresponding to the data synchronization task in a configuration table through the data synchronization logic and determining a synchronization method of the target channel party according to the policy of the target channel party comprises:
receiving transaction data corresponding to the data synchronization task, and analyzing the transaction data to identify a target channel party identifier contained in the transaction data;
and calling the strategy of the target channel party corresponding to the target channel party identification in the configuration table through the data synchronization logic so as to determine the synchronization method of the target channel party according to the strategy of the target channel party.
4. The data synchronization method of claim 1, wherein the step of performing a synchronization process on the data according to the synchronization method of the target channel side comprises:
if the strategy of the target channel party is a general strategy, preprocessing and assembling transaction data to obtain assembly data;
sending the assembly data to a synchronous address of a target channel party through a general interface;
and receiving a synchronization result returned by the synchronization address of the target channel party.
5. The data synchronization method of claim 1, wherein the step of performing a synchronization process on the data according to the synchronization method of the target channel side further comprises:
if the strategy of the target channel party is an individualized strategy, preprocessing and assembling transaction data to obtain assembly data;
acquiring a target interface corresponding to the data type of the transaction data, and sending the assembly data to a synchronous address of a target channel party through the target interface;
and receiving a synchronization result returned by the synchronization address of the target channel party.
6. The data synchronization method of claim 4 or 5, wherein after the step of receiving a synchronization result returned by the synchronization address of the target channel side, the method further comprises;
converting the received synchronization result according to a standardized processing mode;
identifying a synchronization state corresponding to the converted synchronization result, wherein the synchronization state comprises a synchronization successful state or a synchronization failed state;
recording the synchronization state of the synchronization result in a log table of data synchronization, wherein different synchronization states record different mark information;
if the mark information of the synchronous state is a first mark, determining that the data synchronization is finished;
and if the mark information of the synchronous state is a second mark, the compensation task captures the transaction data of the second mark in the log table, and triggers the data synchronization task again so as to perform the data synchronization process on the transaction data which fails in synchronization again.
7. A data synchronization apparatus, characterized in that the data synchronization apparatus comprises:
the first processing module is used for shifting out data synchronization logic to a preset storage area in a main flow of a data synchronization system, and adding a data synchronization task corresponding to the data synchronization logic in the main flow of the data synchronization system;
the second processing module is used for introducing a preset trigger task after the data synchronization task is added, triggering the data synchronization task through the trigger task, and calling the data synchronization logic by the data synchronization task;
the calling module is used for calling the strategy of a target channel party corresponding to the data synchronization task in a configuration table through the data synchronization logic;
the determining module is used for determining a synchronization method of the target channel party according to the strategy of the target channel party;
the execution module is used for executing a synchronization process on data according to the synchronization method of the target channel party;
the first processing module is further configured to acquire data synchronization information of each channel side, and add the data synchronization information of each channel side to a configuration table, where the data synchronization information of the channel side includes channel codes and synchronization address information;
and acquiring the data synchronization requirement of each channel party, configuring a strategy according to the data synchronization requirement of each channel party, and adding the configured strategy into the configuration table so as to store the strategy configured by each channel party in association with the channel party identifier.
8. A data synchronization device, comprising a memory, a processor, a communication bus, and a data synchronization program stored on the memory and executable on the processor;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute the data synchronization program to implement the steps of the data synchronization method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that a data synchronization program is stored thereon, which when executed by a processor implements the steps of the data synchronization method according to any one of claims 1 to 6.
CN201811041734.9A 2018-09-07 2018-09-07 Data synchronization method, device, equipment and computer readable storage medium Active CN109684405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811041734.9A CN109684405B (en) 2018-09-07 2018-09-07 Data synchronization method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811041734.9A CN109684405B (en) 2018-09-07 2018-09-07 Data synchronization method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109684405A CN109684405A (en) 2019-04-26
CN109684405B true CN109684405B (en) 2023-04-14

Family

ID=66185663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811041734.9A Active CN109684405B (en) 2018-09-07 2018-09-07 Data synchronization method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109684405B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317843A (en) * 2014-10-11 2015-01-28 上海瀚之友信息技术服务有限公司 Data synchronism ETL (Extract Transform Load) system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317843A (en) * 2014-10-11 2015-01-28 上海瀚之友信息技术服务有限公司 Data synchronism ETL (Extract Transform Load) system

Also Published As

Publication number Publication date
CN109684405A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
CN111045952B (en) Software testing method, flow playback device, terminal equipment and readable storage medium
CN108255847B (en) Page generation method and device
CN108845930B (en) Interface operation test method and device, storage medium and electronic device
WO2017083207A1 (en) Digital assistant setting up device
CN108228444B (en) Test method and device
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN107302476A (en) A kind of automated testing method and system for testing asynchronous interactive system
CN110704095A (en) Workflow-based configuration processing method and device, computer equipment and storage medium
CN109062807B (en) Method and device for testing application program, storage medium and electronic device
CN107370823A (en) Data acquisition and long-range control method, device and computer-readable recording medium
CN113672441A (en) Method and device for testing intelligent equipment
CN107861765B (en) Product configuration method, apparatus, and computer-readable storage medium
CN109828830B (en) Method and apparatus for managing containers
CN107102937B (en) User interface testing method and device
CN110543428A (en) Application system testing method and device
CN114363225A (en) MTQQ protocol-based device debugging mode, system and storage medium
CN112559124A (en) Model management system and target operation instruction processing method and device
US20180349932A1 (en) Methods and systems for determining persona of participants by the participant use of a software product
CN109684405B (en) Data synchronization method, device, equipment and computer readable storage medium
CN110209557B (en) User operation recording and restoring method, device and equipment and readable storage medium
CN112214701A (en) Page display method and system, storage medium and electronic device
CN111813685A (en) Automatic testing method and device
CN115617780A (en) Data import method, device, equipment and storage medium
CN115061785A (en) Information issuing method and device, storage medium and server
CN110427260B (en) Host job scheduling method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant