Service flow synchronization method and device, computer equipment, storage medium and computer program product
By obtaining and verifying business flow data, the data integrity in the target database is ensured, and the data packet loss, tampering and performance impact problems of traditional synchronization methods are solved, and efficient and accurate real-time business flow synchronization is achieved.
Patent Information
- Application Number
- CN202411151076.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-03
AI Technical Summary
The traditional business flow synchronization method has problems such as packet loss, tampering, poor real-time and performance impacts, and cannot ensure the integrity and real-timeness of flow information.
By obtaining the service flow type of data to be synchronized, using the HTTP protocol to call the data interface of the service module to obtain and verify the data, ensuring the integrity of the data in the target database, and repairing it when incomplete, improving the accuracy of data synchronization and Real-time.
It realizes the accuracy and real-time nature of data synchronization, avoids data omissions, reduces the impact on system performance, and meets the time requirements of downstream systems.
Smart Images

Figure CN119066126A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a business flow synchronization method, device, computer equipment, storage medium and computer program product. Background Art
[0002] Business systems usually involve multiple business modules. For example, if the business system is a provident fund system, it generally includes a collection module, a loan module, a capital module, etc. Different business modules may be deployed on different servers and have different forms of business flow. With the development of big data technology, it is possible to synchronously transmit the business flow of different business modules in the business system to the accounting module for accounting.
[0003] Traditional business flow synchronization mainly includes synchronization based on data file transmission and synchronization based on direct database connection. Among them, the data file transmission method is based on the agreed file encoding, size and format, and the business module generates data files, and then the file transfer server such as FTP (File Transfer Protocol) server transfers the generated data files to the accounting module. The method based on direct database connection synchronization is to directly connect to the business library through a defined standard interface API (Application Programming Interface) and a dynamic link library-based method, such as using ODBC (Open Database Connectivity) / JDBC (Java Database Connectivity) to synchronize data.
[0004] However, although both existing methods can achieve synchronization of business flow, they both have some problems. For example, the method based on data file transmission may cause packet loss or malicious tampering of data content, and the real-time performance is poor, and the business flow information cannot be transmitted in real time and the integrity of the flow information cannot be ensured. The method based on direct database connection synchronization will have a greater impact on the performance of the business module system. When performing large-scale business flow synchronization, it will reduce the performance of the business module and affect the normal online service. As the scale of business increases, the time spent on data synchronization will also become longer and longer, which will not meet the time requirements of the downstream system and cannot ensure the integrity of the flow information. Therefore, traditional business flow synchronization methods have certain limitations in practical applications. Summary of the invention
[0005] Based on this, it is necessary to provide a business flow synchronization method, device, computer equipment, storage medium and computer program product that can ensure data integrity in response to the above technical problems.
[0006] In a first aspect, the present application provides a service flow synchronization method, comprising:
[0007] When the synchronization condition is met, obtaining a first business flow type of the data to be synchronized;
[0008] Determine a service module corresponding to the first service flow type, and obtain corresponding first service flow data through a first data interface of the service module;
[0009] storing the first business flow data in a target database;
[0010] If the verification conditions are met, verify the integrity of the data in the target database;
[0011] When it is determined that the integrity check fails, the data in the target database is repaired.
[0012] In one embodiment, the acquiring corresponding first business flow data through the first data interface of the business module includes:
[0013] Determine a first time range of the data to be synchronized corresponding to the synchronization condition;
[0014] The first data interface is called based on a hypertext transfer protocol request to obtain first business flow data corresponding to the first time range from a corresponding business module.
[0015] In one embodiment, verifying the integrity of the data in the target database includes:
[0016] Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition;
[0017] Based on a hypertext transfer protocol request, calling a second data interface of a service module matching the second service flow type to obtain first flow statistics data corresponding to the second time range;
[0018] According to the second time range and the second business flow type, obtaining corresponding second flow statistics data in the target database;
[0019] If the second transaction statistics data match the first transaction statistics data, it is determined that the integrity check of the data in the target database passes.
[0020] In one embodiment, the method further comprises:
[0021] If the second transaction statistics data do not match the first transaction statistics data, it is determined that the integrity check of the data in the target database fails.
[0022] In one embodiment, repairing the data in the target database includes:
[0023] Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition;
[0024] For each of the second business flow types, obtaining first business statistical data within the second time range from a corresponding business module;
[0025] and acquiring corresponding second business statistical data from the target database;
[0026] If the second business statistical data does not match the first business statistical data, based on the corresponding second business flow type, obtaining second business flow data corresponding to the second time range from the business module;
[0027] Based on the second business flow data, the target database is updated.
[0028] In one embodiment, the method further comprises:
[0029] When it is detected that a preset timed synchronization task is triggered, it is determined that the synchronization condition is met; or,
[0030] When an immediate synchronization task request is received, it is determined that the synchronization condition is met.
[0031] In one embodiment, the obtaining of the first service flow type of the data to be synchronized includes:
[0032] Querying the business flow configuration table of the target database to obtain the business flow type pre-configured in the business flow configuration table;
[0033] The service flow type is determined as the first service flow type of the data to be synchronized.
[0034] In a second aspect, the present application provides a service flow synchronization device, the device comprising:
[0035] A type acquisition module, used to acquire the first business flow type of the data to be synchronized when the synchronization condition is met;
[0036] A data acquisition module, used to determine a business module corresponding to the first business flow type, and acquire corresponding first business flow data through a first data interface of the business module;
[0037] A data storage module, used for storing the first business flow data in a target database;
[0038] A data verification module, used to verify the integrity of the data in the target database when the verification conditions are met;
[0039] The data modification module is used to repair the data in the target database when it is determined that the integrity check fails.
[0040] In one embodiment, the data acquisition module is used to:
[0041] Determine a first time range of the data to be synchronized corresponding to the synchronization condition;
[0042] The first data interface is called based on a hypertext transfer protocol request to obtain first business flow data corresponding to the first time range from a corresponding business module.
[0043] In one embodiment, the data verification module is used to:
[0044] Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition;
[0045] Based on a hypertext transfer protocol request, calling a second data interface of a service module matching the second service flow type to obtain first flow statistics data corresponding to the second time range;
[0046] According to the second time range and the second business flow type, obtaining corresponding second flow statistics data in the target database;
[0047] If the second transaction statistics data match the first transaction statistics data, it is determined that the integrity check of the data in the target database passes.
[0048] In one embodiment, the data verification module is further used to:
[0049] If the second transaction statistics data do not match the first transaction statistics data, it is determined that the integrity check of the data in the target database fails.
[0050] In one embodiment, the data modification module is used to:
[0051] Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition;
[0052] For each of the second business flow types, obtaining first business statistical data within the second time range from a corresponding business module;
[0053] and acquiring corresponding second business statistical data from the target database;
[0054] If the second business statistical data does not match the first business statistical data, based on the corresponding second business flow type, obtaining second business flow data corresponding to the second time range from the business module;
[0055] Based on the second business flow data, the target database is updated.
[0056] In one embodiment, the device further includes a condition determination module, configured to:
[0057] When it is detected that a preset timed synchronization task is triggered, it is determined that the synchronization condition is met; or,
[0058] When an immediate synchronization task request is received, it is determined that the synchronization condition is met.
[0059] In one embodiment, the type acquisition module is used to:
[0060] Querying the business flow configuration table of the target database to obtain the business flow type pre-configured in the business flow configuration table;
[0061] The service flow type is determined as the first service flow type of the data to be synchronized.
[0062] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0063] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0064] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0065] The above-mentioned business flow synchronization method, device, computer equipment, storage medium and computer program product, by obtaining the first business flow type of the data to be synchronized when it is determined that the synchronization conditions are met, determining the business module corresponding to the first business flow type, obtaining the corresponding first business flow data through the first data interface of the business module, and storing the first business flow data in the target database, and then verifying the integrity of the data in the target database when the verification conditions are met, and repairing the data in the target database when it is determined that the integrity verification fails, thereby ensuring the integrity of the data in the target database, improving the accuracy of data synchronization, and avoiding data omissions. In addition, the present application uses HTTP (Hypertext Transfer Protocol) requests to call the data interface API of each business module or functional module to perform data synchronization and data verification respectively, which can not only improve the efficiency of data synchronization and reduce the impact on system performance, but also realize real-time or quasi-real-time synchronization of data based on time conditions or instruction conditions to improve the real-time nature of data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0067] Figure 1 A schematic diagram of a process flow of a service flow synchronization method in one embodiment;
[0068] Figure 2 A schematic diagram of a process for obtaining first business flow data in an embodiment;
[0069] Figure 3 A schematic diagram of a flow chart of a step of verifying data integrity in one embodiment;
[0070] Figure 4 A schematic diagram of a data repair process in an embodiment;
[0071] Figure 5 A structural block diagram of a service flow synchronization device in an embodiment;
[0072] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0074] 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0075] In the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0076] In one embodiment, Figure 1 As shown, a service flow synchronization method is provided. This embodiment uses the method applied to a computer device as an example. In this embodiment, the method may include the following steps:
[0077] Step 102: When the synchronization condition is met, obtain the first business flow type of the data to be synchronized.
[0078] The synchronization condition may be a condition or requirement to be met for executing the synchronous business flow. Specifically, the synchronous business flow is to synchronously transmit the business flow data of different business modules in the business system to the target database, such as the database of the accounting module, so that the accounting module can perform accounting.
[0079] The synchronization condition may be a time condition or an instruction condition that requires synchronization. For example, when a computer device detects that a pre-set scheduled synchronization task is triggered, it can be determined that the synchronization condition is met. The scheduled synchronization task may be a synchronization task configured based on the task interval time. When the task interval time arrives, the scheduled synchronization task will be triggered, and the synchronization condition is met. In one scenario, when a computer device receives an instant synchronization task request, it can be determined that the synchronization condition is met. The instant synchronization task may be a synchronization task that is initiated immediately. Specifically, when the business flow needs to be synchronized, the corresponding instant synchronization task can be initiated, and the synchronization condition is met.
[0080] The data to be synchronized may be related parameters that need to be synchronized, and specifically may be parameter configurations of data that the target database needs to synchronize. For example, the data to be synchronized may be parameters such as business flow type, account book number, center number, accounting date, business sequence number, and business flow number pre-configured in the target database.
[0081] The first business flow type is a specific parameter in the data to be synchronized, which characterizes the business type information corresponding to the business flow. It is understandable that each business module in the business system may include different functional modules, and each functional module corresponds to a different business type of business flow. For example, in the provident fund system, the business module for fund management may include multiple functional modules, and the business types corresponding to each functional module may include but are not limited to fixed deposit business, handling fee business, fund transfer business, fund business, loan business, collection business, maintenance fund business, etc.
[0082] In this embodiment, when the computer device determines that the synchronization condition is met, it can obtain the data to be synchronized based on the target database, and then obtain the first business flow type in the data to be synchronized, that is, obtain the business type information corresponding to the business flow to be synchronized, and then perform data synchronization through subsequent steps. It can be understood that the first business flow type can include one or more.
[0083] Step 104: determine a service module corresponding to the first service flow type, and obtain corresponding first service flow data through a first data interface of the service module.
[0084] Among them, the business module refers to an integrated module in the business system for realizing specific business. For example, if the business system is a public reserve system, it includes but is not limited to business modules such as a collection module, a loan module, and a capital module. Since each business module in the business system can also include different functional modules, and the business types of the business flows corresponding to them are different, the computer device can determine the corresponding functional module or business module based on the first business flow type obtained in the above steps.
[0085] In this embodiment, each business module or functional module may have at least two data interface APIs, one of which is used to obtain business flow data for data synchronization, and the other is used to obtain verification data for data verification. Specifically, the corresponding first business flow data may be obtained through the first data interface of the business module or functional module determined above, wherein the first business flow data is the business flow data obtained from the corresponding business module or functional module and needs to be synchronized to the target database.
[0086] In one scenario, when there are multiple first business flow types obtained in the above steps, the first data interface of each business module or functional module can be called to obtain the corresponding first business flow data based on the functional module or business module corresponding to each first business flow type, so as to obtain the business flow of each business module or functional module. In this way, the business flow data of each business module or functional module can be synchronized in parallel to improve the data synchronization efficiency.
[0087] Step 106, storing the first business flow data in the target database.
[0088] The target database is a data warehouse that needs to synchronize business flow data of different business modules in the business system. For example, the target database may be a database of an accounting module.
[0089] In this embodiment, the first business flow data, namely the business flow, obtained from each business module in the above steps may be stored in the target database, thereby achieving synchronization and centralized management of the business flow.
[0090] Step 108: If the verification conditions are met, verify the integrity of the data in the target database.
[0091] The verification condition may be a condition or requirement that needs to be met to perform data integrity verification. The data integrity verification verifies the integrity of synchronized data in the target database to avoid data omission.
[0092] The verification condition may specifically be a time condition for verification. Specifically, a scheduled verification task may be pre-configured, and when the scheduled time of the verification task arrives, the scheduled verification task will be triggered, and at this time, it can be determined that the verification condition is met. In one scenario, the scheduled verification task may be implemented based on the end-of-day task.
[0093] In this embodiment, when the computer device determines that the verification condition is met, it can verify the integrity of the data in the target database to determine whether the data in the target database is complete, that is, determine whether the integrity check passes.
[0094] Step 110: When it is determined that the integrity check fails, the data in the target database is repaired.
[0095] Among them, failure of the integrity check indicates that the data in the target database is incomplete. Repair is the process of repairing the incomplete data in the target database to make it complete. In this embodiment, when the computer device determines that the integrity check fails, it can further repair the data in the target database, so that the data in the target database can be complete and not missed.
[0096] In the above-mentioned business flow synchronization method, when the computer device determines that the synchronization conditions are met, it obtains the first business flow type of the data to be synchronized, determines the business module corresponding to the first business flow type, obtains the corresponding first business flow data through the first data interface of the business module, and stores the first business flow data in the target database. Then, when the verification conditions are met, the integrity of the data in the target database is verified, and when it is determined that the integrity check fails, the data in the target database is repaired, thereby ensuring the integrity of the data in the target database, improving the accuracy of data synchronization, and avoiding data omissions.
[0097] In an exemplary embodiment, in step 102, obtaining the first business flow type of the data to be synchronized may specifically include: querying the business flow configuration table of the target database to obtain the business flow type pre-configured in the business flow configuration table; and determining the found business flow type as the first business flow type of the data to be synchronized.
[0098] Among them, the business flow configuration table can be a parameter configuration of the data to be synchronized that is pre-configured in the target database, which may specifically include but is not limited to parameters such as business flow type, account book number, center number, accounting date, business sequence number, and business flow number. In this embodiment, when business flow synchronization is required, the business flow configuration table pre-configured in the target database can be queried to obtain the parameter configuration of the data to be synchronized, and then the business flow type parameter can be obtained, and the obtained business flow type is determined as the first business flow type of the data to be synchronized, so as to facilitate subsequent data synchronization.
[0099] In one scenario, when there are multiple account books in the target database, each account book may have a corresponding business flow configuration table. When obtaining the first business flow type of the data to be synchronized, the business flow configuration table corresponding to the account book to be synchronized may be searched based on the account book to be synchronized to determine the first business flow type of the data to be synchronized, thereby facilitating subsequent data synchronization.
[0100] In an exemplary embodiment, Figure 2 As shown, in step 104, obtaining corresponding first business flow data through the first data interface of the business module may specifically include:
[0101] Step 202: Determine a first time range of data to be synchronized corresponding to the synchronization condition.
[0102] The first time range refers to the time range of data that needs to be synchronized corresponding to the current synchronization condition, which may specifically include at least one of a starting time point and an ending time point of the data that needs to be synchronized.
[0103] Specifically, the first time range of the data to be synchronized can be determined based on the synchronization task that meets the current synchronization condition. For example, if the synchronization task that meets the current synchronization condition is a synchronization task that is executed for the first time, the first time range of the data to be synchronized can be determined based on the current time, such as the current time point can be determined as the end time point of the data to be synchronized, and all time points earlier than the end time point can be determined as the corresponding first time range.
[0104] In one scenario, if the synchronization task that meets the current synchronization condition is not the first synchronization task to be executed, the first time range of the data that needs to be synchronized can be determined based on the current time. For example, the current time point can be determined as the end time point of the data that needs to be synchronized, and the end time point of the last synchronization task can be determined as the start time point of the data that needs to be synchronized, thereby determining the first time range of the data that needs to be synchronized.
[0105] Step 204: Call the first data interface of the corresponding business module based on the hypertext transfer protocol request to obtain the corresponding first business flow data.
[0106] Among them, the Hypertext Transfer Protocol (HTTP) is a simple request-response protocol that usually runs on top of TCP (Transmission Control Protocol), which specifies what kind of messages a client may send to a server and what kind of responses it may get.
[0107] Specifically, the computer device can call the first data interface of the corresponding business module based on the hypertext transfer protocol request to obtain the first business flow data corresponding to the first time range from the corresponding business module. It can be understood that the business flow data of each business module in the business system has a corresponding timestamp, so the business flow data with a timestamp within the first time range can be obtained, thereby obtaining the first business flow data corresponding to the first business flow type and the first time range.
[0108] In this embodiment, since HTTP can be easily used in combination with SSL (Secure Socket Layer) / TLS (Transport Layer Security), in the process of calling the data interface API of the corresponding business module through HTTP request to obtain the first business flow data within the corresponding first time range, encrypted data transmission can be provided to protect the security and privacy of the data, thereby preventing the data content from being tampered with and improving the security of data synchronization.
[0109] In an exemplary embodiment, Figure 3As shown, in step 108, the integrity of the data in the target database is verified, which may specifically include:
[0110] Step 302: Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition.
[0111] Among them, the second business flow type refers to the business type information corresponding to the business flow that needs to be verified, and its acquisition method is similar to the acquisition method of the first business flow type, which will not be repeated in this embodiment.
[0112] The second time range refers to the time range in which the data needs to be verified at present, which can be specifically determined based on the verification task that meets the current verification conditions, including the starting time point and the ending time point of the data that needs to be verified. For example, taking the verification task based on the end-of-day task as an example, since the end-of-day task is based on the summary of the day's tasks, the second time range of the corresponding verification task refers to the time range with 0:00 of the day as the starting time point and 24:00 of the day as the ending time point.
[0113] Specifically, the computer device can determine the second time range and the second business flow type of the data to be verified corresponding to the verification condition based on the verification condition, and then perform data verification through subsequent steps.
[0114] Step 304: Based on the hypertext transfer protocol request, call the second data interface of the business module to obtain first flow statistics data corresponding to the second time range.
[0115] The first transaction statistics data is a transaction statistics result of the business transaction data obtained from the corresponding business module based on the second time range and the second business transaction type. Specifically, it can be the total amount of all business transaction data corresponding to all second business transaction types within the second time range, the total number of business transactions, and the total number of business types.
[0116] Specifically, the computer device can call the second data interface of the business module matching the second business flow type based on the Hypertext Transfer Protocol request to obtain business flow data corresponding to the second time range from the corresponding business module, and then perform statistics on it to obtain corresponding first flow statistics data.
[0117] Step 306, obtaining corresponding second transaction statistics data in the target database.
[0118] The second transaction statistics are transaction statistics of all business transaction data corresponding to the second time range and the second business transaction type obtained from the target database. Specifically, they may be the total amount, the total number of business transactions, and the total number of business types corresponding to the business transaction data corresponding to the second business transaction type within the second time range.
[0119] Step 308: Determine whether the second transaction statistics data matches the first transaction statistics data.
[0120] Specifically, the total amount, the total number of business transactions and the total number of business types in the first transaction statistics data can be compared with the total amount, the total number of business transactions and the total number of business types in the second transaction statistics data. If the three indicators are completely consistent, it means that the second transaction statistics data match the first transaction statistics data. If any of the three indicators is inconsistent, it means that the second transaction statistics data do not match the first transaction statistics data.
[0121] In this embodiment, if the second water flow statistics match the first water flow statistics, it means that the data in the target database is complete, and step 310 is executed. If the second water flow statistics match the first water flow statistics, it means that the data in the target database is incomplete, and step 312 is executed.
[0122] Step 310: Determine whether the integrity check of the data in the target database passes.
[0123] Specifically, if the second transaction statistics data matches the first transaction statistics data, it means that the two are consistent, that is, the data in the target database is complete. Therefore, it can be determined that the integrity check of the data in the target database has passed.
[0124] In one scenario, when it is determined that the integrity check of the data in the target database has passed, a status mark indicating that the check has passed may be added to the target database so that the status of the data in the target database can be intuitively understood.
[0125] Step 312: Determine whether the integrity check of the data in the target database fails.
[0126] Specifically, if the second transaction statistics data do not match the first transaction statistics data, it means that the two are inconsistent, that is, the data in the target database is incomplete. Therefore, it can be determined that the integrity check of the data in the target database has failed.
[0127] In this embodiment, the synchronization data and the verification data are respectively acquired using different data interfaces to achieve back-to-back data acquisition and data verification, thereby avoiding packet loss due to data interface problems of the synchronization data, which in turn leads to incomplete data. This not only improves the integrity of the synchronization data, but also allows different data interfaces to be processed in parallel, which is beneficial to improving data synchronization efficiency and achieving quasi-real-time data synchronization to meet the time requirements of downstream systems.
[0128] In an exemplary embodiment, Figure 4As shown, in step 110, repairing the data in the target database may specifically include:
[0129] Step 402, determining a second time range and a second business flow type of the data to be verified corresponding to the verification condition.
[0130] For details, please refer to the description of step 302 above, which will not be described in detail in this embodiment.
[0131] Step 404: for each second business flow type, obtain first business statistical data within a second time range from a corresponding business module.
[0132] The first business statistical data is a business statistical result of business flow data obtained from the corresponding business module within the second time range based on the statistics of each second business flow type. Specifically, it can be the amount and number of business flow data under each second business flow type within the second time range. Specifically, the first business statistical data can be obtained by calling the second data interface of the corresponding business module based on a hypertext transfer protocol request.
[0133] In one scenario, each business module may also have a third data interface, and the first business statistical data may also be obtained based on a hypertext transfer protocol request by calling the third data interface of the corresponding business module, thereby further improving data synchronization efficiency and ensuring the accuracy of data verification.
[0134] Step 406: Acquire corresponding second business statistical data from the target database.
[0135] The second business statistical data is a business statistical result of business flow data under each second business flow type within the second time range obtained from the target database, which may specifically be the amount and number of business flow data under each second business flow type within the second time range.
[0136] Step 408: determine the unmatched second business flow type and obtain the corresponding second business flow data.
[0137] The unmatched second business flow type is the corresponding second business flow type when the second business statistics data does not match the first business statistics data. The second business flow data is the business flow data obtained from the corresponding business module based on the unmatched second business flow type.
[0138] Specifically, the computer device determines the unmatched second service flow type and then obtains the corresponding second service flow data. Specifically, the second service flow data can be obtained by calling the second data interface of the corresponding service module based on a hypertext transfer protocol request.
[0139] In one scenario, each business module may also have a fourth data interface, and the second business flow data may also be obtained based on a hypertext transfer protocol request by calling the fourth data interface of the corresponding business module, thereby further improving data synchronization efficiency and ensuring data integrity.
[0140] Step 410: Update the target database based on the second business flow data.
[0141] Specifically, the second business flow data may be stored in the target database to replace the business flow data in the target database within the second time range corresponding to the second business flow type, so as to repair the data in the target database and ensure the integrity of the data.
[0142] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0143] Based on the same inventive concept, the embodiment of the present application also provides a service flow synchronization device for implementing the service flow synchronization method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more service flow synchronization device embodiments provided below can refer to the limitations on the service flow synchronization method above, and will not be repeated here.
[0144] In an exemplary embodiment, Figure 5 As shown, a business flow synchronization device is provided, including: a type acquisition module 502, a data acquisition module 504, a data storage module 506, a data verification module 508 and a data modification module 510, wherein:
[0145] A type acquisition module 502, used to acquire a first business flow type of the data to be synchronized when the synchronization condition is met;
[0146] A data acquisition module 504, configured to determine a service module corresponding to the first service flow type, and acquire corresponding first service flow data through a first data interface of the service module;
[0147] A data storage module 506, used for storing the first business flow data in a target database;
[0148] A data verification module 508, used to verify the integrity of the data in the target database when the verification conditions are met;
[0149] The data modification module 510 is used to repair the data in the target database when it is determined that the integrity check fails.
[0150] In an exemplary embodiment, the data acquisition module is used to: determine a first time range of the data to be synchronized corresponding to the synchronization condition; call the first data interface based on a hypertext transfer protocol request to obtain first business flow data corresponding to the first time range from the corresponding business module.
[0151] In an exemplary embodiment, the data verification module is used to: determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition; based on a hypertext transfer protocol request, call a second data interface of a business module that matches the second business flow type to obtain first flow statistics data corresponding to the second time range; according to the second time range and the second business flow type, obtain corresponding second flow statistics data in the target database; if the second flow statistics data match the first flow statistics data, determine that the integrity check of the data in the target database has passed.
[0152] In an exemplary embodiment, the data verification module is further used to: determine that the integrity check of the data in the target database fails if the second flow statistics data does not match the first flow statistics data.
[0153] In an exemplary embodiment, the data modification module is used to: determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition; for each of the second business flow type, obtain first business statistical data within the second time range from the corresponding business module; and obtain corresponding second business statistical data from the target database; if the second business statistical data does not match the first business statistical data, based on the corresponding second business flow type, obtain second business flow data corresponding to the second time range from the business module; based on the second business flow data, update the target database.
[0154] In an exemplary embodiment, the device further includes a condition determination module, which is used to: determine that the synchronization condition is satisfied when it is detected that a preset timed synchronization task is triggered; or determine that the synchronization condition is satisfied when an instant synchronization task request is received.
[0155] In an exemplary embodiment, the type acquisition module is used to: query the business flow configuration table of the target database to obtain the business flow type pre-configured in the business flow configuration table; and determine the business flow type as the first business flow type of the data to be synchronized.
[0156] Each module in the above-mentioned business flow synchronization device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0157] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be synchronized. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a business pipeline synchronization method is implemented.
[0158] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0159] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0160] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0161] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0162] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0163] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0164] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A business flow synchronization method, characterized in that: The method comprises: When the synchronization condition is met, obtaining a first business flow type of the data to be synchronized; Determine a service module corresponding to the first service flow type, and obtain corresponding first service flow data through a first data interface of the service module; storing the first business flow data in a target database; If the verification conditions are met, verify the integrity of the data in the target database; When it is determined that the integrity check fails, the data in the target database is repaired.
2. The method according to claim 1, characterized in that The obtaining corresponding first business flow data through the first data interface of the business module includes: Determine a first time range of the data to be synchronized corresponding to the synchronization condition; The first data interface is called based on a hypertext transfer protocol request to obtain first business flow data corresponding to the first time range from a corresponding business module.
3. The method according to claim 1, characterized in that The verifying the integrity of the data in the target database includes: Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition; Based on a hypertext transfer protocol request, calling a second data interface of a service module matching the second service flow type to obtain first flow statistics data corresponding to the second time range; According to the second time range and the second business flow type, obtaining corresponding second flow statistics data in the target database; If the second transaction statistics data match the first transaction statistics data, it is determined that the integrity check of the data in the target database passes.
4. The method according to claim 3, characterized in that The method further comprises: If the second transaction statistics data do not match the first transaction statistics data, it is determined that the integrity check of the data in the target database fails.
5. The method according to claim 1, characterized in that The repairing of the data in the target database includes: Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition; For each of the second business flow types, obtaining first business statistical data within the second time range from a corresponding business module; and acquiring corresponding second business statistical data from the target database; If the second business statistical data does not match the first business statistical data, based on the corresponding second business flow type, obtaining second business flow data corresponding to the second time range from the business module; Based on the second business flow data, the target database is updated.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When it is detected that a preset timed synchronization task is triggered, it is determined that the synchronization condition is met; or, When an immediate synchronization task request is received, it is determined that the synchronization condition is met.
7. The method according to any one of claims 1 to 5, characterized in that: The obtaining of the first service flow type of the data to be synchronized includes: Querying the business flow configuration table of the target database to obtain the business flow type pre-configured in the business flow configuration table; The service flow type is determined as the first service flow type of the data to be synchronized.
8. A service flow synchronization device, characterized in that: The device comprises: A type acquisition module, used to acquire the first business flow type of the data to be synchronized when the synchronization condition is met; A data acquisition module, used to determine a business module corresponding to the first business flow type, and acquire corresponding first business flow data through a first data interface of the business module; A data storage module, used for storing the first business flow data in a target database; A data verification module, used to verify the integrity of the data in the target database when the verification conditions are met; The data modification module is used to repair the data in the target database when it is determined that the integrity check fails.
9. The device according to claim 8, characterized in that The data acquisition module is used for: Determine a first time range of the data to be synchronized corresponding to the synchronization condition; The first data interface is called based on a hypertext transfer protocol request to obtain first business flow data corresponding to the first time range from a corresponding business module.
10. The device according to claim 8, characterized in that The data verification module is used for: Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition; Based on a hypertext transfer protocol request, calling a second data interface of a service module matching the second service flow type to obtain first flow statistics data corresponding to the second time range; According to the second time range and the second business flow type, obtaining corresponding second flow statistics data in the target database; If the second transaction statistics data match the first transaction statistics data, it is determined that the integrity check of the data in the target database passes.
11. The device according to claim 10, characterized in that The data verification module is also used for: If the second transaction statistics data do not match the first transaction statistics data, it is determined that the integrity check of the data in the target database fails.
12. The device according to claim 8, characterized in that The data modification module is used for: Determine a second time range and a second business flow type of the data to be verified corresponding to the verification condition; For each of the second business flow types, obtaining first business statistical data within the second time range from a corresponding business module; and acquiring corresponding second business statistical data from the target database; If the second business statistical data does not match the first business statistical data, based on the corresponding second business flow type, obtaining second business flow data corresponding to the second time range from the business module; Based on the second business flow data, the target database is updated.
13. The device according to any one of claims 8 to 12, characterized in that The device also includes a condition determination module, which is used to: When it is detected that a preset timed synchronization task is triggered, it is determined that the synchronization condition is met; or, When an immediate synchronization task request is received, it is determined that the synchronization condition is met.
14. The device according to any one of claims 8 to 12, characterized in that The type acquisition module is used for: Querying the business flow configuration table of the target database to obtain the business flow type pre-configured in the business flow configuration table; The service flow type is determined as the first service flow type of the data to be synchronized.
15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
17. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
