Method and device for batch stable supply of number of units at night
By creating business parameter tables and data storage tables in the database, errors caused by changes in accounting data during the generation of data supply files were resolved, thus ensuring the stability of data supply files and the smoothness of the system. This makes the system suitable for various transactions and report displays in financial institutions.
Patent Information
- Application Number
- CN202210782779.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-06-28
AI Technical Summary
When generating the supply data file, normal transactions come in and the system processes the data in real time, causing changes to the accounting data and resulting in errors in the supply data file.
Create a business parameter table and a data storage table in the database, record the names of the business tables and fields that need to be saved, and save the financial data generated by the transaction to the data storage table during the generation of the data supply file. When supplying data, retrieve the data from the data storage table to ensure data stability.
It ensures the stability of data supply, avoids errors caused by accounting discrepancies, reduces manpower consumption, ensures system smoothness, and is suitable for various transaction and reporting scenarios of financial institutions.
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and provides a method and device for stabilizing batch supply of data at night. BACKGROUND
[0002] Currently, after the batch account processing of the in-house account system at night is completed, loan, repayment, repayment plan and other account information are provided to the downstream system or the channel of the cooperative party, and it is agreed that no loan or repayment transaction is allowed during the batch processing time at night to avoid errors in the supply of data to the downstream or the cooperative party, thereby causing the account to be unbalanced. However, in actual production, batch processing may be delayed, thereby causing the time for generating the supply data file to be delayed. After normal transactions are processed, the system processes data in real time, the account data is changed, and the supply data is incorrect.
[0003] The current processing scheme mainly backs up the entire set of data after batch processing. If data problems occur, the data is pulled from the backup database to correct the data errors.
[0004] Technical defects:
[0005] The in-house system directly accesses the database of the account system. The cooperative institutions outside the line include channels and joint lines, which generate supply data files to the server, and the cooperative party directly takes them. After the batch processing at night, a scheduled task is specially generated to generate the supply data file for the cooperative party. The batch processing at night is generally in the time period of 23:00-01:00. This time period is not allowed to enter the loan and repayment transactions. The supply data file is generated for the cooperative party in the time period of 01:00-02:00. There will be transactions in this time period, but the cooperative party needs the data after the batch processing, which truly reflects the situation of the previous day. If the new transaction data is supplied to the cooperative party during the supply stage, errors will occur.
[0006] The supply of data to the outside actually means generating corresponding data files from the database data for the cooperative party or the downstream to call. SUMMARY
[0007] The purpose of the present application is to solve the problem that when the supply data file is generated, normal transactions are processed, the system processes data in real time, the account data is changed, and the supply data is incorrect.
[0008] In order to solve the above technical problems, the present application adopts the following technical means:
[0009] A method for stabilizing batch supply of data at night, comprising the following steps:
[0010] Step 1, a business parameter table Parm_table is created in the database, which is used to record the table name of the business table to be saved and the field name of the business table;
[0011] Step 2, a data storage table Data_table is created in the database, and when financial data generated by a transaction needs to be saved during the generation of a supply number file, the table name and field of the corresponding business table are queried from the business parameter table according to the business table name involved in the financial data, then the values of the corresponding fields in the business table are queried according to the table name of the business table, and then stored in the data storage table Data_table;
[0012] Step 3, when the supply number file is generated, the corresponding business table and field are queried from the data storage table Data_table according to the business parameter table, if the data storage table Data_table has data, the data in the data storage table Data_table is taken, otherwise the data of the original business table is taken to generate the supply number file.
[0013] In the above technical solution, step 2 specifically comprises:
[0014] During the generation of the supply number file, the table name and key information corresponding to the account data when the transaction comes in are obtained, and the field values to be saved are queried out through the public method updateFiledData, and then updated to the data storage table Data_table after associating the business data parameter table according to the table name and key to be saved.
[0015] In the above technical solution, the public method updateFiledData comprises the following steps:
[0016] a. Determine whether the supply number is completed, if yes, directly jump out of the public method, and no data needs to be saved;
[0017] b. Whether the table name and field corresponding to the financial data are configured in the business parameter configuration table, if not, jump out of the public method;
[0018] c. Determine whether the account data has been saved in the data storage table Data_table, if yes, jump out of the public method;
[0019] d. According to the table name corresponding to the financial data, associate the business data parameter table, query the values of the corresponding fields in the business parameter table from the business data table, and save them to the data storage table Data_table.
[0020] The application also provides a device for late-night batch stable supply number, comprising the following modules:
[0021] The business parameter table module: a business parameter table Parm_table is created in the database, which is used for recording the table name of the business table to be saved and the field name of the business table;
[0022] Data storage table module: Create a data storage table Data_table in the database. During the generation of data supply files, when financial data generated by transactions needs to be saved, the table name and fields of the corresponding business table are retrieved from the business parameter table based on the business table name involved in the financial data. Then, the table name of the retrieved business table is associated with the business table, the values of the corresponding fields in the business table are retrieved, and then stored in the data storage table Data_table.
[0023] Data supply file module: When generating the data supply file, it queries the corresponding business table and fields from the data storage table Data_table based on the business parameter table. If the data storage table Data_table contains data, it retrieves the data from the data storage table Data_table; otherwise, it retrieves the data from the original business table to generate the data supply file.
[0024] In the above technical solution, the data storage table module:
[0025] During the generation of the data supply file, the table name and keyword information corresponding to the accounting data when the transaction comes in are obtained. The public method updateFieldData retrieves the field values to be saved by querying the data storage table Data_table after associating the table name and keyword to be saved with the input business data parameter table.
[0026] In the above technical solution, the public method updateFieldData includes the following steps;
[0027] a) Determine if the data supply is complete. If it is complete, exit the public method directly without saving the data.
[0028] b. Whether the table name and fields corresponding to the financial data are configured in the business parameter configuration table. If not configured, exit this public method.
[0029] c. Determine whether the accounting data has been saved in the data storage table Data_table. If it has been saved, exit the public method.
[0030] d. Based on the table name corresponding to the financial data, associate it with the business data parameter table, query the values of the corresponding fields in the business parameter table from the business data table, and save them to the data storage table Data_table.
[0031] Because the present invention adopts the above-described technical solution, it has the following beneficial effects:
[0032] 1. This method ensures the stability of the data supply and guarantees that there are no problems with the accounts and reports of other systems and partners. Accounting discrepancies and reconciliation always require a lot of manpower, while also ensuring the smooth operation of the system.
[0033] 2、This scheme can be applied to all the need to keep the original data after data processing, another transaction or scenario triggered, in order to act on the next scene, in fact, there are very many such scenarios in the financial institution system, including deposit / withdrawal, loan / repayment, transaction inquiry, report display and so on, can be combined with the actual situation through the scheme processing. DETAILED DESCRIPTION
[0034] The embodiments of the present application will be described in detail below. Although the present application will be described and illustrated with reference to some specific embodiments, it is noted that the present application is not limited to only these embodiments. Rather, modifications or equivalent arrangements are intended to be encompassed within the scope of the present application.
[0035] In addition, in order to better illustrate the present application, a number of specific details are given in the following detailed description. Those skilled in the art will understand that the present application can be implemented without these specific details.
[0036] In order to achieve the above-mentioned purpose, the present application adopts the following technical means:
[0037] A method for providing a stable number of batches at night, comprising the following steps:
[0038] Step 1, a business parameter table Parm_table is created in the database, which is used to record the table name of the business table to be saved and the field name of the business table; the business parameter table is mainly to define the table and data to be saved, such as B, C and D in A table, which are to be saved, and are defined in the business parameter table.
[0039] Step 2, a data storage table Data_table is created in the database, during the generation of the number of files, when the financial data generated by the transaction needs to be saved, the table name and field of the corresponding business table are queried from the business parameter table according to the business table name involved in the financial data, then the corresponding field value in the business table is queried according to the table name of the queried business table, and then stored in the data storage table Data_table; it is worth noting that the data updated to the Data_table is the value before the financial data of the transaction, which is equivalent to backing up the previous data to the Data_table table;
[0040] When the number is provided, the business table queries from the storage table according to the key, if the storage table has data, the storage table is taken, otherwise the original business table is taken (no data in the storage table, indicating that no corresponding transaction has come in)
[0041] The accounting update system program has logic, and it knows in advance which tables to update, such as repayment transactions, which need to update the loan table, the repayment plan table, the interest accrual table, etc. The data coming in the transaction has a transaction type (lending / repayment…) and a loan number (key), otherwise it cannot be recorded);
[0042] Step 3: When generating the supply number file, the corresponding business table and field are queried from the data storage table Data_table according to the business parameter table. If there is data in the data storage table Data_table, the data in the data storage table Data_table is taken, otherwise the data of the original business table is taken to generate the supply number file.
[0043] Note: This public method is mainly triggered before the transaction comes in and the accounting logic is processed. For example, in the original logic, the repayment transaction will update the loan table, the repayment plan table, the interest accrual table, and a series of operations. This method is triggered before the original logic transaction. First, it is judged whether the supply number is completed. If it has been completed, there is no need to save the data. Then it is judged whether some fields of a certain table are configured in the parameter table (the transaction involves the update of many table fields, but the supply number may only be some fields of one or several tables). If it is configured in the parameter table, it is judged whether some tables and fields have been saved. If they have been saved, it is directly exited (this logic is to prevent multiple saves and updates, and only the data after batch processing needs to be saved). If they have not been saved, the fields (tables and fields are configured in the parameter table) that need to be saved are queried according to the parameter table. Then the data is queried according to the queried table and field, the transaction key associated business table (select B, C, D… from A where table primary key = key), and saved to the storage table for supply number. When the supply number is generated, the business table is queried from the storage table according to the key. If there is data in the storage table, the data in the storage table is taken. Otherwise, the original business table is taken (there is no data in the storage table, indicating that there is no corresponding transaction coming in).
[0044] In the above technical solution, step 2 specifically includes:
[0045] During the generation of the supply number file, the table name and key information corresponding to the accounting data when the transaction comes in are obtained. Through the public method updateFiledData, the field values that need to be saved are queried out after associating the business data parameter table, and then updated to the data storage table Data_table.
[0046] In the above technical solution, the public method updateFiledData includes the following steps:
[0047] a. Judge whether the supply number is completed. If it has been completed, directly exit the public method and do not save the data.
[0048] b. Whether the table name and fields corresponding to the financial data are configured in the business parameter configuration table. If not configured, exit this public method.
[0049] c. Determine whether the accounting data has been saved in the data storage table Data_table. If it has been saved, exit the public method.
[0050] d. Based on the table name corresponding to the financial data, associate it with the business data parameter table, query the values of the corresponding fields in the business parameter table from the business data table, and save them to the data storage table Data_table.
[0051] The present invention also provides a device for stable batch data supply at night, comprising the following modules:
[0052] Business Parameter Table Module: Creates a business parameter table Parm_table in the database to record the names of the business tables that need to be saved, as well as the field names of the business tables;
[0053] Data storage table module: Create a data storage table Data_table in the database. During the generation of data supply files, when financial data generated by transactions needs to be saved, the table name and fields of the corresponding business table are retrieved from the business parameter table based on the business table name involved in the financial data. Then, the table name of the retrieved business table is associated with the business table, the values of the corresponding fields in the business table are retrieved, and then stored in the data storage table Data_table.
[0054] Data supply file module: When generating the data supply file, it queries the corresponding business table and fields from the data storage table Data_table based on the business parameter table. If the data storage table Data_table contains data, it retrieves the data from the data storage table Data_table; otherwise, it retrieves the data from the original business table to generate the data supply file.
[0055] In the above technical solution, the data storage table module:
[0056] During the generation of the data supply file, the table name and keyword information corresponding to the accounting data when the transaction comes in are obtained. The public method updateFieldData retrieves the field values to be saved by querying the data storage table Data_table after associating the table name and keyword to be saved with the input business data parameter table.
[0057] In the above technical solution, the public method updateFieldData includes the following steps;
[0058] a) Determine if the data supply is complete. If it is complete, exit the public method directly without saving the data.
[0059] b. whether the table name and field corresponding to the financial data are configured in the business parameter configuration table, if not, jump out of the public method;
[0060] c. whether the accounting data has been saved in the data storage table Data_table, if yes, jump out of the public method;
[0061] d. according to the table name corresponding to the financial data, associate the business data parameter table, query the value of the corresponding field in the business parameter table from the business data table, and save it to the data storage table Data_table.
[0062] Business parameter table configuration table and field name, data storage table is to save the table and field information and key (the key is sent by the front-end system when the transaction comes in, if the key is not sent, it cannot be positioned to a certain data), when the transaction comes in, first check the corresponding table and field in the parameter table (the table is known in advance, because the transaction logic is already in the system), find out the table and field, at this time, according to the key passed in, query the parameter table configuration field in the business table (the real record accounting information table), and then save it to the data storage table.
[0063] Parameter table is configured, any supply number logic change downstream can be directly changed parameter, the following logic does not need to change, the application is more extensive.
Claims
1. A method for stable batch data supply at night, characterized in that, Includes the following steps: Step 1: Create a business parameter table Parm_table in the database to record the table name of the business table that needs to be saved, as well as the field names of the business table; Step 2: Create a data storage table Data_table in the database. During the generation of the data supply file, when financial data generated by a transaction needs to be saved, query the table name and fields of the corresponding business table from the business parameter table based on the business table name involved in the financial data. Then, based on the table name of the queried business table, associate it with the business table, query the value of the corresponding field in the business table, and then store it in the data storage table Data_table. Step 3: When generating the data supply file, query the corresponding business table and fields from the data storage table Data_table based on the business parameter table. If data exists in the data storage table Data_table, then retrieve the data from the data storage table Data_table; otherwise, retrieve the data from the original business table to generate the data supply file. Step 2 specifically includes: During the generation of the data supply file, the table name and keyword information corresponding to the accounting data when the transaction comes in are obtained. The public method updateFieldData is used to query the field values that need to be saved after associating them with the business data parameter table based on the passed table name and keyword to be saved, and then update them in the data storage table Data_table. The public method updateFieldData includes the following steps; a) Determine if the data supply is complete. If it is complete, exit the public method directly without saving the data. b. Whether the table name and fields corresponding to the financial data are configured in the business parameter configuration table. If not configured, exit this public method. c. Determine whether the accounting data has been saved in the data storage table Data_table. If it has been saved, exit the public method. d. Based on the table name corresponding to the financial data, associate it with the business data parameter table, query the values of the corresponding fields in the business parameter table from the business data table, and save them to the data storage table Data_table.
2. A device for stable batch supply at night, characterized in that, Includes the following modules: Business Parameter Table Module: Creates a business parameter table Parm_table in the database to record the names of the business tables that need to be saved, as well as the field names of the business tables; Data storage table module: Create a data storage table Data_table in the database. During the generation of data supply files, when financial data generated by transactions needs to be saved, the table name and fields of the corresponding business table are retrieved from the business parameter table based on the business table name involved in the financial data. Then, the table name of the retrieved business table is associated with the business table, the values of the corresponding fields in the business table are retrieved, and then stored in the data storage table Data_table. Data supply file module: When generating the data supply file, the corresponding business table and fields are queried from the data storage table Data_table based on the business parameter table. If the data storage table Data_table contains data, the data in the data storage table Data_table is retrieved; otherwise, the data in the original business table is retrieved to generate the data supply file. Data storage table module: During the generation of the data supply file, the table name and keyword information corresponding to the accounting data when the transaction comes in are obtained. The public method updateFieldData is used to query the field values that need to be saved after associating them with the business data parameter table based on the passed table name and keyword to be saved, and then update them in the data storage table Data_table. The public method updateFieldData includes the following steps; a) Determine if the data supply is complete. If it is complete, exit the public method directly without saving the data. b. Whether the table name and fields corresponding to the financial data are configured in the business parameter configuration table. If not configured, exit this public method. c. Determine whether the accounting data has been saved in the data storage table Data_table. If it has been saved, exit the public method. d. Based on the table name corresponding to the financial data, associate it with the business data parameter table, query the values of the corresponding fields in the business parameter table from the business data table, and save them to the data storage table Data_table.
Citation Information
Patent Citations
Data interaction method and system between offline systems
CN110502478A
All-weather batch processing technical method
CN112988799A