CN117807159A - Data synchronization method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN117807159A
CN117807159A CN202311607541.6A CN202311607541A CN117807159A CN 117807159 A CN117807159 A CN 117807159A CN 202311607541 A CN202311607541 A CN 202311607541A CN 117807159 A CN117807159 A CN 117807159A
Authority
CN
China
Prior art keywords
data
synchronized
synchronization
synchronous
data table
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.)
Pending
Application number
CN202311607541.6A
Other languages
Chinese (zh)
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202311607541.6A priority Critical patent/CN117807159A/en
Publication of CN117807159A publication Critical patent/CN117807159A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data synchronization method, a device, equipment and a storage medium. The method comprises the following steps: if a system transaction event is detected, determining a synchronous system and a synchronized system; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services; the control synchronization system determines transaction information and data to be synchronized corresponding to a system transaction event, and generates a transmission data table according to the transaction information and the data to be synchronized; and controlling the synchronous system to match the transmission data table with a corresponding processing process, and calling the processing process to synchronously transmit the transmission data table to the synchronized system so as to instruct the synchronized system to perform data synchronization. According to the technical scheme, the data level synchronization of heterogeneous data tables among databases of the cross-system and cross-operation environments can be realized, the validity and the correctness of data under the parallel scene of the new and old business systems are ensured, and meanwhile, the operation stability of the new and old systems is ensured.

Description

Data synchronization method, device, equipment and storage medium
Technical Field
The present invention relates to the field of big data, and in particular, to a method, an apparatus, a device, and a storage medium for synchronizing data.
Background
With the deep advancement of digital transformation and the updating and upgrading of basic software and hardware equipment, more and more banking systems need to be updated and reconfigured, and the new system needs to be operated in parallel with the old system for a period of time due to the need of verifying the correctness and operation stability of the service logic of the new information system after reconfiguration. During the parallel period, the new and old systems are provided for the clients by different channel ends (such as internet banking, palm banking, counter surface and the like), different front-end menus or by shunting through a gateway, and if the new system has a problem, the traffic shunted to the new system is transferred back to the old system, so that the clients are not aware, and the quasi-real-time consistency and the integrity of the data between the new and old systems are required to be maintained.
Therefore, how to realize the data level synchronization of heterogeneous data tables among databases of a cross-system and cross-operation environment, ensure the validity and the correctness of data under the parallel scene of the new and old business systems, and simultaneously ensure the operation stability of the new and old systems is a problem to be solved at present.
Disclosure of Invention
The invention provides a data synchronization method, a device, equipment and a storage medium, which are used for realizing data level synchronization of heterogeneous data tables among databases of cross-system and cross-running environments.
According to an aspect of the present invention, there is provided a data synchronization method including:
if a system transaction event is detected, determining a synchronous system and a synchronized system; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services;
the control synchronization system determines transaction information and data to be synchronized corresponding to a system transaction event, and generates a transmission data table according to the transaction information and the data to be synchronized;
and controlling the synchronous system to match the transmission data table with a corresponding processing process, and calling the processing process to synchronously transmit the transmission data table to the synchronized system so as to instruct the synchronized system to perform data synchronization.
According to another aspect of the present invention, there is provided a data synchronization apparatus including:
the determining module is used for determining a synchronous system and a synchronized system if a system transaction event is detected; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services;
the generation module is used for controlling the synchronous system to determine transaction information and data to be synchronized corresponding to the system transaction event, and generating a transmission data table according to the transaction information and the data to be synchronized;
and the sending module is used for controlling the synchronous system to match the corresponding processing process for the sending data table, and calling the processing process to synchronously send the sending data table to the synchronized system so as to instruct the synchronized system to carry out data synchronization.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data synchronization method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a data synchronization method according to any one of the embodiments of the present invention.
According to the technical scheme, if the system transaction event is detected, a synchronous system and a synchronized system are determined; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services; the control synchronization system determines transaction information and data to be synchronized corresponding to a system transaction event, and generates a transmission data table according to the transaction information and the data to be synchronized; and controlling the synchronous system to match the transmission data table with a corresponding processing process, and calling the processing process to synchronously transmit the transmission data table to the synchronized system so as to instruct the synchronized system to perform data synchronization. By the method, data level synchronization of heterogeneous data tables among databases of cross-system and cross-operation environments can be realized, validity and correctness of data under a parallel scene of the new and old business systems are guaranteed, and operation stability of the new and old systems is guaranteed.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1A is a flowchart of a data synchronization method according to a first embodiment of the present invention;
FIG. 1B is a schematic diagram of multi-process data synchronization according to an embodiment of the present invention;
fig. 2A is a flowchart of a data synchronization method according to a second embodiment of the present invention;
fig. 2B is a flowchart of a data synchronization method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a data synchronization device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," "candidate," "alternative," and the like in the description and claims of the invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
FIG. 1A is a flowchart of a data synchronization method according to a first embodiment of the present invention; FIG. 1B is a schematic diagram of multi-process data synchronization according to an embodiment of the present invention; the embodiment is suitable for the situation of data synchronization of two systems during parallel operation of a new service system and an old service system, the method can be executed by a data synchronization device, and the device can be realized in a software and/or hardware mode and can be integrated in electronic equipment with a data synchronization function, such as the new service system or the old service system. As shown in fig. 1A, the data synchronization method includes:
s101, if a system transaction event is detected, determining a synchronous system and a synchronized system.
The system transaction event refers to an event that a user performs online transaction with the system, and the online transaction refers to that the user performs online transaction with a new service system or an old service system. The synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services. The synchronous system refers to a system in which a system transaction event occurs in the new and old business systems, and the synchronized system refers to a system except the synchronous system in the new and old business systems. Two asynchronous task processing centers, namely a data transmission center and a data receiving center, are respectively configured in the synchronous system and the synchronized system, for example, a new system is synchronous to an old system, and then data flow is that the data transmission center of the new system flows to the data receiving center of the old system, and vice versa. The databases of the synchronous system and the synchronized system can be SYBASE database and TDSQL database, and the databases of the synchronous system and the synchronized system can be the same or different, if the databases of the synchronous system and the synchronized system are different, the scheme of the invention can realize the data level synchronization of different data tables between the SYBASE database and the TDSQL database of the cross-system and cross-running environment.
Optionally, after the system transaction event occurs in the synchronization system, a sending data table to be synchronized can be generated through a sending center in the synchronization system according to the change condition of the data table in the database and sent to a receiving center of the synchronized system, so as to instruct the synchronized system to generate the receiving data table, thereby realizing data level synchronization of different data tables among databases of the cross-system and cross-running environment.
It should be noted that, the relationship between the sending data table of the synchronous system and the receiving data table of the synchronized system is heterogeneous, the relationship is modifiable in configurable value, and has wide portability.
Optionally, if a system transaction event is detected, determining the synchronized system and the synchronized system includes: in the process of trading between the user and the old and new systems, if the database of the target system is detected to be updated, determining that a system trading event is detected; and determining the target system of the data update of the database as a synchronous system, and determining the other systems as synchronized systems. The target system may be a new business system or an old business system running in parallel to perform business services.
Optionally, new data may be generated or original data may be modified/deleted during the process of using the new service system or the old service system (i.e., the target system), where it may be considered that the database of the target system is detected to be updated, i.e., a system transaction event is detected.
S102, controlling the synchronization system to determine transaction information and data to be synchronized corresponding to the system transaction event, and generating a transmission data table according to the transaction information and the data to be synchronized.
Wherein the transaction information includes at least one of: transaction date, transaction serial number, synchronized list name, data synchronous sending state, registration time, data synchronous last processing time, data processing times and data synchronous message. Data generated by which transaction can be located by the transaction date and the transaction serial number. The synchronized table name refers to a table name defined by the transmission data table in the synchronized system. The data synchronous transmission state is divided into to-be-transmitted, success and failure, the registration time is the time when data enters a transmission data table, the last processing time of the data synchronization stores the time of last processing the current record, the number of times of data processing stores the number of times of current record synchronization, the data synchronous message field stores specific to-be-synchronized data, and a specific data updating mode (newly added/deleted/modified) is also stored in the data synchronous message field.
The data to be synchronized refers to the data stored in the recording node after the synchronization system preprocesses the updated data or buries the data. The transmitting data table is a data table to be synchronized or a data synchronization-transmitting data table, and refers to a data table generated by the synchronization system after splicing and integrating transaction information and data to be synchronized. The number of the sending data tables can be one or at least two, and if the number of the sending data tables can be at least two, the parallel data table sending operation can be realized by calling at least two processing processes.
It should be noted that, the data to be synchronized may be based on different table structures, for example, the sending data table a of the synchronizing system may be synchronized to two tables, namely, the receiving data table B and the receiving data table C of the synchronized system, for example, the table a of the synchronizing system has 6 fields, and the table B corresponding to the synchronized system has 7 fields, and at this time, the integrating process may be performed first and then the synchronizing may be performed.
Optionally, the controlling the synchronization system to determine data to be synchronized corresponding to the system transaction event includes: the control synchronization system performs data preprocessing on the updated data changed after the system transaction event to obtain preprocessed data; and storing the primary key, the data content and the data table name of the preprocessed data in the database table as a group of data into the recording node so as to perform embedded point processing, and determining the data stored in the recording node as data to be synchronized corresponding to the system transaction event.
Alternatively, the data preprocessing of the heterogeneous table may be performed on the updated data, and then the buried point marking is performed, that is, the primary key, the data and the data table name of the present data in the database table are used as a group of data to be stored in the data record node to be synchronized, so as to obtain the data to be synchronized.
Optionally, the control synchronization system performs data preprocessing on the updated data changed after the system transaction event to obtain preprocessed data, including: determining a data primary key of update data corresponding to a system transaction event, and extracting the update data from an original data table of a synchronous system according to the data primary key; and determining target data to be preprocessed from the updated data based on a preset screening rule, and performing translation processing on the target data to obtain preprocessed data.
For example, TALBE_A is an original data table, szPrimaryKey_1 and szPrimaryKey_2 are primary keys of updated data, szRevVal_1 and szRevVal_2 are data to be preprocessed, and the preprocessing can achieve data synchronization among heterogeneous table structures.
Specifically, the main keys szprimary key_1 and szprimary key_2 of the update data to be synchronized are firstly obtained from the bus, the complete data of the record in the data table TALBE_A is further queried according to the main keys, further, the target data to be preprocessed, such as the code CNY used in the new system by the RMB currency, and the code 01 used in the old system, are determined from the update data based on a preset screening rule, and preprocessing translation is needed at this time.
Optionally, the data to be preprocessed and translated can be processed by using a preset code, and after preprocessing is completed, the data to be synchronized is assembled, that is, an appointed message format is assembled, and finally the data to be synchronized is inserted into the transmission data table.
S103, controlling the synchronization system to match the transmission data table with a corresponding processing process, and calling the processing process to synchronously transmit the transmission data table to the synchronized system so as to instruct the synchronized system to perform data synchronization.
Wherein a processing procedure may be bound for each transmit data table. If the number of the sending data tables is at least two, the number of the determined processing processes of the sending data tables is also at least two, and the processing processes corresponding to the sending data tables can be called to send the sending data tables to the synchronized system.
Optionally, before the call processing process sends the sending data table to the synchronized system, the synchronized system may sort the data in the sending data table according to a time sequence, and assemble the message, for example, sort according to a transaction date, a transaction serial number, and a registration time ascending order, so as to represent the data to be synchronized. Further, the request is sent to the synchronized system through the HTTP protocol, and an exception handling mechanism is set. When the feedback information of the synchronized system is received by the synchronous system and overtime or return error occurs, the data are repeatedly processed; when the synchronization system receives a correct response, the synchronization state of the data can be modified from the state to be synchronized to the synchronized state.
For example, referring to fig. 1b, tarbe_a to tarbe_f are original data TABLEs, table_send_a to table_send_e are generated data TABLEs to be synchronized, that is, sending data TABLEs, process_a to process_e are processing processes corresponding to each sending data TABLE, specifically, the processing process_e in the synchronization system may read information of the sending data TABLE table_send_e and send the information to a PROCESS pool of the synchronized system, and in addition, the multiprocess processes process_a to process_e may send multiple sending data TABLEs to the synchronized system synchronously, thereby effectively improving synchronization efficiency.
Alternatively, at least one of the original data TABLEs of the transmission change may be processed to generate a data TABLE to be synchronized, see fig. 1B for the case of generating the transmission data TABLE table_send_e according to the talbe_e to the talbe_f.
It should be noted that, by binding each transmission data table to a processing process, it is not only ensured that the data of each data table is processed linearly in time, but also that the overall data synchronization is within a time delay of 1 s.
Optionally, after the calling processing procedure synchronously sends the sending data table to the synchronized system, the method further includes: the control synchronization system determines the running state of the processing process and the transmission condition of the transmission data table based on a preset monitoring period; and determining whether the synchronous system is abnormal according to the running state and/or the sending condition, and if so, carrying out alarm processing.
The sending condition may be, for example, that the number of times of synchronization failure of a sending data table exceeds a preset number of times threshold, that is, abnormal accumulation exceeds a threshold, and at this time, an alarm prompt message may be sent to related personnel to perform manual intervention processing.
For example, the data synchronization-transmission task running state and the number of data entries to be transmitted may be checked every 15 seconds using a monitoring module health check mechanism provided inside the synchronization system. If the state of the task process is abnormal, sending alarm prompt information and automatically restarting the abnormal process. If the abnormal accumulation of the data exceeds the threshold value, sending alarm prompt information and carrying out manual intervention processing.
Optionally, the instructing the synchronized system to perform data synchronization includes: the synchronized system is controlled to monitor the information sent by the synchronizing system in a process pool mode to acquire a sending data table, and a data synchronizing message in the sending data table is determined; and according to the analysis result of the synchronous message, the transaction date and the transaction serial number in the sending data table, if the sending data table is detected to meet the synchronous condition, performing table operation, and generating a corresponding receiving data table to complete data synchronization.
Optionally, after the sent data table is received by the synchronization system, a synchronization message can be determined according to transaction information in the sent data table, a recvOldRecData method is called, whether the message format is correct or not is judged, and according to a message analysis result and the receiving time of the received sent data table, a data table is obtained by performing a plug-in operation, so that data synchronization is realized.
The synchronized system may analyze the message according to the specified separator, determine whether the message can be analyzed to obtain a preset data item, and whether the format of the data item meets the preset format requirement, if so, determine that the message analysis is successful.
The specific process of message parsing may be: 1> whether the separator of the message is correct; 2> processing the message according to the separator, and judging whether the corresponding operation table and the operation type accord with the pre-configuration; 3> whether the converted SQL statement is correct; 4> whether the converted SQL statement can correspond to the table structure of the appointed table; 5> whether the SQL statement is executed correctly; any step of error reporting in the process can be regarded as error of the message and synchronization failure.
Optionally, the synchronized system may determine whether the data already exists according to matching of the transaction date and the transaction serial number in the transaction information in the stored data table, if so, the synchronized system considers that the data is a repeated request, and at this time, the synchronizing operation is not performed.
Optionally, after the synchronized system receives the transmission data table, a table operation may be performed, where the operation success is regarded as the synchronization success, and the operation failure is regarded as the synchronization failure.
According to the technical scheme, if the system transaction event is detected, a synchronous system and a synchronized system are determined; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services; the control synchronization system determines transaction information and data to be synchronized corresponding to a system transaction event, and generates a transmission data table according to the transaction information and the data to be synchronized; and controlling the synchronous system to match the transmission data table with a corresponding processing process, and calling the processing process to synchronously transmit the transmission data table to the synchronized system so as to instruct the synchronized system to perform data synchronization. By the method, data level synchronization of heterogeneous data tables among databases of cross-system and cross-operation environments can be realized, validity and correctness of data under a parallel scene of the new and old business systems are guaranteed, and operation stability of the new and old systems is guaranteed.
Example two
Fig. 2A is a flowchart of a data synchronization method according to a second embodiment of the present invention; fig. 2B is a flowchart of a data synchronization method according to a second embodiment of the present invention; the embodiment provides a preferable example of the interaction of the synchronous system and the synchronized system to realize data synchronization on the basis of the embodiment.
As shown in fig. 2A, the method may include the following process:
after the data transmitting center of the synchronous system executes the method described in the above embodiment of the present invention to determine the transmitting data table, a synchronous request may be transmitted to the synchronized system based on the HTTP protocol+json message assembly format. The data receiving center of the synchronized system can perform message parsing.
If the message analysis is successful, the data operation (new/delete/modify) is performed, if the data operation is successful, the processing is determined to be successful, and if the data operation is failed, the processing is determined to be failed.
If the message analysis fails, the processing is determined to fail, and if the message analysis is successful but the data is repeatedly received, the processing success can be directly determined not to carry out synchronous operation.
Optionally, if the processing by the synchronous system is successful, a success signal can be returned to the synchronous system based on the HTTP protocol and the JSON message assembly format, and if the processing by the synchronous system fails, a failure signal can be returned to the synchronous system based on the HTTP protocol and the JSON message assembly format. The success signal and the failure signal are finally fed back to the data transmission center of the synchronous system.
If the data transmission center of the synchronous system detects that the response of the synchronous system is overtime, the synchronous failure can be determined.
If the data transmission center of the synchronous system receives the success response, the data transmission center can determine that the synchronization is successful, and at the moment, the data transmission state can be updated to finish the synchronization task.
If the data transmission center of the synchronous system receives the failure response, the data transmission center can determine that the synchronization fails and automatically end the synchronization task.
Preferably, referring to fig. 2B, the synchronization system may perform online transactions with the user when detecting user access, perform add/drop/change operations, data preprocessing, and data embedded processing on the original data table in the database, and return the processed transactions to the user. After the data of the database of the synchronous system changes, the data interaction/exception processing can be performed between the database and the synchronous system so as to instruct the synchronous system to perform synchronous processing, specifically, the synchronous system can process transactions, perform data processing in the local database according to the type of pre-filling operation, and finally return the synchronous result to the synchronous system.
In summary, the technical scheme of the invention has the following advantages: the transaction operation and the data synchronization are asynchronous, so that the coupling between the transaction operation and the data synchronization is reduced, and the transaction failure cannot be caused by the data synchronization failure. And the method is separated from the bottom layer, the data synchronization is decoupled from the running environment and the database types, and the data synchronization among different databases in different programming languages is supported. The data synchronization among heterogeneous tables is realized, the field value preprocessing and the field conversion are supported, and the synchronization of the data of the table A to the table B can be realized. And a certain level of data concurrency is supported, and a data synchronization service with lower delay is provided. And (3) linearly synchronizing the data, ensuring that the data is accurate, continuously running the service, and checking the synchronous data to a certain degree.
Example III
Fig. 3 is a block diagram of a data synchronization device according to a third embodiment of the present invention; the embodiment can be suitable for the situation of carrying out data synchronization on two systems during the parallel operation of the new and old service systems, and the data synchronization device provided by the embodiment of the invention can execute the data synchronization method provided by any embodiment of the invention and has the corresponding functional modules and beneficial effects of the execution method; the data synchronization device can be implemented in hardware and/or software and is configured in a device having data synchronization functions, such as a new service system or an old service system.
As shown in fig. 3, the data synchronization device specifically includes:
a determining module 301, configured to determine a synchronized system and a synchronized system if a system transaction event is detected; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services;
the generating module 302 is configured to control the synchronization system to determine transaction information and data to be synchronized corresponding to a system transaction event, and generate a transmission data table according to the transaction information and the data to be synchronized;
and the sending module 303 is configured to control the synchronization system to match the sending data table with a corresponding processing procedure, and invoke the processing procedure to send the sending data table to the synchronized system synchronously, so as to instruct the synchronized system to perform data synchronization.
According to the technical scheme, if the system transaction event is detected, a synchronous system and a synchronized system are determined; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services; the control synchronization system determines transaction information and data to be synchronized corresponding to a system transaction event, and generates a transmission data table according to the transaction information and the data to be synchronized; and controlling the synchronous system to match the transmission data table with a corresponding processing process, and calling the processing process to synchronously transmit the transmission data table to the synchronized system so as to instruct the synchronized system to perform data synchronization. By the method, data level synchronization of heterogeneous data tables among databases of cross-system and cross-operation environments can be realized, validity and correctness of data under a parallel scene of the new and old business systems are guaranteed, and operation stability of the new and old systems is guaranteed.
Further, the determining module 301 is specifically configured to:
in the process of trading between the user and the old and new systems, if the database of the target system is detected to be updated, determining that a system trading event is detected;
and determining the target system of the data update of the database as a synchronous system, and determining the other systems as synchronized systems.
Further, wherein the transaction information includes at least one of: transaction date, transaction serial number, synchronized list name, data synchronous sending state, registration time, data synchronous last processing time, data processing times and data synchronous message.
Further, the generating module 302 may include:
the control unit is used for controlling the synchronous system to perform data preprocessing on the updated data changed after the system transaction event so as to obtain preprocessed data;
and the determining unit is used for storing the primary key, the data content and the data table name of the preprocessed data in the database table as a group of data into the recording node so as to perform embedded point processing, and determining the data stored in the recording node as data to be synchronized corresponding to the system transaction event.
Further, the control unit is specifically configured to:
determining a data primary key of update data corresponding to a system transaction event, and extracting the update data from an original data table of a synchronous system according to the data primary key;
and determining target data to be preprocessed from the updated data based on a preset screening rule, and performing translation processing on the target data to obtain preprocessed data.
Further, the device is also used for:
the control synchronization system determines the running state of the processing process and the transmission condition of the transmission data table based on a preset monitoring period;
and determining whether the synchronous system is abnormal according to the running state and/or the sending condition, and if so, carrying out alarm processing.
Further, the sending module 303 is specifically configured to:
the synchronized system is controlled to monitor the information sent by the synchronizing system in a process pool mode to acquire a sending data table, and a data synchronizing message in the sending data table is determined;
and according to the analysis result of the synchronous message, the transaction date and the transaction serial number in the sending data table, if the sending data table is detected to meet the synchronous condition, performing table operation, and generating a corresponding receiving data table to complete data synchronization.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Fig. 4 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the data synchronization method.
In some embodiments, the data synchronization method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data synchronization method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data synchronization method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of data synchronization, comprising:
if a system transaction event is detected, determining a synchronous system and a synchronized system; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services;
the control synchronization system determines transaction information and data to be synchronized corresponding to a system transaction event, and generates a transmission data table according to the transaction information and the data to be synchronized;
and controlling the synchronous system to match the transmission data table with a corresponding processing process, and calling the processing process to synchronously transmit the transmission data table to the synchronized system so as to instruct the synchronized system to perform data synchronization.
2. The method of claim 1, wherein determining the synchronized system and the synchronized system if a system transaction event is detected comprises:
in the process of trading between the user and the old and new systems, if the database of the target system is detected to be updated, determining that a system trading event is detected;
and determining the target system of the data update of the database as a synchronous system, and determining the other systems as synchronized systems.
3. The method of claim 1, wherein the transaction information includes at least one of: transaction date, transaction serial number, synchronized list name, data synchronous sending state, registration time, data synchronous last processing time, data processing times and data synchronous message.
4. The method of claim 1, wherein controlling the synchronization system to determine data to be synchronized corresponding to a system transaction event comprises:
the control synchronization system performs data preprocessing on the updated data changed after the system transaction event to obtain preprocessed data;
and storing the primary key, the data content and the data table name of the preprocessed data in the database table as a group of data into the recording node so as to perform embedded point processing, and determining the data stored in the recording node as data to be synchronized corresponding to the system transaction event.
5. The method of claim 4, wherein controlling the synchronization system to perform data preprocessing on the updated data that has changed after the system transaction event to obtain preprocessed data comprises:
determining a data primary key of update data corresponding to a system transaction event, and extracting the update data from an original data table of a synchronous system according to the data primary key;
and determining target data to be preprocessed from the updated data based on a preset screening rule, and performing translation processing on the target data to obtain preprocessed data.
6. The method of claim 1, wherein after invoking the processing process to synchronize the transmission data table to the synchronized system, further comprising:
the control synchronization system determines the running state of the processing process and the transmission condition of the transmission data table based on a preset monitoring period;
and determining whether the synchronous system is abnormal according to the running state and/or the sending condition, and if so, carrying out alarm processing.
7. The method of claim 1, wherein the instructing the synchronized system to perform data synchronization comprises:
the synchronized system is controlled to monitor the information sent by the synchronizing system in a process pool mode to acquire a sending data table, and a data synchronizing message in the sending data table is determined;
and according to the analysis result of the synchronous message, the transaction date and the transaction serial number in the sending data table, if the sending data table is detected to meet the synchronous condition, performing table operation, and generating a corresponding receiving data table to complete data synchronization.
8. A data synchronization device, comprising:
the determining module is used for determining a synchronous system and a synchronized system if a system transaction event is detected; the synchronous system and the synchronized system are new and old business systems which run in parallel to perform business services;
the generation module is used for controlling the synchronous system to determine transaction information and data to be synchronized corresponding to the system transaction event, and generating a transmission data table according to the transaction information and the data to be synchronized;
and the sending module is used for controlling the synchronous system to match the corresponding processing process for the sending data table, and calling the processing process to synchronously send the sending data table to the synchronized system so as to instruct the synchronized system to carry out data synchronization.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program for execution by the at least one processor to enable the at least one processor to perform the data synchronization method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the data synchronization method of any one of claims 1-7.
CN202311607541.6A 2023-11-28 2023-11-28 Data synchronization method, device, equipment and storage medium Pending CN117807159A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311607541.6A CN117807159A (en) 2023-11-28 2023-11-28 Data synchronization method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311607541.6A CN117807159A (en) 2023-11-28 2023-11-28 Data synchronization method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117807159A true CN117807159A (en) 2024-04-02

Family

ID=90419301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311607541.6A Pending CN117807159A (en) 2023-11-28 2023-11-28 Data synchronization method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117807159A (en)

Similar Documents

Publication Publication Date Title
CN116107589B (en) Automatic compiling method, device and equipment of software codes and storage medium
CN114328132A (en) Method, device, equipment and medium for monitoring state of external data source
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN113656252B (en) Fault positioning method, device, electronic equipment and storage medium
CN116627432A (en) Front-end application automatic deployment method, device, equipment and medium
CN117807159A (en) Data synchronization method, device, equipment and storage medium
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN115421728A (en) Business code generation method and device, electronic equipment and storage medium
CN111694686B (en) Processing method and device for abnormal service, electronic equipment and storage medium
CN113110921B (en) Operation method, device, equipment and storage medium of block chain system
CN116915870B (en) Task creation request processing method, device, electronic equipment and readable medium
CN113609145B (en) Database processing method, device, electronic equipment, storage medium and product
CN113595870B (en) Push message processing method and device, electronic equipment and storage medium
CN117009363A (en) Service data docking method and device, electronic equipment and storage medium
CN117668114A (en) Data synchronization method, device, equipment and medium
CN117640752A (en) SWIFT standard-based message matching method, device and equipment
CN117193818A (en) Service system updating method, device, equipment and medium
CN117632427A (en) Dynamic transaction behavior scheduling method based on micro-service embedded scheduling framework
CN117742899A (en) Distributed transaction processing method, device and medium in distributed database
CN116049311A (en) Data synchronization method and device, electronic equipment and storage medium
CN117632601A (en) Master-slave machine database switching method, device, equipment and storage medium
CN118132533A (en) Data processing method, device, equipment and storage medium
CN115129554A (en) Consensus transaction tracking method, device, equipment and storage medium
CN115757275A (en) Asset information management method and device, electronic equipment and storage medium
CN117938909A (en) Data transmission method, device, equipment and medium

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