An inter-table data synchronization method and device, electronic equipment and storage medium

By creating a proxy table in the database of the target business system and triggering a trigger, the problems of data synchronization complexity and asynchrony in the existing technology are solved, realizing real-time data synchronization between business systems and ensuring the accuracy and efficiency of data operations.

CN114416880BActive Publication Date: 2025-10-17AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210086398.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2025-10-17
Estimated Expiration
2042-01-25

AI Technical Summary

Technical Problem

In existing technologies, obtaining data from various business systems in batches by calling interfaces increases system complexity, is inefficient, and timed synchronization may lead to data inconsistency and business data errors.

Method used

Create a proxy table in the database of the target business system, monitor data operations on the entity table, and trigger a pre-established trigger to project the proxy table after data operations onto the entity table of the business system to achieve real-time data synchronization.

Benefits of technology

It enables efficient and accurate data synchronization between business systems, avoiding operational errors caused by data asynchrony and improving system stability and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416880B_ABST
    Figure CN114416880B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a kind of inter-table data synchronization method, device, electronic equipment and storage medium.The method comprises: determining target business system and the business system of data business in each business system with target business system in target business system;Corresponding proxy table of target database in target business system is created in target business system with the business system of data business;Whether the target entity table for recording the business data of target business system stored in target database is monitored to occur data operation;If yes, then trigger the target trigger pre-established in target business system, data operation is carried out to the proxy table in target database, and the proxy table after data operation is projected to the business system of corresponding data business system stored in the business system of corresponding data business system.This embodiment of the present application can synchronize the data in the business system of data business with the data in target business system in real time, which helps to accurately complete the business operation between business systems.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer technology, and particularly relate to a method and apparatus for synchronizing data between tables, an electronic device, and a storage medium. BACKGROUND

[0002] Different database servers of different business systems respectively store their own institution entity tables. In order to prevent business data errors in the process of business transactions between business systems, each business system needs to synchronously obtain the updated institution entity table in the business system having a business transaction relationship.

[0003] In the prior art, in order to keep the data synchronization between business systems having business transactions, a corresponding calling interface is usually established for each business system, and the institution entity table in each business system is obtained by periodically sending a calling request to the calling interface to realize the data synchronization between systems.

[0004] However, the batch acquisition of data of each business system through the calling interface increases the system complexity and is not efficient. In addition, the periodic sending of a calling request to the calling interface still causes a periodic time interval in which the data of each business system having a business transaction is not synchronized, and the business operation in the periodic time interval may still cause business data errors. SUMMARY

[0005] Embodiments of the present application provide a method and apparatus for synchronizing data between tables, an electronic device, and a storage medium, to realize the real-time synchronization of data in a transaction business system and data in a target business system, and to help efficiently and accurately complete the business operation between business systems.

[0006] In a first aspect, embodiments of the present application provide a method for synchronizing data between tables, wherein a target business system and a transaction business system having a data business transaction with the target business system are determined in each business system.

[0007] A proxy table corresponding to the transaction business system is created in a target database of the target business system.

[0008] It is determined whether a target entity table for recording business data of the target business system stored in the target database has a data operation.

[0009] If yes, a target trigger pre-established in the target business system is triggered, the data operation is performed on the proxy table in the target database, and the proxy table after the data operation is projected into a transaction entity table stored in the corresponding transaction business system.

[0010] In a second aspect, embodiments of the present application further provide an apparatus for synchronizing data between tables, which comprises:

[0011] determining a target business system module for determining a target business system and a correspondent business system having data business with the target business system in each business system;

[0012] creating an agent table module for creating an agent table corresponding to the correspondent business system in a target database of the target business system;

[0013] monitoring a target entity table module for monitoring whether a target entity table for recording business data of the target business system stored in the target database has a data operation; if yes, entering a trigger projection module;

[0014] triggering a projection module for triggering a target trigger pre-established in the target business system to perform the data operation on the agent table in the target database and projecting the agent table after the data operation into a correspondent entity table stored in the correspondent business system.

[0015] In a third aspect, an electronic device is provided, and the electronic device includes:

[0016] one or more processors;

[0017] a memory device configured to store one or more programs,

[0018] when the one or more programs are executed by the one or more processors, the one or more processors implement the inter-table data synchronization method provided by any of the embodiments of the present application.

[0019] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the inter-table data synchronization method provided by any of the embodiments of the present application.

[0020] The method for synchronizing data between tables provided by the embodiment of the present application comprises the following steps: determining a target business system and a corresponding business system in each business system; creating a proxy table corresponding to the corresponding business system in the target database of the target business system; monitoring whether a target entity table used for recording business data of the target business system stored in the target database has data operation; if yes, triggering a target trigger pre-established in the target business system to perform data operation on the proxy table in the target database, and projecting the proxy table after the data operation into a corresponding corresponding entity table stored in the corresponding business system. When the target entity table has data operation, the target trigger can be triggered to perform data operation on the proxy table to complete projection on the corresponding entity table, so that the data in the corresponding business system and the data in the target business system are synchronized in real time, and the business operation between the business systems can be efficiently and accurately completed.

[0021] In addition, the device for synchronizing data between tables, the electronic equipment and the storage medium provided by the present application correspond to the above method and have the same beneficial effects. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly explain the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0023] Figure 1 The flow chart of the method for synchronizing data between tables provided by the embodiment of the present application;

[0024] Figure 2 The flow chart of another method for synchronizing data between tables provided by the embodiment of the present application;

[0025] Figure 3 The structure diagram of the device for synchronizing data between tables provided by the embodiment of the present application;

[0026] Figure 4 The structure diagram of the electronic equipment provided by the embodiment of the present application. DETAILED DESCRIPTION

[0027] The present application will be further described in detail below in combination with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.

[0028] It is also important to note that the use of the terms "exemplary" and "example" are intended to refer to one or more implementations, embodiments, and / or examples. Additionally, the term "in accordance with an embodiment" is used herein to refer to an embodiment in accordance with one or more implementations, embodiments, and / or examples. Furthermore, examples of the use of the term "in accordance with an embodiment" are intended to be examples for the implementation(s), embodiment(s), and / or example(s) and are not intended to suggest that a particular implementation(s), embodiment(s), and / or example(s) is required having regard to the present disclosure. For example, the terms "in accordance with an embodiment" and "in accordance with an embodiment" are not required to refer to the same implementation(s), embodiment(s), and / or example(s). Also, the term "in accordance with an embodiment" is used solely to refer to the particular implementation(s), embodiment(s), and / or example(s) in which the particular implementation(s), embodiment(s), and / or example(s) is / are described as such. Thus, the use of the term "in accordance with an embodiment" is not intended to refer to an embodiment in accordance with one or more other implementation(s), embodiment(s), and / or example(s) described herein. Additionally, the terms "first," "second," "third," etc. can be used herein to describe various implementation(s), embodiment(s), and / or example(s) and the terms are not intended to denote chronological order or the relative order of implementation(s), embodiment(s), and / or example(s) unless explicitly stated otherwise.

[0029] In order to make the technical personnel in the art better understand the present application, the following will be further described in detail in conjunction with the drawings and specific embodiments.

[0030] Embodiment one

[0031] Figure 1 A flow chart of a table data synchronization method is provided in the embodiment of the present application. The method can be executed by a table data synchronization device, which can be implemented by software and / or hardware, and can be configured in a terminal and / or a server to implement the table data synchronization method in the embodiment of the present application.

[0032] As shown in the method of the embodiment, the method can specifically include: Figure 1

[0033] S101, determining a target business system and a correspondent business system having data business with the target business system in each business system.

[0034] In a specific implementation, each business system having business with other business systems and needing to synchronize business data to other business systems can be determined as a target business system, and a business system having business with the target business system is referred to as a correspondent business system. One target business system can correspond to two or more correspondent business systems.

[0035] It should be noted that the database of each business system respectively stores an entity table for storing business data, and when the business data changes, the update of the business data can be completed by operating the data recorded in the entity table. In the embodiment, the entity table for storing target business data in the target business system is referred to as a target entity table, and the entity table for storing business data in the correspondent business system is referred to as a correspondent entity table.

[0036] For example, the target database of the target business system can be a Sybase database.

[0037] ​S102, create a proxy table corresponding to the counterpart business system in the target database of the target business system.

[0038] In a specific implementation, in order to complete the data synchronization of each counterpart business system, a proxy table corresponding to each counterpart business system can be created in the target database of the target business system according to the one-to-one correspondence between the counterpart business system and the proxy table. It should be noted that the proxy table technology is the key to realizing location transparency, and the proxy table can be a local table containing remote data.

[0039] For example, the system identifier of the corresponding counterpart business system can be included in each proxy table, and the correspondence between each proxy table and the counterpart business system is established through the system identifier.

[0040] S103, monitor whether the target entity table for recording the business data of the target business system stored in the target database has a data operation; if so, proceed to S104.

[0041] In a specific implementation, the target entity table stored in the target database of the target business system can be monitored. Specifically, it can be detected whether the business data of the record in the target entity table has a data operation. The data operation includes at least one of the insertion operation, the deletion operation and the update operation.

[0042] Optionally, monitoring whether the target entity table for recording the business data of the target business system stored in the target database has a data operation includes: monitoring whether the target entity table for recording the business data of the target business system stored in the target database has at least one of the insertion operation, the deletion operation and the update operation.

[0043] Specifically, when the business data in the target entity table has at least one of the insertion operation, the deletion operation and the update operation, in order to ensure that each business system can work normally, it is necessary to perform a data operation on each counterpart business system consistent with the insertion operation, the deletion operation and the update operation of the target entity table.

[0044] When the business data in the target entity table does not have a data operation, it indicates that the current target business system does not have a business data change, and there is no need to perform a data synchronization operation on each counterpart business system, and the target entity table can continue to be monitored.

[0045] S104, trigger the target trigger pre-established in the target business system to perform a data operation on the proxy table in the target database, and project the proxy table after the data operation into the counterpart entity table stored by the corresponding counterpart business system.

[0046] Specifically, when the business data in the target entity table is detected to have a data operation, the target trigger pre-established in the target business system can be triggered directly. It should be noted that the trigger is a stored procedure that acts when data is inserted, deleted or updated in a table. The trigger can be used to perform operations such as making cascade changes to the related table, implementing column restrictions, comparing the results of data modification, etc.

[0047] Further, after the target trigger is triggered, the same data operation can be performed on the agent table stored in the target database as the target entity table. Optionally, the data operation on the agent table in the target database includes: when the target entity table is detected to have an update operation, determining whether the operation object of the update operation is a non-primary key column in the target entity table; if it is a non-primary key column, based on the index information reflected by the primary key column in the target entity table, searching for the non-primary key column corresponding to the update operation in the target entity table to perform the update operation.

[0048] Specifically, when the non-primary key column in the target entity table has an update operation, the index information reflected by the primary key column in the inserted table generated when the update operation is connected to determine the position of the non-primary key corresponding to the index information in the agent table, and the data of the non-primary key column is updated. When the primary key column in the target entity table has an update operation, the primary key column in the deleted table can be connected to perform the update operation.

[0049] Further, the agent table after the data operation can be projected into the corresponding counterparty entity table stored in the counterparty business system to realize data synchronization of the data in the counterparty business system.

[0050] Optionally, it also includes: detecting whether the business connection between the target business system and other business systems changes; if so, based on the change of the business connection, updating the agent table in the target database and the counterparty business system.

[0051] Specifically, when the business connection between the target business system and other business systems changes, the agent table of the counterparty business system in the target database can be updated based on the current business connection to accurately and efficiently update the data in the counterparty business system. Exemplarily, the change of the business connection includes adding a counterparty business system having business connection to the target business system and deleting an original counterparty business system.

[0052] An embodiment of the present invention provides a method for synchronizing data between tables. The method determines, in each business system, a target business system and a transaction business system that has data business transactions with the target business system. By creating a proxy table corresponding to the transaction business system in a target database of the target business system, the method monitors whether a target entity table stored in the target database for recording the business data of the target business system has undergone data operations. If so, the method triggers a target trigger pre-established in the target business system, performs data operations on the proxy table in the target database, and projects the proxy table after the data operations onto the transaction entity table stored in the corresponding transaction business system. When data operations occur on the target entity table, the embodiment of the present invention can trigger the target trigger to perform data operations on the proxy table to complete the projection of the transaction entity table, thereby achieving real-time synchronization of the data in the transaction business system with the data in the target business system, which helps to efficiently and accurately complete business operations between business systems.

[0053] Example 2

[0054] Figure 2 A flowchart of another inter-table data synchronization method provided by an embodiment of the present invention. This embodiment is optimized based on the aforementioned technical solutions. Optionally, after performing data operations on the proxy table in the target database, the method further includes: determining the target number of operation rows in the target entity table and the number of proxy operation rows in the proxy table after the data operations; and determining, based on the target number of operation rows and the number of proxy operation rows, whether the data operation performed on the proxy table by the target trigger has been abnormal. Explanations of terms that are identical or corresponding to those in the aforementioned embodiments are not repeated here.

[0055] like Figure 2 As shown, the method of this embodiment may specifically include:

[0056] S201: Determine a target business system and a transaction business system having data transactions with the target business system from among various business systems.

[0057] S202: Create a proxy table corresponding to the transaction system in the target database of the target business system.

[0058] S203 , monitoring whether a target entity table stored in the target database for recording business data of the target business system has any data operation; if yes, proceeding to S204 .

[0059] S204: Trigger the target trigger pre-established in the target business system to perform data operations on the proxy table in the target database.

[0060] S205, determine the target operation row number of the target entity table and the agent operation row number in the agent table after the data operation; based on the target operation row number and the agent operation row number, determine whether the data operation of the target trigger on the agent table is abnormal operation, if not, enter S206.

[0061] Specifically, in order to prevent data operation from being wrong, the target operation row number of the target entity table and the agent operation row number in the agent table can be determined after the data operation on the data in the agent table. For example, the target operation row number can be the changed row number of the target entity table after operation, and the agent operation row number of the agent table can be the changed row number of the agent table after the data operation.

[0062] When the target operation row number and the agent operation row number are consistent, it can be determined that the data operation of the target trigger on the agent table is normal, and the data operation of the target entity table is consistent, and the agent table after the data operation can be projected into the corresponding correspondent entity table stored in the correspondent business system. When the target operation row number and the agent operation row number are inconsistent, it means that the data operation of the target trigger on the agent table is abnormal, and the data change of the target entity table cannot be synchronized to the correspondent entity table of the correspondent business system through the agent table.

[0063] Optionally, after determining whether the data operation of the target trigger on the agent table is abnormal operation, the method further comprises: if the operation is abnormal, generating an exception record based on the table information of the agent table with abnormal operation and storing the exception record in the system log, and triggering the target trigger to perform data operation on the agent table with abnormal operation again.

[0064] Specifically, in order to facilitate the operation and maintenance personnel to find out the problem and solve it in time, the exception record can be generated based on the table information of the agent table with abnormal operation and stored in the system log, so that the operation and maintenance personnel can directly view the detailed abnormal situation when checking the system log. Further, the agent table with abnormal operation can be triggered again to ensure that the agent table can perform normal data operation and be projected into the corresponding correspondent entity table stored in the correspondent business system.

[0065] Optionally, the method further comprises: when the number of abnormal operations of the agent table is greater than a preset number threshold, generating an exception information based on the pre-stored contact information of the operation and maintenance personnel and sending the exception information to the operation and maintenance terminal.

[0066] Specifically, a preset threshold of the number of times of the exception can be set in advance, when the number of times of the exception of the agent table in the data operation is greater than the preset threshold, it indicates that the current data synchronization operation is more frequent, in order to avoid mistakes, the exception information can be generated and sent to the operation and maintenance terminal. For example, the contact information of the operation and maintenance personnel can be stored in advance, and the exception information can be sent to the operation and maintenance terminal according to the contact information. The contact information includes telephone, email and the like.

[0067] S206, projecting the agent table after the data operation into the corresponding inter-business entity table stored in the inter-business system.

[0068] The embodiment of the present application can detect the agent table after the data operation, determine whether the data operation process is abnormal, thereby ensuring the accuracy of the data synchronization process and ensuring that each business system can work normally; when the abnormal situation occurs, the exception information can be generated and sent to the operation and maintenance terminal, thereby reminding the operation and maintenance personnel to process in time.

[0069] Embodiment three

[0070] Figure 3 A structure diagram of a table data synchronization device provided by the embodiment of the present application, the device is used for executing the table data synchronization method provided by any of the above embodiments. The device and the table data synchronization method of each embodiment belong to the same inventive concept, and the details not described in the embodiment of the table data synchronization device can be referred to the embodiment of the table data synchronization method. The device can specifically include:

[0071] The target business system module 10 is used for determining the target business system and the inter-business system having the data business with the target business system in each business system;

[0072] The agent table creating module 11 is used for creating the agent table corresponding to the inter-business system in the target database of the target business system;

[0073] The target entity table monitoring module 12 is used for monitoring whether the target entity table for recording the business data of the target business system stored in the target database has the data operation; if yes, the projection module is entered;

[0074] The trigger projection module 13 is used for triggering the target trigger pre-established in the target business system, performing the data operation on the agent table in the target database, and projecting the agent table after the data operation into the corresponding inter-business entity table stored in the inter-business system.

[0075] On the basis of any optional technical solution in the embodiment of the present application, optionally, the device further includes:

[0076] The determining operation row number module is configured to determine a target operation row number of the target entity table and an agent operation row number in the agent table after the data operation on the agent table in the target database is performed, and determine whether the data operation performed on the agent table by the target trigger is abnormal operation based on the target operation row number and the agent operation row number.

[0077] In the embodiment of the application, the operation row number determining module comprises:

[0078] The record abnormality module is configured to, after determining whether the data operation performed on the agent table by the target trigger is abnormal operation, if the operation is abnormal, generate an abnormal record based on table information of the agent table on which the abnormal operation is performed, store the abnormal record into a system log, and trigger the target trigger to perform the data operation on the agent table on which the abnormal operation is performed again.

[0079] In the embodiment of the application, the operation row number determining module comprises:

[0080] The abnormal information generating module is configured to, when the number of times of abnormality of the data operation performed on the agent table is greater than a preset number threshold, generate abnormal information based on a pre-stored contact method of an operation and maintenance personnel, and send the abnormal information to an operation and maintenance terminal.

[0081] In the embodiment of the application, the data operation comprises at least one of an insertion operation, a deletion operation and an update operation.

[0082] The monitoring target entity table module 12 comprises:

[0083] The target entity table detecting unit is configured to monitor whether the target entity table stored in the target database and used for recording business data of the target business system is subjected to at least one of an insertion operation, a deletion operation and an update operation.

[0084] In the embodiment of the application, the trigger projection module 13 comprises:

[0085] The operation object determining unit is configured to, when it is monitored that the target entity table is subjected to an update operation, determine whether an operation object of the update operation is a non-primary key column in the target entity table, and if the operation object is the non-primary key column, search for the non-primary key column subjected to the update operation in the target entity table based on index information reflected by a primary key column in the target entity table.

[0086] In the embodiment of the application, the operation row number determining module comprises:

[0087] The updating agent table module is used for detecting whether the business connection between the target business system and other business systems changes, and if yes, updating the agent table of the target business system in the target database based on the change of the business connection.

[0088] The inter-table data synchronization device provided by the embodiment of the present application determines the target business system and the corresponding business system in each business system; creates the agent table corresponding to the corresponding business system in the target database of the target business system, monitors whether the target entity table used for recording the business data of the target business system stored in the target database is subjected to data operation, and if yes, triggers the target trigger pre-established in the target business system to perform data operation on the agent table in the target database, and projects the agent table after the data operation into the corresponding corresponding entity table stored in the corresponding business system. When the target entity table is subjected to data operation, the target trigger can be triggered to perform data operation on the agent table, so as to complete the projection on the corresponding entity table, thereby realizing the real-time synchronization of the data in the corresponding business system and the data in the target business system, and helping to efficiently and accurately complete the business operation between the business systems.

[0089] It is worth noting that the units and modules included in the above embodiment of the inter-table data synchronization device are only divided according to the functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual differentiation, and are not used to limit the protection scope of the present application.

[0090] Embodiment four

[0091] Figure 4 A structural diagram of an electronic device is provided for the embodiment of the present application. Figure 4 A block diagram of an exemplary electronic device 20 suitable for implementing embodiments of the present application is shown. The electronic device 20 shown is merely one example and should not be construed as limiting the scope of the present application.

[0092] As shown in Figure 4 The electronic device 20 is in the form of a general computing device. The components of the electronic device 20 can include, but are not limited to, one or more processors or processing units 201, system memory 202, and a bus 203 connecting the various system components, including the system memory 202 and the processing unit 201.

[0093] Bus 203 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration bus, a processor or local bus using any of a variety of bus architectures. By way of example, these architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.

[0094] Electronic device 20 typically includes a variety of computer system readable media. These media can be any available media that is accessible by electronic device 20 and includes both volatile and nonvolatile media, removable and non-removable media.

[0095] The system memory 202 can include computer system readable media in the form of volatile memory, such as random access memory (RAM) 204 and / or cache memory 205. Electronic device 20 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 206 can be provided for reading from and writing to non-removable, non-volatile magnetic media (e.g., a "hard drive"). A magnetic disk drive can also be provided for reading from and writing to a removable, non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive can be provided for reading from or writing to a removable, non-volatile optical disk (e.g., a CD-ROM, DVD-ROM or other optical media). In these instances, each can be connected to bus 203 by one or more data media interfaces. The memory 202 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.

[0096] Program / utility 208, having a set (at least one) of program modules 207, can be stored in, for example, memory 202 by way of example, such program modules 207 include an operating system, one or more application programs, other program modules, and program data, each or some combination thereof, can include implementation of a networking environment. Program modules 207 generally carry out the functions and / or methodologies of embodiments of the application as described herein.

[0097] The electronic device 20 can also be in communication with one or more external devices 209, such as a keyboard, a pointing device, a display 210, etc.; one or more devices that enable a user to interact with the electronic device 20; and / or one or more devices (e.g., modems, network cards, etc.) that enable the electronic device 20 to communicate with one or more other computing devices. Such communication can occur via an input / output (I / O) interface 211. Still yet, such communication can occur electronically over a network, such as a local area network (LAN) and / or a wide area network (WAN) such as the Internet. As an example, the network adapter 212 can be capable of communicating with the other electronic devices 20 over the network through a wired or wireless medium. The communication can occur according to a variety of communication protocols, such as TCP / IP, Bluetooth, Wi-Fi, etc. In embodiments in which the electronic device 20 communicates using a wireless medium, the network adapter 212 can include a wireless transceiver (e.g., radio frequency transceiver) and / or an optical transceiver (e.g., infrared transceiver).

[0098] The processing unit 201 executes various function applications and data processing by running programs stored in the system memory 202.

[0099] The electronic device provided by the present application can implement the following method: determining a target business system and a corresponding business system in each business system; creating a proxy table corresponding to the corresponding business system in the target database of the target business system; monitoring whether a target entity table used for recording business data of the target business system in the target database has data operation; if yes, triggering a target trigger previously established in the target business system to perform data operation on the proxy table in the target database, and projecting the proxy table after the data operation into a corresponding corresponding entity table stored in the corresponding business system. When the target entity table has data operation, the target trigger can be triggered to perform data operation on the proxy table to complete projection on the corresponding entity table, so that the data in the corresponding business system and the data in the target business system are synchronized in real time, and the business operation between the business systems is efficiently and accurately completed.

[0100] Embodiment five

[0101] The embodiment of the present application provides a storage medium containing computer executable instructions, the computer executable instructions are used for executing an inter-table data synchronization method when executed by a computer processor, and the method comprises the following steps:

[0102] The target business system and the correspondent business system are determined in each business system, a proxy table corresponding to the correspondent business system is created in a target database of the target business system, whether a data operation occurs to a target entity table recording business data of the target business system stored in the target database is monitored, if yes, a target trigger pre-established in the target business system is triggered to perform a data operation to the proxy table in the target database, and the proxy table after the data operation is projected into a correspondent entity table stored in the correspondent business system. When the data operation occurs to the target entity table, the target trigger is triggered to perform the data operation to the proxy table, so as to complete the projection to the correspondent entity table, thereby realizing the real-time synchronization of the data in the correspondent business system and the data in the target business system, and helping to efficiently and accurately complete the business operation between the business systems.

[0103] Of course, the computer executable instructions of the storage medium provided by the embodiment of the application are not limited to the method operations above, and can also perform the related operations in the inter-table data synchronization method provided by any embodiment of the application.

[0104] The computer storage medium of the embodiment of the application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, device or component.

[0105] The computer readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, in which a computer readable program code is borne. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can transmit, propagate or transport a program for use by or in connection with an instruction execution system, device or component.

[0106] The program code embodied on the computer readable media can be transmitted using any appropriate medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0107] Computer program code for carrying out operations of embodiments of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0108] Note that the foregoing are merely preferred embodiments of the present application and the principles of the technology applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, reconfigurations and substitutions can be made by those skilled in the art without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A method for synchronizing data between tables, characterized in that: include: Determine a target business system and a business system having data business transactions with the target business system in each business system; Creating a proxy table corresponding to the transaction system in a target database of the target business system; Monitoring whether a target entity table stored in the target database and used to record business data of the target business system has any data operation; If yes, trigger the target trigger pre-established in the target business system, perform the data operation on the proxy table in the target database, and project the proxy table after the data operation into the transaction entity table stored in the corresponding transaction business system; After performing the data operation on the proxy table in the target database, the method further includes: Determining the target operation row number of the target entity table and the proxy operation row number in the proxy table after the data operation; When the target operation row number and the proxy operation row number are consistent, it is determined that the data operation performed by the target trigger on the proxy table is normal; when the target operation row number and the proxy operation row number are inconsistent, it is determined that the data operation performed by the target trigger on the proxy table is abnormal; If an exception occurs, an exception record is generated based on the table information of the proxy table where the abnormal operation occurs and stored in the system log, and the target trigger is triggered to perform the data operation on the proxy table where the abnormal operation occurs again; When the number of exceptions occurring when the proxy table performs the data operation is greater than a preset threshold, exception information is generated based on pre-stored contact information of the operation and maintenance personnel and sent to the operation and maintenance terminal.

2. The method according to claim 1, characterized in that The data operation includes at least one of an insert operation, a delete operation, and an update operation; wherein, The monitoring of whether a data operation occurs in a target entity table stored in the target database and used to record business data of the target business system includes: Monitor whether a target entity table stored in the target database and used to record the business data of the target business system has at least one operation selected from the group consisting of an insert operation, a delete operation, and an update operation.

3. The method according to claim 2, characterized in that The performing the data operation on the proxy table in the target database includes: When an update operation is detected on the target entity table, determining whether the operation object of the update operation is a non-primary key column in the target entity table; If it is a non-primary key column, based on the index information reflected by the primary key column in the target entity table, the non-primary key column corresponding to the update operation is searched in the target entity table to perform the update operation.

4. The method according to claim 1, wherein Also includes: Check whether the business connection between the target business system and other business systems has changed: If yes, then based on the change of the business connection, the proxy table of the business system in the target database is updated.

5. A data synchronization device between tables, characterized in that: include: A target business system determination module is used to determine the target business system and the business systems that have data business transactions with the target business system from among various business systems; A proxy table creation module is used to create a proxy table corresponding to the current business system in the target database of the target business system; A target entity table monitoring module is used to monitor whether a data operation occurs in a target entity table stored in the target database and used to record the business data of the target business system; If yes, enter the trigger projection module; a trigger projection module, configured to trigger a target trigger pre-established in the target business system, perform the data operation on the proxy table in the target database, and project the proxy table after the data operation into a transaction entity table stored in the corresponding transaction business system; The device further comprises: an operation row number determination module, configured to determine, after performing data operations on the proxy table in the target database, a target operation row number of the target entity table and a proxy operation row number in the proxy table after the data operations; when the target operation row number and the proxy operation row number are consistent, determining that the data operation performed by the target trigger on the proxy table is normal; and when the target operation row number and the proxy operation row number are inconsistent, determining that the data operation performed by the target trigger on the proxy table is abnormal; An exception recording module is used for generating an exception record based on the table information of the proxy table where the abnormal operation occurred and storing it in the system log if an exception occurs, and triggering the target trigger to perform the data operation on the proxy table where the abnormal operation occurred again; The exception information generating module is used to generate exception information and send it to the operation and maintenance terminal based on the pre-stored contact information of the operation and maintenance personnel when the number of exceptions occurring in the data operation performed by the proxy table exceeds a preset number threshold.

6. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the inter-table data synchronization method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for synchronizing data between tables as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Data synchronization method and system and storage medium

    CN110377602A

  • Data synchronization method

    CN111241192A