Data synchronization method, apparatus, device, and storage medium

By updating the status in the banking system and using a data temporary table, the problem of transaction interruption caused by real-time data updates was solved, achieving complete data transmission and transaction consistency, and meeting the need for uninterrupted customer service.

CN116795931BActive Publication Date: 2025-12-30BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310809089.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-03
Publication Date
2025-12-30
Estimated Expiration
2043-07-03

AI Technical Summary

Technical Problem

In banking systems, due to the real-time updates of data, it is difficult to obtain static cross-sectional data. This causes incomplete online transactions to be forcibly interrupted when the data is transmitted to the back-end system, making it impossible to provide uninterrupted 24/7 customer service.

Method used

By updating the status to a synchronization waiting state at the synchronization start time node, updating the business table and data temporary storage table based on the received transaction requests, and then obtaining and sending the business data in the data temporary storage table to the back-end system after waiting for the termination time node, the integrity and consistency of data synchronization are ensured.

Benefits of technology

It enables the complete data to be transmitted to the back-end system without interrupting transactions, avoiding cross-sectional data loss, ensuring transaction consistency and network latency processing time, and meeting the requirements of 24/7 uninterrupted customer service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116795931B_ABST
    Figure CN116795931B_ABST
Patent Text Reader

Abstract

The application provides a data synchronization method, device and equipment and a storage medium, which can be used in the financial field. The method comprises the following steps: in response to the current time being a starting time node of the current synchronization, updating the current state from a synchronization completion state to a synchronization waiting state; updating a business table based on a received transaction request, or updating the business table and a data temporary storage table; the data temporary storage table comprises current synchronization business data in the business table which is covered by next synchronization business data; in response to the current time being a synchronization waiting termination time node, updating the current state from the synchronization waiting state to a synchronization state, and obtaining the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table; sending the current synchronization business data to a to-be-synchronized back-end system server; and updating the current state from the synchronization state to a synchronization completion state. The method realizes data synchronization without interrupting transactions, and ensures the consistency of transactions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the financial field, and more particularly to a data synchronization method, apparatus, device, and storage medium. Background Technology

[0002] In the early days, banks only had one service channel: the counter. Therefore, the various systems of the bank were divided into several stages according to the branch's business hours: starting day, business hours, closing day, and end of day. During the end of day stage, the core system would initiate an instruction to switch the accounting date to the next accounting day and transmit the data of the previous accounting day to the back-end system, thereby realizing information sharing between the various systems within the bank.

[0003] However, with technological advancements, banks have gradually developed various electronic channels such as self-service equipment, online banking, and mobile banking, and have integrated with third-party interfaces such as payment systems and UnionPay systems. This has created a demand for 24 / 7 uninterrupted customer service from the core system.

[0004] Because the data within the system is updated in real time, it is difficult to obtain static cross-sectional data. Currently, in order to download complete data for an accounting day to the back-end system, online transactions are usually suspended for a short period at the end of the day, and then resumed after the day is cut off. During this period, any incomplete online transactions are forcibly interrupted, and no new transaction requests are accepted, resulting in the bank not actually providing uninterrupted service to its customers. Summary of the Invention

[0005] This application provides a data synchronization method, apparatus, device, and storage medium to solve the problem that real-time data updates make it difficult to obtain static cross-sectional data, resulting in the forced interruption of incomplete online transactions when data is downloaded to the back-end system.

[0006] Firstly, this application provides a data synchronization method, including:

[0007] In response to the current time being the start time of this synchronization, the current state is updated from synchronization completed to synchronization waiting.

[0008] The business table is updated based on the received transaction request, or the business table and the data temporary storage table are updated; the business table includes the next synchronization business data, and the data temporary storage table includes the current synchronization business data in the business table that is overwritten by the next synchronization business data; the current synchronization business data is the business data that has been changed based on the transaction request initiated between the current synchronization start time node and the previous synchronization start time node.

[0009] In response to the current time being the synchronization wait termination time node, the current state is updated from synchronization wait state to synchronization state, and the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table are obtained; the synchronization wait termination time node is the time node after the synchronization start time node with the interval of waiting time; the current synchronization business data is the business data that has been changed based on the transaction request initiated between the current synchronization start time node and the previous synchronization start time node.

[0010] The current synchronization business data in the data temporary storage table and the current synchronization business data in the business table are sent to the back-end system server to be synchronized in order to complete the synchronization operation of the current synchronization business data.

[0011] Update the current state from "synchronization" to "synchronization complete".

[0012] Optionally, updating the business table based on the received transaction request, or updating the business table and the data temporary storage table, includes:

[0013] If the transaction request is determined to have been initiated before the start time of this synchronization, the business table is updated based on the transaction request. If the transaction request is determined to have been initiated after the start time of this synchronization, it is determined whether the data to be updated in the transaction request is the business data to be synchronized in the corresponding record of the business table. If it is determined to be the business data to be synchronized, the record corresponding to the transaction request in the business table is stored in the data temporary storage table, and the business data to be synchronized in the corresponding record of the business table is updated to the data to be updated in the transaction request. The data structure of the business table and the data temporary storage table is the same.

[0014] Optionally, the business table and the data temporary storage table further include a request time field. Updating the business table based on the received transaction request includes: updating the current synchronization business data in the corresponding record of the business table to the data to be updated in the transaction request, and updating the request time field in the corresponding record of the business table based on the timestamp in the transaction request. Determining whether the data to be updated in the transaction request is the current synchronization business data in the corresponding record of the business table includes: determining whether the value of the request time field in the corresponding record is the time between the current synchronization start time node and the previous synchronization start time node; if it is the time between the current synchronization start time node and the previous synchronization start time node, then it is determined that the data in the corresponding record of the business table is the current synchronization business data.

[0015] Optionally, the response before updating the current state from a synchronization waiting state to a synchronization state when the current time is the synchronization waiting termination time node includes:

[0016] A longer response time interval is predetermined between the initiation time of the transaction request and the update time of the business table based on the transaction request; a backward waiting time is determined based on the longer response time interval, the backward waiting time being used to wait for the transaction requests initiated before the current synchronization start time node to complete the update of the business table after the current synchronization start time node.

[0017] Optionally, the predetermined longer response time interval from initiating a transaction request to updating the business table based on the transaction request includes:

[0018] Determine the response time interval between the initiation time and the update time of a preset number of transaction requests; determine the longest response time interval among the response time intervals corresponding to the preset number of transaction requests as the longer response time interval.

[0019] Optionally, sending the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table to the back-end system server to be synchronized includes:

[0020] Determine whether the business data in the current synchronization table includes business data with the same primary key as the business data in the current synchronization table; send the business data in the current synchronization table (after deleting the data) and the business data in the current synchronization table to the back-end system server to be synchronized.

[0021] Optionally, the response after the current time is the synchronization wait termination time node, and after updating the current state from the synchronization state to the synchronization completion state, further includes: if it is determined that a transaction request initiated before the current synchronization start time node has been received, then the transaction request is rejected.

[0022] Optionally, after updating the current state from a synchronization state to a synchronization completed state, the method further includes: clearing the records in the data temporary storage table.

[0023] Secondly, this application provides a data synchronization device, comprising:

[0024] The status update module is used to update the current status from synchronization completed to synchronization waiting status in response to the current time being the start time node of this synchronization.

[0025] The data update module is used to update the business table based on the received transaction request, or to update the business table and the data temporary storage table. The business table includes the next synchronization business data, and the data temporary storage table includes the current synchronization business data in the business table that is overwritten by the next synchronization business data. The current synchronization business data is the business data that has been changed based on the transaction request initiated between the current synchronization start time node and the previous synchronization start time node.

[0026] The status update module is also used to update the current status from the synchronization waiting state to the synchronization state in response to the current time being the synchronization waiting termination time node;

[0027] The synchronization module is used to obtain the current synchronization business data from the data temporary storage table and the current synchronization business data from the business table; the synchronization waiting termination time node is the time node after the synchronization start time node with the interval of waiting time; the current synchronization business data is the business data that has been changed based on the transaction request initiated between the current synchronization start time node and the previous synchronization start time node; the current synchronization business data from the data temporary storage table and the current synchronization business data from the business table are sent to the back-end system server to be synchronized to complete the synchronization operation of the current synchronization business data;

[0028] The status update module is also used to update the current status from "synchronization" to "synchronization complete".

[0029] Thirdly, this application provides an electronic device, including: a processor, and a memory and a transceiver communicatively connected to the processor;

[0030] The memory stores computer-executed instructions; the transceiver is used for sending and receiving data.

[0031] The processor executes computer execution instructions stored in the memory to implement the data synchronization method described in any of the above aspects.

[0032] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the data synchronization method described in any of the preceding aspects.

[0033] Fifthly, this application provides a computer program product including computer execution instructions that, when executed by a processor, implement the data synchronization method described in any of the preceding aspects.

[0034] The data synchronization method, apparatus, device, and storage medium provided in this application, in response to the current time being the start time node of the current synchronization, update the current state from the synchronization completed state to the synchronization waiting state; update the business table based on the received transaction request, or update the business table and the data temporary storage table; the data temporary storage table includes the current synchronization business data in the business table that is overwritten by the next synchronization business data; in response to the current time being the end time node of the synchronization waiting, update the current state from the synchronization waiting state to the synchronization state, and obtain the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table; send the current synchronization business data to the back-end system server to be synchronized to complete the synchronization operation of the current synchronization business data; update the current state from the synchronization state to the synchronization completed state. When transmitting data to the back-end system, the cross-sectional data of the current synchronization is obtained from the data temporary storage table, avoiding the loss of cross-sectional data, and realizing the transmission of complete current synchronization data to the back-end system without interrupting the transaction; after the synchronization start time node, after a time interval of the waiting period, data synchronization is performed again, allowing transaction time for network latency and distributed transaction processing, and ensuring transaction consistency. Attached Figure Description

[0035] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0036] Figure 1 A flowchart of a data synchronization method provided in an embodiment of this application;

[0037] Figure 2 A schematic diagram of the system status provided in the embodiments of this application;

[0038] Figure 3 A flowchart of another data synchronization method provided in the embodiments of this application;

[0039] Figure 4 This is a schematic diagram of the structure of the data synchronization device provided in the embodiments of this application;

[0040] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0041] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0042] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0043] The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. In the following descriptions of embodiments, "a plurality of" means two or more, unless otherwise explicitly defined.

[0044] First, the prior art involved in this invention will be described and analyzed in detail.

[0045] Although the core system was required to provide uninterrupted 24 / 7 customer service, the real-time updates of data and the uncertain timing of completing daily transactions and updating data due to network latency and long database transactions make it difficult to obtain static cross-sectional data for the day. Currently, to transmit complete data for an accounting day to the back-end system, online transactions are typically suspended for a short period at the end of the day, and then resumed after the day is cut off. During this period, any incomplete online transactions are forcibly interrupted, and no new transaction requests are accepted, resulting in the bank not actually providing uninterrupted customer service.

[0046] The inventors discovered during their research that, because the data in the system's database is constantly changing, upon receiving the first update request for a record on the next day, it can be determined that the data recorded in that record at that moment is the cross-sectional data for that day. Storing this cross-sectional data in a data temporary storage table can prevent data loss. When transmitting data to the back-end system, the cross-sectional data for the current day is retrieved from the data temporary storage table, thus enabling the transmission of complete data for an accounting day to the back-end system. Furthermore, to ensure transaction consistency and allow time for network latency and distributed transaction processing, a backward waiting period can be set based on the maximum time consumption of distributed transaction processing. Data synchronization will then proceed after the synchronization start time node, following this backward waiting period. Therefore, this application provides a data synchronization method, which, in response to the current time being the start time node of this synchronization, updates the current state from the synchronization completed state to the synchronization waiting state; updates the business table based on the received transaction request, or updates the business table and the data temporary storage table; the data temporary storage table includes the business data of this synchronization that will be overwritten by the next synchronized business data in the business table; in response to the current time being the end time node of the synchronization wait, updates the current state from the synchronization waiting state to the synchronization state, and obtains the business data of this synchronization in the data temporary storage table and the business data of this synchronization in the business table; the end time node of the synchronization wait is the time node after the synchronization start time node and the interval of the subsequent waiting time; sends the business data of this synchronization in the data temporary storage table and the business data of this synchronization in the business table to the back-end system server to be synchronized, so as to complete the synchronization operation of the business data of this synchronization; and updates the current state from the synchronization state to the synchronization completed state.

[0047] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0048] It should be noted that the data synchronization method, apparatus, device, and storage medium of this application can be used in the financial field, or in any field other than finance. The application fields of the data synchronization method, apparatus, device, and storage medium of this application are not limited.

[0049] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0050] Figure 1 This is a flowchart illustrating a data synchronization method provided in an embodiment of this application. This embodiment addresses the problem that real-time data updates make it difficult to obtain static cross-sectional data, leading to the forced interruption of incomplete online transactions when data is transmitted to the back-end system. The method in this embodiment is applied to a data synchronization device, which can be located in an electronic device. This electronic device can be a digital computer of various forms, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.

[0051] like Figure 1 As shown, the specific steps of this method are as follows:

[0052] Step S101: In response to the current time being the start time node of this synchronization, update the current state from synchronization completed to synchronization waiting state.

[0053] This application does not limit the method of initiating synchronization. For example, the start time of this synchronization can be set manually or determined based on the set synchronization period.

[0054] Step S102: Update the business table based on the received transaction request, or update the business table and the data temporary storage table.

[0055] The business table includes the next synchronization business data, and the data temporary storage table includes the current synchronization business data that is overwritten by the next synchronization business data in the business table; the current synchronization business data is the business data that has been changed based on the transaction requests initiated between the current synchronization start time node and the previous synchronization start time node.

[0056] Step S103: In response to the current time being the synchronization waiting termination time node, update the current state from synchronization waiting state to synchronization state, and obtain the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table.

[0057] Among them, the synchronization wait termination time node is the time node after the synchronization start time node, which is the time interval for waiting backward; the business data of this synchronization is the business data that has been changed based on the transaction request initiated between the current synchronization start time node and the previous synchronization start time node.

[0058] Step S104: Send the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table to the back-end system server to be synchronized, so as to complete the synchronization operation of the current synchronization business data.

[0059] Step S105: Update the current state from "synchronization state" to "synchronization completed state".

[0060] In this embodiment of the application, the current state can be a synchronization waiting state, a synchronization state, or a synchronization completed state.

[0061] In this embodiment of the application, a business data temporary storage table with the same data structure as the business table can be pre-configured to store the current synchronized business data that will be overwritten by the next synchronized business data.

[0062] Specifically, once the current time is determined as the synchronization start time node, the current state is updated to the synchronization waiting state. At this time, transaction requests sent before the synchronization start time node can still be received, as can transaction requests sent after the synchronization start time node. If a transaction request sent before the synchronization start time node is received, the business table can be updated based on the transaction request sent before the synchronization start time node. If a transaction request sent after the synchronization start time node is received, and updating the business table based on the transaction request sent after the synchronization start time node would overwrite the current synchronization business data, then the overwritten current synchronization business data will first be stored in the data temporary storage table, and then the business table will be updated based on the transaction request sent after the synchronization start time node.

[0063] Once the current time is determined as the synchronization wait termination time node, the current status is updated to the synchronization wait state, and the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table are sent to the back-end system server to be synchronized. It should be understood that the business table also includes the next synchronization business data; the next synchronization business data is the business data that will be changed by the transaction request initiated between the current synchronization start time node and the next synchronization start time node.

[0064] After confirming that the business data to be synchronized will be sent to the back-end system server to be synchronized, the current status will be updated to the synchronization completed status.

[0065] Optionally, the start time of the next synchronization can be determined according to a preset synchronization cycle. For example, the synchronization cycle can be set to one day, and the synchronization start time can be set to 10 PM. In this case, 10 PM today is the start time for this synchronization, and the start time for the next synchronization is 10 PM the following day. Alternatively, the waiting period can be set to 5 minutes. Then, at 10:05 PM, the current time is determined as the synchronization waiting end time, and the current state is updated from "synchronization waiting" to "synchronization".

[0066] Optionally, in this embodiment of the application, in response to the current time being after the synchronization waiting termination time node and after updating the current state from the synchronization state to the synchronization completion state, the method further includes: if it is determined that a transaction request initiated before the current synchronization start time node has been received, then the transaction request is rejected.

[0067] In this embodiment, when the current time is determined to be the synchronization waiting termination time node and the current state is the synchronization waiting state, the synchronization of the current synchronization business data has already begun. The business data corresponding to the transaction requests initiated before the synchronization start time node is the synchronization business data for this time. If the transaction requests initiated before the synchronization start time node are not rejected, the synchronization of the current synchronization business data may be missed. When the current state is determined to be the synchronization completion state, the synchronization of the current synchronization business data has been completed, and the synchronization of the current synchronization business data will not be synchronized. Therefore, in response to the current time being after the synchronization waiting termination time node and after the current state is updated from the synchronization state to the synchronization completion state, if it is determined that a transaction request initiated before the synchronization start time node has been received, the transaction request is rejected, which can ensure the integrity of the synchronized current synchronization business data.

[0068] Optionally, after updating the current state from synchronization to synchronization complete, before the start time of the next synchronization, the records in the data temporary storage table can be cleared to delete the current synchronization business data in the data temporary storage table, reduce the amount of data in the data temporary storage table, and make the data temporary storage table only store the current synchronization business data of each synchronization.

[0069] Figure 2 This is a schematic diagram of the system state provided in the embodiments of this application, such as... Figure 2 As shown, 22:00 is the starting time node for this synchronization. At 22:00 on day T, the current status will be updated from the synchronization completed state to the synchronization waiting state. At this time, if a transaction request sent on day T is received, the business table will be updated; if a transaction request sent on day T+1 is received and it is the first update of the corresponding record in the business table on day T+1, the data before the change will be copied to the data temporary storage table and then the business table will be updated; if a transaction request sent on day T+1 is received and it is a non-second update of the corresponding record in the business table on day T+1, the business table will be updated; if a transaction request sent on day T that updates the same record is received after a transaction request sent on day T+1 is received, the transaction request will be rejected. After 10 PM on day T, wait for an interval of m, then update the current state from "synchronization waiting" to "synchronization". At this time, reject transaction requests sent on day T. Process transaction requests sent on day T+1 in the same way as in the "synchronization waiting" state, and retrieve and send the non-duplicate synchronization business data from the data temporary storage table and the business table to complete the synchronization operation. After synchronization is complete, update the current state from "synchronization" to "synchronization completed". At this time, reject transaction requests sent on day T. If a transaction request sent on day T+1 is received, update the business table. During this stage, the operation of clearing records in the data temporary storage table can be performed.

[0070] The data synchronization method provided in this application embodiment, in response to the current time being the start time node of the current synchronization, updates the current state from the synchronization completed state to the synchronization waiting state; updates the business table based on the received transaction request, or updates the business table and the data temporary storage table; the data temporary storage table includes the current synchronization business data in the business table that will be overwritten by the next synchronization business data; in response to the current time being the end time node of the synchronization waiting, updates the current state from the synchronization waiting state to the synchronization state, and obtains the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table; sends the current synchronization business data to the back-end system server to be synchronized to complete the synchronization operation of the current synchronization business data; and updates the current state from the synchronization state to the synchronization completed state. When transmitting data to the back-end system, the cross-sectional data of the current synchronization is obtained from the data temporary storage table, avoiding the loss of cross-sectional data and realizing the transmission of complete current synchronization data to the back-end system without interrupting the transaction; after the synchronization start time node, data synchronization is performed after a time interval of the waiting period, allowing transaction time for network latency and distributed transaction processing, and ensuring transaction consistency.

[0071] Based on the above embodiments, Figure 3 This is a flowchart of another data synchronization method provided in an embodiment of this application. Step S102 updates the business table based on the received transaction request, or updates the business table and the data temporary storage table, such as... Figure 3 As shown, it also includes:

[0072] Step S201: Determine whether the transaction request was initiated before the start time of this synchronization.

[0073] Specifically, if it is determined that the transaction request was initiated before the start time of this synchronization, then the data corresponding to the transaction request is determined to be the business data for this synchronization, and the corresponding record in the business table is not cross-sectional data. Step S202 can be executed to update the business table based on the transaction request. If it is determined that the transaction request was initiated after the start time of this synchronization, then the corresponding record in the business table may be cross-sectional data. Step S203 is executed to determine whether the corresponding record in the business table is cross-sectional data.

[0074] In this embodiment, the cross-sectional data is the business data of the last updated business table based on the transaction request before the current synchronization start time node.

[0075] Step S202: If it is determined that the transaction request was initiated before the start time of this synchronization, then update the business table based on the transaction request.

[0076] Step S203: If it is determined that the transaction request was initiated after the start time of this synchronization, then determine whether the data to be updated in the transaction request is the business data to be synchronized in the corresponding record of the business table.

[0077] Specifically, if it is determined that the record in the business table corresponds to the business data for the current synchronization, while the transaction request corresponds to the business data for the next synchronization, then the business data for the current synchronization in the corresponding record of the business table can be determined to be cross-sectional data, and step S204 is executed to store the record corresponding to the transaction request in the business table into the data temporary storage table; if it is determined that the record in the business table does not correspond to the business data for the current synchronization, but to be the business data for the next synchronization, then it is determined that the cross-sectional data of the corresponding record of the business table has been stored in the data temporary storage table or there is no corresponding record for the business data for the current synchronization, and step S205 is executed to update the business table based on the transaction request.

[0078] Step S204: If it is determined to be the business data to be synchronized this time, the record corresponding to the transaction request in the business table is stored in the data temporary storage table, and the business data to be synchronized in the corresponding record in the business table is updated to the data to be updated in the transaction request.

[0079] In this embodiment, the business table and the data temporary storage table have the same data structure.

[0080] Step S205: If it is determined that the data is not for this synchronization, then update the business table based on the transaction request.

[0081] The data synchronization method provided in this application, if determined that the transaction request was initiated before the current synchronization start time, updates the business table based on the transaction request; if determined that the transaction request was initiated after the current synchronization start time, it determines whether the data to be updated in the transaction request is the current synchronization business data in the corresponding record of the business table; if it is determined to be the current synchronization business data, the record corresponding to the transaction request in the business table is stored in a data temporary storage table, and the current synchronization business data in the corresponding record of the business table is updated with the data to be updated in the transaction request; the data structures of the business table and the data temporary storage table are the same. It can determine whether the business data is in the corresponding record of the business table based on the initiation time of the transaction request and the type of business data in the corresponding record of the business table, thereby enabling the storage of cross-sectional data in the data temporary storage table, avoiding cross-sectional data loss, and thus enabling the complete data of the current synchronization to be transmitted to the back-end system without interrupting the transaction.

[0082] Optionally, the business table and the data temporary storage table may also include a request time field. In this case, when updating the business table in steps S202, S203, S204 and S205, the business data to be synchronized in the corresponding record of the business table may be updated to the data to be updated in the transaction request, and the request time field in the corresponding record of the business table may be updated based on the timestamp in the transaction request.

[0083] Specifically, the business data in the transaction request can be updated in the business table, and the sending time of the transaction request can be recorded in the request time field of the corresponding record.

[0084] Based on this, step S203 determines whether the data to be updated in the transaction request is the data for this synchronization in the corresponding record of the business table, which may include:

[0085] Step S2031: Determine whether the value of the request time field in the corresponding record is the time between the start time of this synchronization and the start time of the last synchronization.

[0086] Step S2032: If the time is between the start time of this synchronization and the start time of the last synchronization, then determine that the corresponding record in the business table contains the business data for this synchronization.

[0087] Step S2033: If the time is after the start time of this synchronization, then determine that the corresponding record in the business table contains the business data for the next synchronization.

[0088] In this embodiment of the application, a record in the business table and the data temporary storage table may include business data and a request time field that records the time when the transaction request corresponding to the business data was sent.

[0089] Specifically, the received transaction request may include a timestamp. After receiving the transaction request, the timestamp can be parsed to obtain the sending time of the transaction request. If it is determined that the transaction request was sent after the start time node of this synchronization, then step S2031 is executed to determine whether the value of the request time field in the corresponding record is the time between the start time node of this synchronization and the start time node of the last synchronization. If it is the time between the start time node of this synchronization and the start time node of the last synchronization, then step S2032 is executed to determine that the corresponding record in the business table contains the business data for this synchronization. If it is the time after the start time node of this synchronization, then step S2033 is executed to determine that the corresponding record in the business table contains the business data for the next synchronization.

[0090] The data synchronization method provided in this application embodiment sets a request time field in the business table and the data temporary storage table. Based on the request time field, it can determine whether the data to be updated is the business data to be synchronized in the corresponding record of the business table. This enables the cross-sectional data to be stored in the data temporary storage table, avoiding cross-sectional data loss. This allows the complete data of the current synchronization to be downloaded to the back-end system without interrupting the transaction.

[0091] Optionally, when sending the current synchronization business data from the data temporary storage table and the current synchronization business data from the business table to the back-end system server to be synchronized, the current synchronization business data can be filtered, specifically including:

[0092] Determine whether the business data in the current synchronization table includes business data with the same primary key as the business data in the current synchronization table; send the business data in the current synchronization table (after deleting the data) and the business data in the current synchronization table to the back-end system server to be synchronized.

[0093] In this embodiment of the application, the primary key is used to identify a unique record. When the record corresponding to the transaction request in the business table is stored in the data temporary storage table in step S204, the corresponding primary key is also stored in the data temporary storage table. When the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table are sent to the back-end system server to be synchronized, duplicate current synchronization business data can be deleted based on the primary key, which can avoid the repeated transmission of current synchronization business data.

[0094] In this embodiment of the application, the delay period can be set by a person, or the delay period can be predetermined based on the response time to the transaction request. Specifically, it can include:

[0095] Step S301: Predetermine the longer response time interval between the initiation time of the transaction request and the update time of the business table based on the transaction request.

[0096] Optionally, a preset number of transaction requests can be identified, with the response time interval between their initiation time and update time determined; the longest response time interval among the response time intervals corresponding to the preset number of transaction requests is identified as the longer response time interval.

[0097] For example, a preset number of response time intervals corresponding to transaction requests can be obtained, and the preset number of response time intervals can be sorted in descending order, with the response time interval ranked first being determined as the longer response time interval.

[0098] The data synchronization method provided in this application determines a preset number of transaction requests, which can determine the number of response time intervals used as samples, improving the accuracy of determining the backward waiting time based on a longer response time interval. Furthermore, by determining the longest response time interval among the response time intervals corresponding to the preset number of transaction requests as the longer response time interval, the interval between the synchronization waiting state and the synchronization state can be increased, reducing rejected transaction requests and avoiding long waiting times, thus minimizing the impact on synchronization efficiency.

[0099] Optionally, the longest response time interval among the response time intervals corresponding to transaction requests within a preset time period can be determined as the longer response time interval.

[0100] Step S302: Determine the backward waiting time based on the longer response time interval.

[0101] The backward wait time is used to wait for the update of transaction requests initiated before the current synchronization start time to be completed in the business table after the current synchronization start time.

[0102] In this embodiment, the backward waiting time is determined based on the response time to the transaction request, which improves the accuracy of determining the backward waiting time based on a longer response time interval, increases the interval between the synchronous waiting state and the synchronous state, reduces rejected transaction requests, avoids long waiting times, and reduces the impact on synchronization efficiency.

[0103] Figure 4 This is a schematic diagram of the data synchronization device provided in an embodiment of this application. The data synchronization device provided in this embodiment can execute the processing flow provided in the data synchronization method embodiment. Figure 4 As shown, the data synchronization device 40 includes: a status update module 401, a data update module 402, and a synchronization module 403.

[0104] Specifically, the status update module 401 is used to update the current status from the synchronization completed state to the synchronization waiting state in response to the current time being the start time node of this synchronization.

[0105] The data update module 402 is used to update the business table based on the received transaction request, or to update the business table and the data temporary storage table. The business table includes the next synchronization business data, and the data temporary storage table includes the current synchronization business data in the business table that is overwritten by the next synchronization business data. The current synchronization business data is the business data that has been changed based on the transaction request initiated between the current synchronization start time node and the previous synchronization start time node.

[0106] The state update module 401 is also used to update the current state from the synchronous waiting state to the synchronous state in response to the current time being the synchronous waiting termination time node;

[0107] Synchronization module 403 is used to obtain the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table; the synchronization wait termination time node is the time node after the synchronization start time node with the interval of waiting time; the current synchronization business data is the business data that has been changed based on the transaction request initiated between the current synchronization start time node and the previous synchronization start time node; and sends the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table to the back-end system server to be synchronized to complete the synchronization operation of the current synchronization business data.

[0108] The status update module 401 is also used to update the current status from a synchronization status to a synchronization completed status.

[0109] The apparatus provided in this application embodiment can be specifically used to execute the method embodiment provided in the above embodiment, and the specific functions will not be repeated here.

[0110] Optionally, the data update module 402 is specifically used for: if it is determined that the transaction request was initiated before the start time node of this synchronization, then updating the business table based on the transaction request; if it is determined that the transaction request was initiated after the start time node of this synchronization, then determining whether the data to be updated in the transaction request is the business data to be synchronized in the corresponding record of the business table; if it is determined to be the business data to be synchronized, then storing the record corresponding to the transaction request in the business table into the data temporary storage table, and updating the business data to be updated in the corresponding record of the business table to the data to be updated in the transaction request; the data structure of the business table and the data temporary storage table is the same.

[0111] Optionally, the business table and the data temporary storage table also include a request time field. When the data update module 402 updates the business table based on the received transaction request, it is specifically used to: update the current synchronization business data in the corresponding record of the business table to the data to be updated in the transaction request, and update the request time field in the corresponding record of the business table based on the timestamp in the transaction request; when the data update module 402 determines whether the data to be updated in the transaction request is the current synchronization business data in the corresponding record of the business table, it is specifically used to: determine whether the value of the request time field in the corresponding record is the time between the current synchronization start time node and the previous synchronization start time node; if it is the time between the current synchronization start time node and the previous synchronization start time node, then it is determined that the corresponding record of the business table is the current synchronization business data.

[0112] Optionally, the data synchronization device 40 further includes: a waiting duration determination module; the waiting duration determination module is used to: pre-determine a longer response time interval from the initiation time of the transaction request to the update time of the business table based on the transaction request; determine a backward waiting duration based on the longer response time interval, the backward waiting duration being used to wait for the transaction request initiated before the current synchronization start time node to complete the update of the business table after the current synchronization start time node.

[0113] Optionally, the waiting time determination module is specifically used to: determine the response time interval between the initiation time and the update time of a preset number of transaction requests; and determine the longest response time interval among the response time intervals corresponding to the preset number of transaction requests as the longer response time interval.

[0114] Optionally, the data update module 402 is specifically used to: determine whether the business data in the business table for this synchronization includes business data with the same primary key as the business data in the data temporary storage table for this synchronization; and send the business data in the business table for this synchronization after data deletion and the business data in the data temporary storage table for this synchronization to the back-end system server to be synchronized.

[0115] Optionally, the data synchronization device 40 further includes a request rejection module; the request rejection module is used to reject the transaction request if it is determined that a transaction request initiated before the current synchronization start time node has been received.

[0116] Optionally, the data synchronization device 40 further includes a deletion module; the deletion module is used to clear the records in the data temporary storage table.

[0117] The apparatus provided in this application embodiment can be specifically used to execute the above method embodiments, and its specific functions will not be described in detail here.

[0118] Figure 5 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 5 As shown, this application also provides an electronic device 50, including: a processor 501, and a memory 502 and a transceiver 503 communicatively connected to the processor 501. The memory 502 stores computer-executable instructions; the transceiver 503 is used for sending and receiving data; the processor 501 executes the computer-executable instructions stored in the memory 502 to implement the method provided in any embodiment of this application.

[0119] Specifically, the program may include program code, which includes computer-executable instructions. Memory 502 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device. The computer-executable instructions are stored in memory 502 and configured to be executed by processor 501 to implement the method provided in any embodiment of this application. Related descriptions can be understood by referring to the relevant descriptions and effects corresponding to the steps in the accompanying drawings, and will not be elaborated upon here.

[0120] In this embodiment, the memory 502 and the processor 501 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0121] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method provided in any embodiment of this application.

[0122] This application also provides a computer program product, including computer execution instructions, which, when executed by a processor, implement the method provided in any embodiment of this application.

[0123] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0124] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0125] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or in a combination of hardware and software functional modules.

[0126] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to the processor or controller of a general-purpose computer, special-purpose computer, or other programmable full-path fusion device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0127] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0128] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.

[0129] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0130] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method of data synchronization, the method comprising: The method comprises: updating the current state from the synchronization completion state to the synchronization waiting state in response to the current time being the current synchronization start time node; updating the business table based on the received transaction request, or updating the business table and the data temporary storage table; the business table comprises next synchronization business data, and the data temporary storage table comprises current synchronization business data in the business table which is covered by the next synchronization business data; the current synchronization business data is business data which is changed based on a transaction request initiated between the current synchronization start time node and the last synchronization start time node; updating the current state from the synchronization waiting state to the synchronization state in response to the current time being the synchronization waiting termination time node, and obtaining the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table; the synchronization waiting termination time node is a time node after the synchronization start time node and an interval of a backward waiting time length; the current synchronization business data is business data which is changed based on a transaction request initiated between the current synchronization start time node and the last synchronization start time node; sending the current synchronization business data in the data temporary storage table and the current synchronization business data in the business table to the offline system server to be synchronized, so as to complete the synchronization operation of the current synchronization business data; updating the current state from the synchronization state to the synchronization completion state.

2. The method of claim 1, wherein, The method comprises: updating the business table based on the transaction request if it is determined that the transaction request is initiated before the current synchronization start time node; determining whether the to-be-updated data of the transaction request in the corresponding record of the business table is the current synchronization business data if it is determined that the transaction request is initiated after the current synchronization start time node; storing the corresponding record of the business table in the data temporary storage table, and updating the current synchronization business data in the corresponding record of the business table to the to-be-updated data of the transaction request if it is determined that the to-be-updated data is the current synchronization business data; the data structure of the business table and the data temporary storage table is the same.

3. The method of claim 2, wherein, The business table and the data temporary storage table further comprise a request time field, and the method comprises: updating the current synchronization business data in the corresponding record of the business table to the to-be-updated data in the transaction request, and updating the request time field in the corresponding record of the business table based on the timestamp in the transaction request; The method comprises: determining whether the value of the request time field in the corresponding record is a time between the current synchronization start time node and the last synchronization start time node; determining that the corresponding record of the business table is the current synchronization business data if the value of the request time field is the time between the current synchronization start time node and the last synchronization start time node.

4. The method of claim 1, wherein, The method comprises: determining a longer response time interval from the initiation time of the transaction request to the update time of the business table based on the transaction request; The backward waiting duration is determined based on a longer response time interval, and the backward waiting duration is used to wait for update completion of a transaction request initiated before the current synchronization start time node in a service table after the current synchronization start time node.

5. The method of claim 4, wherein, The longer response time interval includes: Determining a preset number of response time intervals from the initiation time to the update time of the transaction request; Determining the longest response time interval in the preset number of response time intervals of the transaction request as the longer response time interval.

6. The method of claim 1, wherein, The current synchronization service data in the data temporary storage table and the current synchronization service data in the service table are sent to the offline system server to be synchronized, including: Determining whether the current synchronization service data in the service table includes service data with the same primary key as the current synchronization service data in the data temporary storage table; The current synchronization service data in the service table after the deletion data and the current synchronization service data in the data temporary storage table are sent to the offline system server to be synchronized.

7. The method according to any one of claims 1 to 6, characterized in that, After the current state is updated from the synchronization state to the synchronization completion state, the method further includes: If it is determined that the transaction request initiated before the current synchronization start time node is received, the transaction request is rejected.

8. The method according to any one of claims 1 to 6, characterized in that, After the current state is updated from the synchronization state to the synchronization completion state, the method further includes: Clearing the records in the data temporary storage table.

9. A data synchronization apparatus, characterized by comprising: The method includes: A state updating module is configured to update the current state from the synchronization completion state to the synchronization waiting state in response to the current time being the current synchronization start time node; A data updating module is configured to update the service table based on the received transaction request, or update the service table and the data temporary storage table; the service table includes next synchronization service data, and the data temporary storage table includes the current synchronization service data in the service table that is covered by the next synchronization service data; the current synchronization service data is service data that is changed based on the transaction request initiated between the current synchronization start time node and the last synchronization start time node; The state updating module is further configured to update the current state from the synchronization waiting state to the synchronization state in response to the current time being the synchronization waiting termination time node; A synchronization module is configured to obtain the current synchronization service data in the data temporary storage table and the current synchronization service data in the service table; the synchronization waiting termination time node is a time node that is a backward waiting duration after the synchronization start time node; the current synchronization service data is service data that is changed based on the transaction request initiated between the current synchronization start time node and the last synchronization start time node; the current synchronization service data in the data temporary storage table and the current synchronization service data in the service table are sent to the offline system server to be synchronized, so as to complete the synchronization operation of the current synchronization service data; The state updating module is further configured to update the current state from the synchronization state to the synchronization completion state.

10. An electronic device, comprising: The method includes: A processor, a memory and a transceiver connected in communication with the processor; The memory stores computer execution instructions; and the transceiver is configured to receive and send data. The processor executes computer-executable instructions stored in the memory to implement the method of any of claims 1-8.

11. A computer readable storage medium characterized by: The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, implement the method of any of claims 1-8.

Citation Information

Patent Citations

  • Data synchronization method and device

    CN106484560A

  • Data processing method and device, electronic equipment and storage medium

    CN113947490A