Business data processing method and device
By subdividing and storing business data by time and organizational identification, and generating data tables covering the target time unit, the query performance problems caused by large data volume are solved, and rapid query and resource saving are achieved.
Patent Information
- Application Number
- CN202411086675.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
AI Technical Summary
When a user needs to query transaction records within a specific time period, the amount of data is too large, so the system needs to traverse a large number of data rows, resulting in the query operation consumes a large number of system resources, increasing the user's waiting time and affecting the system performance.
By dividing business data into multiple data sets according to time and organizational identification, and storing them in different data tables, determining whether the conditions for creating new data tables are met based on the relevant parameters of the table, and a new data table is generated to cover the target time unit. In turn, it realizes segmented data storage and quick query.
It effectively avoids full table scanning, significantly shortens query time, improves user experience, and saves computing resources by reducing the amount of data in a single table, improving system performance.
Smart Images

Figure CN119003525A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for processing business data. Background Art
[0002] With the rapid development of financial markets and the widespread use of electronic trading systems, a large amount of transaction data is generated every day. These data are very valuable resources for financial institutions. They can not only reflect market dynamics, but also provide important basis for risk management and decision-making. Therefore, effectively processing and storing these transaction data is crucial to ensure the efficient operation of the system.
[0003] At present, most trading systems store real-time transaction data in a database for subsequent query and analysis. However, in actual operation, as the amount of data continues to accumulate, the business data stored in a single data table may become extremely large. When users need to query transaction records within a specific time period, if the amount of data involved is too large, the system will need to traverse a large number of data rows. In this case, the query operation will not only consume a lot of system resources, but also significantly increase the user's waiting time, thereby affecting the user experience and the overall performance of the system. Summary of the invention
[0004] The present disclosure provides a business data processing method and device thereof, so as to at least solve the problem in the related art that when a user needs to query transaction records within a specific time period, if the amount of data involved is too large, it will cause the system to traverse a large number of data rows.
[0005] The first aspect of the present application proposes a method for processing business data, including: obtaining business data of a target time unit, and dividing the business data into multiple business data sets according to an organization identifier carried by the business data; determining the first data table corresponding to each of the multiple business data sets, and storing the business data in the business data set in the first data table corresponding to it; for each business data set, obtaining table-related parameters of the first data table corresponding to the business data set after storage is completed, the table-related parameters including the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table; judging whether a condition for creating a new data table is met according to the table-related parameters corresponding to the first data table, in response to meeting the condition for creating a new data table, determining the time interval of a second data table according to the target time unit, and generating a second data table, the second data table corresponding to the same organization identifier as the first data table.
[0006] According to an embodiment of the present application, determining the first data table corresponding to each of the multiple business data sets includes: obtaining the table name of the candidate data table stored in the database; extracting the corresponding organization identifier and the time interval corresponding to the business data to be stored from the table name of the candidate data table; matching the organization identifier corresponding to the business data set with the organization identifier corresponding to the candidate data table from the database, and screening the first candidate data table that is consistent with the organization identifier corresponding to the business data set; from the first candidate data table, selecting the candidate data table whose time interval can cover the target time unit, and determining it as the first data table corresponding to the business data set.
[0007] According to one embodiment of the present application, whether the conditions for creating a new data table are met is determined based on the table-related parameters corresponding to the first data table, including: in response to the total amount of business data being greater than a preset reference value, determining that the conditions for creating a new data table are met; and / or, in response to the first end time unit of the time interval corresponding to the first data table being the target time unit, determining that the conditions for creating a new data table are met.
[0008] According to one embodiment of the present application, determining the time interval of the second data table according to the target time unit includes: determining the next time unit of the target time unit; determining the second end time unit of the time interval corresponding to the second data table according to the target time unit and the next time unit; determining the time interval corresponding to the second data table according to the next time unit and the second end time unit.
[0009] According to one embodiment of the present application, determining the second end time unit of the time interval corresponding to the second data table based on the target time unit and the next time unit includes: judging whether the target time unit and the next time unit belong to the same month; in response to the target time unit and the next time unit belonging to the same month, determining the last time unit corresponding to the month, and obtaining the expected time unit after a preset time interval starting from the next time unit; in response to the expected time unit being less than the last time unit, determining the expected time unit as the second end time unit of the time interval corresponding to the second data table.
[0010] According to an embodiment of the present application, the method for processing business data further includes: in response to the expected time unit being greater than or equal to the last time unit, determining the last time unit as the second end time unit of the time interval corresponding to the second data table.
[0011] According to one embodiment of the present application, the method for processing business data also includes: in response to the target time unit and the next time unit not belonging to the same month, obtaining the expected time unit after a preset time unit interval starting from the next time unit; determining the expected time unit as the second end time unit of the time interval corresponding to the second data table.
[0012] According to an embodiment of the present application, the method for processing business data further includes: generating a table name of the second data table based on an organization identifier corresponding to the second data table and a time interval corresponding to the second data table.
[0013] According to one embodiment of the present application, the method for processing business data also includes: in response to the total amount of business data being greater than a preset reference value and the end time unit of the time interval corresponding to the first data table is not a target time unit, updating the time interval corresponding to the first data table based on the target time unit.
[0014] According to one embodiment of the present application, the method for processing business data also includes: monitoring the candidate data table corresponding to each organization identifier; for any organization identifier, in response to monitoring that the business data corresponding to the organization identifier within the target time period have been stored, determining from the database according to the table name a plurality of candidate data tables corresponding to the organization identifier in the target time period, the target time period being each natural month and each natural year; aggregating the plurality of candidate data tables to obtain a summary table corresponding to the organization identifier in the target time period, and storing the summary table in the database.
[0015] According to one embodiment of the present application, the method for processing business data also includes: receiving a business data query request sent by a client; parsing the business data query request to obtain an account identifier, a target organization identifier, and a target time interval carried by the business data query request; determining a target data table from a database based on the target organization identifier and the target time interval; querying the business data stored in the target data table to obtain target business data corresponding to the account identifier, and returning the target business data to the client.
[0016] The second aspect of the present application proposes a business data processing device, including: a division module, used to obtain business data of a target time unit, and divide the business data into multiple business data sets according to an organization identifier carried by the business data; a storage module, used to determine the first data table corresponding to each of the multiple business data sets, and store the business data in the business data set in the first data table corresponding to it; an acquisition module, used to obtain, for each business data set, table-related parameters of the first data table corresponding to the business data set after storage is completed, the table-related parameters include the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table; a new creation module, used to determine whether a new data table creation condition is met according to the table-related parameters corresponding to the first data table, in response to meeting the new data table creation condition, determine the time interval of the second data table according to the target time unit, and generate a second data table, the second data table corresponds to the same organization identifier as the first data table.
[0017] According to one embodiment of the present application, the storage module is also used to: obtain the table name of the candidate data table stored in the database; extract the corresponding organization identifier and the time interval corresponding to the business data to be stored from the table name of the candidate data table; match the organization identifier corresponding to the business data set with the organization identifier corresponding to the candidate data table from the database, and screen the first candidate data table that is consistent with the organization identifier corresponding to the business data set; from the first candidate data table, select the candidate data table whose time interval can cover the target time unit, and determine it as the first data table corresponding to the business data set.
[0018] According to one embodiment of the present application, the new creation module is also used to: in response to the total amount of business data being greater than a preset reference value, determine that the conditions for creating a new data table are met; and / or, in response to the first end time unit of the time interval corresponding to the first data table being the target time unit, determine that the conditions for creating a new data table are met.
[0019] According to one embodiment of the present application, the new module is also used to: determine the next time unit of the target time unit; determine the second end time unit of the time interval corresponding to the second data table based on the target time unit and the next time unit; determine the time interval corresponding to the second data table based on the next time unit and the second end time unit.
[0020] According to one embodiment of the present application, the new module is also used to: determine whether the target time unit and the next time unit belong to the same month; in response to the target time unit and the next time unit belonging to the same month, determine the last time unit corresponding to the month, and obtain the expected time unit after a preset time interval starting from the next time unit; in response to the expected time unit being less than the last time unit, determine the expected time unit as the second end time unit of the time interval corresponding to the second data table.
[0021] According to an embodiment of the present application, the new creation module is further used to: in response to the expected time unit being greater than or equal to the last time unit, determine the last time unit as the second end time unit of the time interval corresponding to the second data table.
[0022] According to one embodiment of the present application, the new module is also used to: in response to the target time unit and the next time unit not belonging to the same month, obtain the expected time unit after a preset time unit interval starting from the next time unit; determine the expected time unit as the second end time unit of the time interval corresponding to the second data table.
[0023] According to an embodiment of the present application, the new creation module is further used to: generate a table name of the second data table based on the organization identifier corresponding to the second data table and the time interval corresponding to the second data table.
[0024] According to one embodiment of the present application, the new creation module is also used to: in response to the total amount of business data being greater than a preset reference value and the end time unit of the time interval corresponding to the first data table being not a target time unit, update the time interval corresponding to the first data table based on the target time unit.
[0025] According to one embodiment of the present application, the business data processing device also includes a summary module, which is used to: monitor the candidate data table corresponding to each organization identifier; for any organization identifier, in response to monitoring that the business data corresponding to the organization identifier within the target time period have been stored, determine from the database according to the table name a plurality of candidate data tables corresponding to the organization identifier in the target time period, the target time period being each natural month and each natural year; summarize the plurality of candidate data tables to obtain a summary table corresponding to the organization identifier in the target time period, and store the summary table in the database.
[0026] According to one embodiment of the present application, the business data processing device also includes a query module, which is used to: receive a business data query request sent by a client; parse the business data query request to obtain the account identifier, target organization identifier and target time interval carried by the business data query request; determine the target data table from the database based on the target organization identifier and the target time interval; query the business data stored in the target data table to obtain the target business data corresponding to the account identifier, and return the target business data to the client.
[0027] The third aspect embodiment of the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the business data processing method as described in the first aspect embodiment of the present application.
[0028] The fourth aspect embodiment of the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the business data processing method as described in the first aspect embodiment of the present application.
[0029] The fifth aspect embodiment of the present application proposes a computer program product, including a computer program, which, when executed by a processor, implements the business data processing method as described in the first aspect embodiment of the present application.
[0030] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects: In the present application, for users, by subdividing business data according to time and organization identification and storing them in different data tables, when users query data for a specific time period or a specific branch, they can directly locate the corresponding data table, avoiding full table scans, greatly shortening query time, and thus improving user experience. For the system, by distributing and storing data in multiple tables, the amount of data in a single table can be significantly reduced, thereby reducing the amount of data that needs to be processed each time a query is made, and the saved computing resources can be used to improve the quality of other services.
[0031] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0033] Figure 1 It is an exemplary schematic diagram of a method for processing business data shown in an embodiment of the present application.
[0034] Figure 2 It is an exemplary schematic diagram of a method for processing business data shown in an embodiment of the present application.
[0035] Figure 3 It is an exemplary schematic diagram of a method for processing business data shown in an embodiment of the present application.
[0036] Figure 4 It is an exemplary schematic diagram of a method for processing business data shown in an embodiment of the present application.
[0037] Figure 5 It is a schematic diagram of a business data processing device shown in an embodiment of the present application.
[0038] Figure 6 It is a schematic diagram of an electronic device shown in one embodiment of the present application. DETAILED DESCRIPTION
[0039] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0040] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.
[0041] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they 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.
[0042] Figure 1 is an exemplary schematic diagram of a method for processing business data shown in this application, such as Figure 1 As shown, the method for processing the business data includes the following steps:
[0043] S101, acquiring business data of a target time unit, and dividing the business data into a plurality of business data sets according to an organization identifier carried in the business data.
[0044] The time unit mentioned in this application may be a time parameter such as hour, day, month, etc. In this application, taking the banking system as an example, combined with the actual banking system, the following examples will be given with the time unit being day to facilitate the understanding of this solution.
[0045] The institution ID is a unique code used to distinguish different branches of a bank. By using the institution ID as the basis for grouping, effective classification of data can be achieved, thereby improving query speed and data access efficiency.
[0046] Taking the banking system as an example, assuming that the time unit is set to "day", after the end of each day's transactions, the system will automatically collect all the business data of the day and divide it into multiple independent business data sets according to different institution identifiers. This solution can process the business data of the previous day in the early morning of each day to prevent system resources from being occupied during the day.
[0047] Exemplarily, taking the target time unit as July 2, 2024 as an example, after obtaining all the business data of the banking system on July 2, 2024, the business data is divided into multiple business data sets according to the institution identifier carried by the business data. For example, if the institution identifier "BJ" represents the Beijing branch, all the business data carrying the "BJ" institution identifier on July 2, 2024 are divided into one business data set, which is the business data set corresponding to the Beijing branch on July 2, 2024; if the institution identifier "TJ" represents the Tianjin branch, all the business data carrying the "TJ" institution identifier on July 2, 2024 are divided into one business data set, which is the business data set corresponding to the Tianjin branch on July 2, 2024, and so on, until all the business data on July 2, 2024 are divided.
[0048] S102, determining first data tables corresponding to respective ones of the plurality of business data sets, and storing business data in the business data sets in the corresponding first data tables.
[0049] In this application, the table name of each data table carries the organization identifier corresponding to the data table and the time interval of the stored data corresponding to the data table. In this application, the first data table corresponding to each business data set is determined by the organization number corresponding to the business data set and the time interval of the target time unit, and the business data in the business data set is stored in the first data table corresponding to it.
[0050] S103, for each business data set, obtaining table-related parameters of the first data table corresponding to the business data set after storage is completed, the table-related parameters including the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table.
[0051] Still taking the business data set corresponding to the Beijing Branch on July 2, 2024 as an example, after all the business data in the business data set is stored in its corresponding first data table, the total number of business data currently stored in the first data table and the time interval corresponding to the first data table are obtained.
[0052] S104, judging whether the conditions for creating a new data table are met according to the table-related parameters corresponding to the first data table, in response to the conditions for creating a new data table being met, determining the time interval of the second data table according to the target time unit, and generating a second data table, the second data table and the first data table corresponding to the same institution identifier.
[0053] In the present application, a preset reference value corresponding to the business data is set for each data table. If the total amount of business data currently stored corresponding to the first data table is greater than the preset reference value, it means that the conditions for creating a new data table are met.
[0054] For example, the preset reference value can be set to 5 million. The preset reference value can be freely set according to actual conditions and does not constitute a limitation to this application.
[0055] In addition, in this application, since the table name of each data table already carries the time interval corresponding to the business data of the data table, if it is monitored that the last time unit of the time interval corresponding to the first data table is the target time unit, it means that the conditions for creating a new data table are met.
[0056] After determining that the conditions for creating a new data table are met, the next time unit of the target time unit is obtained as the starting time unit of the time interval of the second data table. For example, the next time unit of July 2, 2024 is July 3, 2024, and the ending time unit of the time interval of the second data table can be determined in combination with the preset time interval. Then, the time interval of the second data table is determined according to the starting time unit and the ending time unit, and a second data table is generated. The second data table corresponds to the same institution identifier as the first data table that meets the conditions for creating a new data table.
[0057] The embodiment of the present application proposes a method for processing business data, including: obtaining business data of a target time unit, and dividing the business data into multiple business data sets according to the organization identifier carried by the business data; determining the first data table corresponding to each of the multiple business data sets, and storing the business data in the business data set in the first data table corresponding to it; for each business data set, obtaining the table-related parameters of the first data table corresponding to the business data set after storage is completed, and the table-related parameters include the total number of business data currently stored in the first data table and the time interval corresponding to the first data table; judging whether the conditions for creating a new data table are met according to the table-related parameters corresponding to the first data table, in response to meeting the conditions for creating a new data table, determining the time interval of the second data table according to the target time unit, and generating a second data table, the second data table and the first data table correspond to the same organization identifier. In the present application, for users, by subdividing business data according to time and organization identifier and storing them in different data tables, when users query data for a specific time period or a specific branch, they can directly locate the corresponding data table, avoiding full table scanning, greatly shortening the query time, and thus improving user experience. For the system, by distributing and storing data in multiple tables, the amount of data in a single table can be significantly reduced, thereby reducing the amount of data that needs to be processed for each query. The saved computing resources can be used to improve the quality of other services.
[0058] Figure 2 is an exemplary schematic diagram of a method for processing business data shown in this application, such as Figure 2 As shown, the method for processing the business data includes the following steps:
[0059] S201, acquiring business data of a target time unit, and dividing the business data into a plurality of business data sets according to an organization identifier carried in the business data.
[0060] Regarding the specific implementation of step S201, please refer to the specific introduction of the relevant parts in the above embodiment, which will not be repeated here.
[0061] S202: Obtain the table name of the candidate data table stored in the database.
[0062] There are already some candidate data tables in the database, and their table names follow the format of "institution identifier + start time unit TO end time unit". For example, if the table name of a candidate data table is "BJ20240701TO0706", it means that the institution corresponding to this candidate data table is Beijing Branch, and the corresponding time interval is July 1, 2024 to July 6, 2024.
[0063] S203: extracting the corresponding organization identifier and the time interval corresponding to the business data to be stored from the table name of the candidate data table.
[0064] S204, matching the organization identifier corresponding to the business data set with the organization identifier corresponding to the candidate data table from the database, and selecting a first candidate data table that is consistent with the organization identifier corresponding to the business data set.
[0065] Exemplarily, after obtaining the business data set corresponding to the Beijing branch on July 2, 2024, the candidate data tables in the database are traversed according to the table names, and all candidate data tables with table names containing "BJ" are screened as the first candidate data tables corresponding to the Beijing branch.
[0066] S205 , selecting a candidate data table whose time interval can cover the target time unit from the first candidate data table, and determining it as the first data table corresponding to the business data set.
[0067] For example, after obtaining the business data set corresponding to July 2, 2024 of the Beijing Branch as mentioned above, traverse the time interval corresponding to the first candidate data table corresponding to the Beijing Branch, and query to obtain the data table named "BJ20240701TO0706" whose institution identifier is "BJ" and July 2, 2024 is within the time interval from July 1, 2024 to July 6, 2024, then determine that the data table named "BJ20240701TO0706" is the first data table corresponding to the business data set corresponding to the Beijing Branch on July 2, 2024.
[0068] Optionally, in this application, the candidate data table that has completed the storage of all business data in the time interval can be understood as a candidate data table in a completed state, and the candidate data table that has not yet completed the storage of business data in the time interval can be understood as an active state data table. For example, the business data of the Beijing branch on all dates from January 1, 2013 to July 1, 2024 has been stored, and the table name of the first candidate data table corresponding to the Beijing branch in the database is "BJ20130101TO0106" , "BJ20130107TO0112" ... "BJ20240627TO0630", "BJ20240701TO0706", that is, "BJ20130101TO0106", "BJ20130107TO0112" ... "BJ20240627TO0630" are all first candidate data tables in the completed state, and "BJ20240701TO0706" is the first candidate data table in the active state. The first data table corresponding to the business data set can be determined according to whether the data table is active.
[0069] S206: Store the business data in the business data set in its corresponding first data table.
[0070] The first data tables corresponding to the respective business data sets are determined respectively, and the business data in the business data sets are stored in the corresponding first data tables.
[0071] S207 , for each business data set, obtaining table-related parameters of the first data table corresponding to the business data set after storage is completed, the table-related parameters including the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table.
[0072] Still taking the business data set corresponding to Beijing Branch on July 2, 2024 as an example, after all the business data in the business data set are stored in the first data table named "BJ20240701TO0706", the total number of business data currently stored in the first data table named "BJ20240701TO0706" and the time interval corresponding to the first data table are obtained.
[0073] S208: Determine whether a condition for creating a new data table is met according to table-related parameters corresponding to the first data table.
[0074] In the present application, a preset reference value corresponding to the business data is set for each data table. If the total amount of business data currently stored corresponding to the first data table is greater than the preset reference value, it is determined that the conditions for creating a new data table are met.
[0075] For example, the preset reference value can be set to 5 million, and the preset reference value can be freely set according to actual conditions and does not constitute a limitation to this application. The preset reference values corresponding to different branches can be the same or different.
[0076] For example, if all business data in the business data set corresponding to July 2, 2024 of the Beijing Branch are stored in the first data table with the table name "BJ20240701TO0706", the total number of business data currently stored in the first data table with the table name "BJ20240701TO0706" is 6 million, which is greater than the preset reference value of 5 million, which means that the conditions for creating a new data table are met.
[0077] In addition, in this application, since the table name of each data table already carries the time interval corresponding to the business data corresponding to the data table, if the first end time unit of the time interval corresponding to the first data table is monitored as the target time unit, it means that the conditions for creating a new data table are met. Among them, the first end time unit refers to the end time unit of the time interval corresponding to the first data table.
[0078] For example, if all business data in the business data set corresponding to July 2, 2024 of the Beijing Branch are stored in the first data table named "BJ20240701TO0706", the total number of business data currently stored in the first data table named "BJ20240701TO0706" is less than 5 million; and all business data in the business data sets corresponding to July 3, 2024, July 4, 2024, July 5, 2024, and July 6, 2024 of the Beijing Branch are stored in the first data table named "BJ20240701TO0706" each time. 6", it is found that the total number of business data currently stored in the first data table named "BJ20240701TO0706" has always been less than 5 million. After all business data in the business data set corresponding to July 6, 2024 of Beijing Branch are stored in the first data table named "BJ20240701TO0706", since the stored data has reached the end time unit of the first data table (July 6, 2024), it means that after the business data set corresponding to July 6, 2024 of Beijing Branch is stored, the conditions for creating a new data table are met.
[0079] S209, in response to satisfying the conditions for creating a new data table, determining a time interval of a second data table according to the target time unit, and generating a second data table, wherein the second data table corresponds to the same institution identifier as the first data table.
[0080] After determining that the conditions for creating a new data table are met, determine the next time unit of the target time unit; determine the second end time unit of the time interval corresponding to the second data table based on the target time unit and the next time unit; determine the time interval corresponding to the second data table based on the next time unit and the second end time unit. Generate a table name for the second data table based on the organization identifier corresponding to the second data table and the time interval corresponding to the second data table.
[0081] Exemplarily, if all business data in the business data set corresponding to July 2, 2024 of the Beijing Branch are stored in the first data table with the table name "BJ20240701TO0706", the total number of business data currently stored in the first data table with the table name "BJ20240701TO0706" is obtained to be 6 million, which is greater than the preset reference value of 5 million, which means that the conditions for creating a new data table are met, then the next time unit of the target time unit is obtained as the starting time unit of the time interval of the second data table, for example, the next time unit of July 2, 2024 is July 3, 2024, and the end time unit of the time interval of the second data table can be determined to be July 8, 2024 in combination with the preset time interval (for example, set to 5 days), and then the time interval of the second data table is determined according to the start time unit and the end time unit, and a second data table is generated, and the second data table corresponds to the same institution identifier as the first data table that meets the conditions for creating a new data table.
[0082] Exemplary, if the business data set corresponding to July 6, 2024 of the Beijing Branch is stored in the first data table named "BJ20240701TO0706", the first end time unit of the time interval corresponding to the first data table is obtained as July 6, 2024, which means that the conditions for creating a new data table are met, and the next time unit of the target time unit is obtained as the starting time unit of the time interval of the second data table. For example, the next time unit of July 6, 2024 is July 7, 2024, and the end time unit of the time interval of the second data table can be determined to be July 12, 2024 in combination with the preset time interval (for example, set to 5 days), and then the time interval of the second data table is determined according to the start time unit and the end time unit, and a second data table is generated. The second data table corresponds to the same institution identifier as the first data table that meets the conditions for creating a new data table.
[0083] In an embodiment of the present application, by subdividing business data by time and institution identification and storing them in different data tables, users can directly locate the corresponding data table when querying data for a specific time period or a specific branch without scanning the entire database, thereby significantly reducing query time; each data table has a clear time interval and institution identification, which helps to automate the data cleansing and archiving process, and the bank system can effectively manage large amounts of transaction data and ensure rapid retrieval and storage of data, thereby improving overall operational efficiency and service quality.
[0084] Figure 3 is an exemplary schematic diagram of a method for processing business data shown in this application, such as Figure 3 As shown, the method for processing the business data includes the following steps:
[0085] S301, acquiring business data of a target time unit, and dividing the business data into a plurality of business data sets according to an organization identifier carried in the business data.
[0086] S302, determining first data tables corresponding to respective ones of the plurality of business data sets, and storing business data in the business data sets in the corresponding first data tables.
[0087] S303 , for each business data set, obtaining table-related parameters of the first data table corresponding to the business data set after storage is completed, the table-related parameters including the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table.
[0088] S304: In response to the total amount of business data being greater than a preset reference value, it is determined that a condition for creating a new data table is met.
[0089] S305: In response to the first end time unit of the time interval corresponding to the first data table being the target time unit, it is determined that the condition for creating a new data table is met.
[0090] Regarding the specific implementation of steps S301 to S305, reference may be made to the specific introduction of the relevant parts in the above embodiments, which will not be elaborated here.
[0091] S306: In response to satisfying the condition for creating a new data table, determining the next time unit of the target time unit.
[0092] After determining that the conditions for creating a new data table are met, the next time unit of the target time unit is obtained as the starting time unit of the time interval of the second data table. For example, the next time unit of July 2, 2024 is July 3, 2024.
[0093] S307: Determine a second end time unit of the time interval corresponding to the second data table according to the target time unit and the next time unit.
[0094] S308: Determine a time interval corresponding to the second data table according to the next time unit and the second end time unit.
[0095] S309, generating a second data table, and generating a table name of the second data table based on the organization identifier corresponding to the second data table and the time interval corresponding to the second data table, wherein the second data table and the first data table correspond to the same organization identifier.
[0096] As a possible situation, after determining that the conditions for creating a new data table are met, determine whether the target time unit and the next time unit belong to the same month. If the target time unit and the next time unit belong to the same month, determine the last time unit corresponding to the month, and obtain the expected time unit after a preset time interval starting from the next time unit. If the expected time unit is less than the last time unit, determine the expected time unit as the second end time unit of the time interval corresponding to the second data table; if the expected time unit is greater than or equal to the last time unit, determine the last time unit as the second end time unit of the time interval corresponding to the second data table. It is not difficult to understand that in this application, the next time unit is determined as the second start time unit of the time interval corresponding to the second data table.
[0097] For example, if the target time unit is July 2, 2024, after determining that the conditions for creating a new data table are met, the next time unit of the target time unit is obtained as July 3, 2024. It can be determined that the target time unit and the next time unit belong to the same month. At this time, it is necessary to obtain the last time unit corresponding to the month. Since it is July, the last time unit corresponding to the month is July 31, 2024; starting from the next time unit, combined with the preset time interval (for example, set to 5 days), the expected time unit of the time interval of the second data table is determined to be July 8, 2024. Since July 8, 2024 is less than July 31, 2024, the expected time unit is determined as the second end time unit of the time interval corresponding to the second data table, and the time interval corresponding to the generated second data table is July 3, 2024 to July 8, 2024. If it corresponds to the Beijing branch, the table name of the newly generated second data table is "BJ20240703TO0708".
[0098] For example, if the target time unit is July 29, 2024, after determining that the conditions for creating a new data table are met, the next time unit of the target time unit is obtained as July 30, 2024. It can be determined that the target time unit and the next time unit belong to the same month. At this time, it is necessary to obtain the last time unit corresponding to the month. Since it is July, the last time unit corresponding to the month is July 31, 2024; starting from the next time unit, combined with the preset time interval (for example, set to 5 days), the expected time unit of the time interval of the second data table is determined to be August 3, 2024. Since August 3, 2024 is greater than July 31, 2024, the last time unit is determined as the second end time unit of the time interval corresponding to the second data table, and the time interval corresponding to the generated second data table is July 30, 2024 to July 31, 2024. If it corresponds to the Beijing branch, the table name of the newly generated second data table is "BJ20240730TO0731". This is done to ensure that the data stored in the data table does not cross months, which facilitates subsequent monthly and annual summaries.
[0099] As another possible situation, after determining that the conditions for creating a new data table are met, determine whether the target time unit and the next time unit belong to the same month. If the target time unit and the next time unit do not belong to the same month, which means that the target time unit and the next time unit cross months, then directly obtain the expected time unit after a preset time unit interval (the preset time interval is generally set to N days, N is less than the number of days in a month, that is, there is no need to compare with the last time unit of the next month) from the next time unit; determine the expected time unit as the second end time unit of the time interval corresponding to the second data table. It is not difficult to understand that in this application, the next time unit is determined as the second start time unit of the time interval corresponding to the second data table.
[0100] For example, if the target time unit is July 31, 2024, after determining that the conditions for creating a new data table are met, the next time unit of the target time unit is obtained as August 1, 2024. It can be determined that the target time unit and the next time unit do not belong to the same month. The expected time unit of the time interval of the second data table can be determined to be August 6, 2024 in combination with the preset time interval (for example, set to 5 days). The time interval corresponding to the generated second data table is August 1, 2024 to August 6, 2024. If it corresponds to the Beijing branch, the name of the newly generated second data table is "BJ20240801TO0806".
[0101] The embodiment of the present application specifically introduces how to create a new data table when facing a cross-month period, ensuring that the data stored in the data table does not cross months, facilitating the subsequent monthly and annual summaries; similarly, for users, by subdividing business data according to time and organization identification and storing it in different data tables, when users query data for a specific time period or a specific branch, they can directly locate the corresponding data table, avoiding full table scans, greatly shortening the query time, and thus improving the user experience. For the system, by distributing and storing data in multiple tables, the amount of data in a single table can be significantly reduced, thereby reducing the amount of data that needs to be processed each time a query is made, and the saved computing resources can be used to improve the quality of other services; by reasonably dividing the data table, storage resources can be used more efficiently, avoiding the situation where a single table is too large, thereby reducing storage costs.
[0102] Further, if the total amount of business data is greater than a preset reference value, and the end time unit of the time interval corresponding to the first data table is not the target time unit, the time interval corresponding to the first data table is updated based on the target time unit.
[0103] For example, if all business data in the business data set corresponding to July 2, 2024 of the Beijing Branch are stored in the first data table with the table name "BJ20240701TO0706", the total number of business data currently stored in the first data table with the table name "BJ20240701TO0706" is obtained to be 6 million, which is greater than the preset reference value of 5 million, which means that the conditions for creating a new data table are met. July 2, 2024 is not the end time unit of the first data table. At this time, in addition to creating a new second data table, the table name of the first data table needs to be modified to "BJ20240701TO0702" based on the target time unit. In this way, by adjusting the table name to ensure that the table name is consistent with the actual stored data time interval, the accuracy and consistency of the data can be ensured, and users can locate the required data more accurately.
[0104] Furthermore, the candidate data tables corresponding to each institution identifier are monitored; for any institution identifier, in response to monitoring that the business data corresponding to the institution identifier within the target time period have been stored, multiple candidate data tables corresponding to the institution identifier in the target time period are determined from the database according to the table name, and the target time period is each natural month and each natural year; the multiple candidate data tables are aggregated to obtain the aggregate table corresponding to the institution identifier in the target time period, and the aggregate table is stored in the database. In this automated data aggregation process, by limiting the prefix of the data table, the system can locate the data table that needs to be aggregated more quickly, reduce unnecessary data processing, and reduce the need for manual operations, thereby improving work efficiency.
[0105] For example, at the end of the month, by aggregating and adding up the data based on all the data tables starting with BJ202402, the monthly report of Beijing Branch in February 2024 can be obtained, and the monthly report can be named "MONTHBJ202402".
[0106] For example, at the end of the year, by aggregating and adding up the data in all the data tables starting with MONTHBJ2024, the annual report of Beijing Branch in 2024 can be obtained, and the annual report can be named "YEARBJ2024".
[0107] Figure 4 is an exemplary schematic diagram of a method for processing business data shown in this application, such as Figure 4 As shown, the method for processing the business data includes the following steps:
[0108] S401, acquiring business data of a target time unit, and dividing the business data into a plurality of business data sets according to an organization identifier carried in the business data.
[0109] S402, determining first data tables corresponding to respective ones of the plurality of business data sets, and storing business data in the business data sets in the corresponding first data tables.
[0110] S403, for each business data set, obtaining table-related parameters of the first data table corresponding to the business data set after storage is completed, the table-related parameters including the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table.
[0111] S404, judging whether the conditions for creating a new data table are met according to the table-related parameters corresponding to the first data table, in response to the conditions for creating a new data table being met, determining the time interval of the second data table according to the target time unit, and generating a second data table, the second data table and the first data table corresponding to the same institution identifier.
[0112] Regarding the specific implementation of steps S401 to S404, reference may be made to the specific introduction of the relevant parts in the above embodiments, which will not be elaborated here.
[0113] S405: Receive a business data query request sent by the client.
[0114] S406, parsing the business data query request to obtain the account identifier, target institution identifier and target time interval carried in the business data query request.
[0115] S407, determining a target data table from a database according to the target organization identifier and the target time interval.
[0116] For example, if the user is determined to be a user of the Beijing branch based on the target institution identifier, and the target time interval to be queried is the entire month of February 2024, the target data table "MONTHBJ202402" can be directly located.
[0117] For example, if the user is determined to be a user of the Beijing branch based on the target institution identifier, and the target time interval to be queried is July 2, 2024, the target data table "BJ20240701TO0702" can be directly located.
[0118] It is not difficult to understand that if the target time interval to be queried by the user is multiple consecutive dates, and the data of the multiple consecutive dates involve multiple candidate data tables in the database, then the target data table can be determined to be the multiple candidate data tables in the database involved.
[0119] S408, query the business data stored in the target data table, obtain the target business data corresponding to the account identifier, and return the target business data to the client.
[0120] The embodiment of the present application uses predefined data table naming rules and storage logic to quickly locate required business data when a user performs a query, thereby greatly improving query efficiency, enhancing user experience, and reducing system pressure.
[0121] Figure 5 is a schematic diagram of a business data processing device shown in the present application, such as Figure 5 As shown, the service data processing device 500 includes a division module 501, a storage module 502, an acquisition module 503 and a creation module 504, wherein:
[0122] The division module 501 is used to obtain the business data of the target time unit and divide the business data into multiple business data sets according to the organization identification carried in the business data.
[0123] The storage module 502 is used to determine the first data table corresponding to each of the plurality of business data sets, and store the business data in the business data set in the corresponding first data table.
[0124] The acquisition module 503 is used to acquire table-related parameters of the first data table corresponding to each business data set after storage, wherein the table-related parameters include the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table.
[0125] A new creation module 504 is used to determine whether the conditions for creating a new data table are met based on the table-related parameters corresponding to the first data table. In response to the conditions for creating a new data table being met, the time interval of the second data table is determined based on the target time unit, and a second data table is generated. The second data table corresponds to the same institution identifier as the first data table.
[0126] The business data processing device proposed in this application can directly locate the corresponding data table when the user queries the data of a specific time period or a specific branch by segmenting the business data according to time and organization identification and storing it in different data tables, thus avoiding full table scanning and greatly shortening the query time, thereby improving the user experience. For the system, by distributing and storing data in multiple tables, the amount of data in a single table can be significantly reduced, thereby reducing the amount of data that needs to be processed each time a query is made, and the saved computing resources can be used to improve the quality of other services.
[0127] Furthermore, the storage module 502 is also used to: obtain the table name of the candidate data table stored in the database; extract the corresponding organization identifier and the time interval corresponding to the business data to be stored from the table name of the candidate data table; match the organization identifier corresponding to the business data set with the organization identifier corresponding to the candidate data table from the database, and screen the first candidate data table that is consistent with the organization identifier corresponding to the business data set; from the first candidate data table, select the candidate data table whose time interval can cover the target time unit, and determine it as the first data table corresponding to the business data set.
[0128] Furthermore, the new creation module 504 is also used to: in response to the total amount of business data being greater than a preset reference value, determine that the conditions for creating a new data table are met; and / or, in response to the first end time unit of the time interval corresponding to the first data table being the target time unit, determine that the conditions for creating a new data table are met.
[0129] Furthermore, the newly created module 504 is also used to: determine the next time unit of the target time unit; determine the second end time unit of the time interval corresponding to the second data table based on the target time unit and the next time unit; determine the time interval corresponding to the second data table based on the next time unit and the second end time unit.
[0130] Furthermore, the newly created module 504 is also used to: determine whether the target time unit and the next time unit belong to the same month; in response to the target time unit and the next time unit belonging to the same month, determine the last time unit corresponding to the month, and obtain the expected time unit after a preset time interval starting from the next time unit; in response to the expected time unit being less than the last time unit, determine the expected time unit as the second end time unit of the time interval corresponding to the second data table.
[0131] Furthermore, the new creation module 504 is further configured to: in response to the expected time unit being greater than or equal to the last time unit, determine the last time unit as the second end time unit of the time interval corresponding to the second data table.
[0132] Furthermore, the newly created module 504 is also used to: in response to the target time unit and the next time unit not belonging to the same month, obtain the expected time unit after a preset time unit interval starting from the next time unit; determine the expected time unit as the second end time unit of the time interval corresponding to the second data table.
[0133] Furthermore, the new creation module 504 is further used to generate a table name of the second data table based on the organization identifier corresponding to the second data table and the time interval corresponding to the second data table.
[0134] Furthermore, the new module 504 is also used to: in response to the total amount of business data being greater than a preset reference value and the end time unit of the time interval corresponding to the first data table being not a target time unit, update the time interval corresponding to the first data table based on the target time unit.
[0135] Furthermore, the business data processing device 500 also includes a summary module, which is used to: monitor the candidate data tables corresponding to each organization identifier; for any organization identifier, in response to monitoring that the business data corresponding to the organization identifier within the target time period have been stored, determine multiple candidate data tables corresponding to the organization identifier in the target time period from the database according to the table name, the target time period is each natural month and each natural year; summarize the multiple candidate data tables to obtain a summary table corresponding to the organization identifier in the target time period, and store the summary table in the database.
[0136] Furthermore, the business data processing device 500 also includes a query module, which is used to: receive a business data query request sent by a client; parse the business data query request to obtain the account identifier, target organization identifier and target time interval carried in the business data query request; determine the target data table from the database according to the target organization identifier and the target time interval; query the business data stored in the target data table to obtain the target business data corresponding to the account identifier, and return the target business data to the client.
[0137] In order to implement the above embodiment, the present application embodiment further proposes an electronic device 600, such as Figure 6 As shown, the electronic device 600 includes: a processor 601 and a memory 602 communicatively connected to the processor, the memory 602 stores instructions executable by at least one processor, and the instructions are executed by at least one processor 601 to implement the business data processing method shown in the above embodiment.
[0138] In order to implement the above embodiments, the embodiments of the present application also propose a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to implement the business data processing method shown in the above embodiments.
[0139] In order to implement the above embodiments, the embodiments of the present application further provide a computer program product, including a computer program, which implements the business data processing method shown in the above embodiments when executed by a processor.
[0140] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0141] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0142] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0143] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they 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.
[0144] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for processing business data, characterized in that: include: Acquire business data of a target time unit, and divide the business data into multiple business data sets according to an organization identifier carried by the business data; Determine a first data table corresponding to each of the plurality of business data sets, and store the business data in the business data sets in the first data table corresponding to the first data table; For each of the business data sets, obtaining table-related parameters of the first data table corresponding to the business data set after storage is completed, wherein the table-related parameters include the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table; Whether the conditions for creating a new data table are met is determined based on the table-related parameters corresponding to the first data table. In response to the conditions for creating a new data table being met, a time interval for a second data table is determined based on the target time unit, and the second data table is generated. The second data table corresponds to the same institution identifier as the first data table.
2. The method according to claim 1, characterized in that The determining of the first data table corresponding to each of the plurality of business data sets includes: Get the table name of the candidate data table stored in the database; Extracting the corresponding organization identifier and the time interval corresponding to the business data to be stored from the table name of the candidate data table; From the database, matching the organization identifier corresponding to the business data set with the organization identifier corresponding to the candidate data table, and selecting a first candidate data table that is consistent with the organization identifier corresponding to the business data set; From the first candidate data table, a candidate data table whose time interval can cover the target time unit is selected and determined as the first data table corresponding to the business data set.
3. The method according to claim 2, characterized in that The determining whether a condition for creating a new data table is met according to the table-related parameters corresponding to the first data table includes: In response to the total amount of business data being greater than a preset reference value, determining that a condition for creating a new data table is met; and / or, In response to the first end time unit of the time interval corresponding to the first data table being the target time unit, it is determined that the condition for creating a new data table is met.
4. The method according to claim 3, characterized in that The determining the time interval of the second data table according to the target time unit includes: Determining a next time unit of the target time unit; Determine, according to the target time unit and the next time unit, a second end time unit of the time interval corresponding to the second data table; A time interval corresponding to the second data table is determined according to the next time unit and the second end time unit.
5. The method according to claim 4, characterized in that The determining, according to the target time unit and the next time unit, a second end time unit of the time interval corresponding to the second data table includes: Determining whether the target time unit and the next time unit belong to the same month; In response to the target time unit and the next time unit belonging to the same month, determining the last time unit corresponding to the month, and obtaining the expected time unit after a preset time interval from the next time unit; In response to the expected time unit being smaller than the last time unit, the expected time unit is determined as a second end time unit of the time interval corresponding to the second data table.
6. The method according to claim 5, characterized in that The method further comprises: In response to the expected time unit being greater than or equal to the last time unit, the last time unit is determined as a second end time unit of the time interval corresponding to the second data table.
7. The method according to claim 5, characterized in that The method further comprises: In response to the target time unit and the next time unit not belonging to the same month, obtaining a desired time unit after a preset time unit interval from the next time unit; The expected time unit is determined as a second end time unit of the time interval corresponding to the second data table.
8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: A table name of the second data table is generated based on the organization identifier corresponding to the second data table and the time interval corresponding to the second data table.
9. The method according to claim 8, characterized in that The method further comprises: In response to the total amount of business data being greater than the preset reference value and the end time unit of the time interval corresponding to the first data table is not the target time unit, the time interval corresponding to the first data table is updated based on the target time unit.
10. The method according to claim 9, characterized in that The method further comprises: Monitor the candidate data table corresponding to each institution identifier; For any of the organization identifiers, in response to monitoring that the business data corresponding to the organization identifier within a target time period have been stored, multiple candidate data tables corresponding to the organization identifier within the target time period are determined from the database according to the table name, and the target time period is each natural month and each natural year; The multiple candidate data tables are summarized to obtain a summary table corresponding to the institution identification in the target time period, and the summary table is stored in the database.
11. The method according to claim 10, characterized in that The method further comprises: Receive business data query requests sent by clients; Parsing the business data query request to obtain the account identifier, target institution identifier, and target time interval carried in the business data query request; Determine a target data table from a database according to the target organization identifier and the target time interval; The business data stored in the target data table is queried to obtain the target business data corresponding to the account identifier, and the target business data is returned to the client.
12. A device for processing business data, characterized in that: include: A division module, used for acquiring the business data of a target time unit, and dividing the business data into a plurality of business data sets according to the organization identifier carried by the business data; A storage module, used for determining the first data table corresponding to each of the plurality of business data sets, and storing the business data in the business data set in the first data table corresponding to the first data table; an acquisition module, configured to acquire, for each of the business data sets, table-related parameters of the first data table corresponding to the business data set after storage is completed, wherein the table-related parameters include the total amount of business data currently stored in the first data table and the time interval corresponding to the first data table; A new creation module is used to determine whether the conditions for creating a new data table are met based on the table-related parameters corresponding to the first data table. In response to meeting the conditions for creating a new data table, the time interval of the second data table is determined based on the target time unit, and the second data table is generated. The second data table corresponds to the same institution identifier as the first data table.
13. An electronic device comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-11.
15. A computer program product comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11.
