Business data processing method, device, server and storage medium
By sub-table the acquisition business data based on transaction dates and business scenarios, combined with the design of online databases and query databases, the problem of unreasonable data storage in the existing technology is solved, and the uniform data volume and processing efficiency are improved.
Patent Information
- Application Number
- CN202011474861.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-14
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-12-14
AI Technical Summary
In the prior art, the database and table division method of the collection business data is single, and it cannot adapt to the characteristics of many business scenarios, many types of access merchants, and many transaction types, resulting in unreasonable data storage and the separation of real-time data and historical data cannot be achieved. and data is isolated storage of real-time transactions and queries.
By subtitling business data based on transaction dates, real-time data is stored in daily cut data tables, historical data is stored in historical data tables, and data is subtitled according to business scenarios and organization numbers, online databases and queries are set up Database, realizes the separation of data read and write.
It realizes the uniform distribution of data volume, separates real-time data from historical data, improves the storage rationality and processing efficiency of data, adapts to changes in business scenarios and transaction volume, and supports rapid expansion of databases.
Smart Images

Figure CN112634012B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data analysis technology, and in particular, to a business data processing method, device, server and storage medium. Background Art
[0002] Acquiring business refers to the financial business in which the bank pays the merchant the final amount after deducting a certain percentage of the handling fee from the transaction amount after the cardholder consumes at the merchant contracted by the bank through card swiping, gateway jump, application jump, H5 page jump, code scanning, contactless payment and other scenarios. Acquiring business is usually accompanied by the generation of business data (usually transaction flow), which is the basis for subsequent processing of other business data, so it needs to be stored and managed.
[0003] In the prior art, although some methods of sub-library and table division for business data are provided, business data is stored in sub-library and table divisions according to certain business characteristics, such as transaction type. However, the sub-library and table division method is single and therefore cannot adapt to the payment collection business data with characteristics of multiple business scenarios, multiple types of connected merchants, and multiple transaction types.
[0004] Therefore, how to store the business data generated in the process of acquiring business has become a problem that needs to be solved urgently in the existing technology. Summary of the invention
[0005] The embodiments of the present application provide a business data processing method, device, server and storage medium, which realize the sub-library and sub-table storage of business data generated in the process of acquiring business.
[0006] In a first aspect, an embodiment of the present application provides a business data processing method, including:
[0007] Obtain multiple business data, each of which includes order number, transaction date, institution number and transaction scenario code;
[0008] Determine, according to the order number, the transaction date, the institution number and the transaction scenario code, a first name of an online library data table storing each business data;
[0009] The plurality of business data are stored according to the first name.
[0010] Optionally, determining the first name of the online library data table storing each business data according to the order number, the transaction date, the institution number and the transaction scenario code includes:
[0011] Based on the organization number, according to pre-stored organization configuration information, determine the number of tables and organization sequence numbers corresponding to the organization number;
[0012] Determine a discrete value of the order number according to the order number and the number of tables;
[0013] Determine, according to the transaction date, a type code of an online library data table storing the business data;
[0014] According to the naming rules of the online library data table, the institution serial number, the discrete value, the type code, and the transaction scenario code are concatenated to obtain the first name.
[0015] Optionally, determining the type code of the online library data table storing the business data according to the transaction date includes:
[0016] Determine whether the transaction date is consistent with today's date;
[0017] If the transaction date is consistent with the current date, determining that the type of the online database data table storing the business data is a daily-cutting data table;
[0018] If the transaction date is inconsistent with the current date, determining that the type of the online database data table storing the business data is a historical data table;
[0019] Based on the determined type of the online library data table, the type code of the online library data table storing the business data is determined according to the pre-stored correspondence between the type of the online library data table and the type code.
[0020] Optionally, the daily cut data table includes a first sub-category daily cut data table and a second sub-category daily cut data table. After determining that the type of the online library data table storing the business data is a daily cut data table, the method further includes:
[0021] Determining the parity of the number of days between the transaction date and the initial date;
[0022] According to the parity of the interval of days, the subtype of the daily cut data table to which the online library data table storing the business data belongs is determined.
[0023] Optionally, the historical data table includes multiple types of historical data partition tables. After determining that the type of the online library data table storing the business data is a historical data table, the method further includes:
[0024] Determining the time zone to which the transaction date belongs;
[0025] According to the time partition, the subtype of the historical data table to which the online library data table storing the business data belongs is determined.
[0026] Optionally, storing the plurality of business data according to the first name includes:
[0027] If it is determined according to the first name that the online library data table storing the business data is a daily cut data table, the business data is stored in the online library data table corresponding to the first name in the online database;
[0028] If it is determined based on the first name that the online library data table storing the business data is a historical data table, then according to the naming rule of the query library data table, the first name is converted into a second name, and the business data is stored in the online library data table corresponding to the first name in the online database and in the query library data table corresponding to the second name in the query database.
[0029] Optionally, storing the business data in an online database data table corresponding to the first name includes:
[0030] Determine the name of the online database storing the business data according to the pre-stored correspondence between the name of the online database and the name of the online library data table;
[0031] The plurality of business data are stored according to the name of the online database and the first name.
[0032] Optionally, storing the business data in a query database data table corresponding to the second name includes:
[0033] Determine the name of the query database storing the business data according to the pre-stored correspondence between the query database name and the query database data table name;
[0034] The plurality of business data are stored according to the name of the query database and the second name.
[0035] Optionally, the method further comprises:
[0036] Receive a processing request for target business data, wherein the processing request includes an order number, a transaction date, an institution number, and a transaction scenario code of the target business data;
[0037] Determine the name of the target online library data table storing the target business data according to the order number, transaction date, institution number and transaction scenario code of the target business data;
[0038] The target business data is processed according to the name of the target online library data table.
[0039] Optionally, the processing request also includes a processing method for the target business data, and the processing method is one of adding, deleting, modifying or querying. Before processing the target business data according to the name of the target online library data table, the method also includes:
[0040] According to the processing method, determining the transaction type of the transaction terminal, the transaction type being an account transaction or an inquiry transaction;
[0041] Accordingly, the processing of the target business data according to the name of the target online library data table includes:
[0042] If it is determined that the transaction type is an accounting transaction, then based on the name of the target online database data table and the pre-stored correspondence between the online database name and the online database data table name, the name of the target online database storing the target business data is determined;
[0043] According to the name of the target online database and the name of the target online library data table, jump to the target online library data table of the target online database to process the target business data.
[0044] Optionally, the method further comprises:
[0045] If it is determined that the transaction type is a query transaction, the name of the target online library data table is converted into the name of the target query library data table according to the naming rule of the query library data table;
[0046] Based on the name of the target query database data table, and according to the pre-stored correspondence between the query database name and the query database data table name, determine the name of the target query database storing the target business data;
[0047] According to the name of the target query database and the name of the target query database data table, jump to the target query database data table to process the target business data.
[0048] In a second aspect, an embodiment of the present application provides a business data processing device, including:
[0049] The acquisition module is used to acquire multiple business data, each of which includes order number, transaction date, institution number and transaction scenario code;
[0050] A processing module is used to determine the first name of the online library data table storing each business data according to the order number, the transaction date, the institution number and the transaction scenario code; and store the multiple business data according to the first name.
[0051] In a third aspect, an embodiment of the present application provides a server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the business data processing method as described in the first aspect above is implemented.
[0052] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the business data processing method as described in the first aspect above.
[0053] The business data processing method, device, server and storage medium provided in the embodiments of the present application obtain multiple business data, including order number, transaction date, institution number and transaction scenario code, determine the first name of the online library data table storing each business data according to the order number, transaction date, institution number and transaction scenario code, store each business data according to the first name, realize the storage of business data in separate libraries and tables, improve the rationality and orderliness of business data storage, and thus improve the efficiency of adding, deleting, modifying and checking data in the business processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of an application scenario of an embodiment of the present application;
[0055] Figure 2 A flowchart of a business data processing method provided in Example 1 of the present application;
[0056] Figure 3 This is a flowchart of a specific implementation of S102 in Example 1 of the present application;
[0057] Figure 4 A schematic diagram of the structure of the acquiring business database provided in Example 1 of the present application;
[0058] Figure 5 A flowchart of a business data processing method provided in Embodiment 2 of the present application;
[0059] Figure 6 A schematic diagram of the structure of a business data processing device provided in Embodiment 3 of the present application;
[0060] Figure 7 A schematic diagram of the structure of a server provided in Example 4 of the present application. DETAILED DESCRIPTION
[0061] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0062] The inventors of this application have found in their previous research that the existing technology of sub-library and sub-table mainly has the following technical problems:
[0063] (1) There are too many databases and the data volume is unevenly distributed;
[0064] (2) It is impossible to separate real-time data from historical data;
[0065] (3) It is impossible to separate and store real-time transaction data and query data;
[0066] (4) It does not conform to the characteristics of bank acquiring transaction flow.
[0067] The main idea of the technical solution of the present application: Based on the above technical problems, the embodiment of the present application provides a technical solution for processing business data, which makes full use of the common characteristics of bank acquiring transactions such as transaction scenarios, branch institutions, transaction dates, order numbers, etc. On the one hand, when storing business data, it is divided into tables based on transaction dates, so that real-time business data are stored in daily data tables, and historical business data are stored in historical data tables, thereby realizing the separation of real-time data and historical data. On the other hand, when storing business data, it is divided into tables based on business scenarios and institution numbers, so that the same business scenarios, the same institution numbers and the same order numbers can be used together. Real-time business data with the same discrete value are stored in the same daily data table, so that historical business data with the same business scenario, the same organization number and the same discrete value are stored in the same historical data table, ensuring the relative uniformity of the data volume in each data table. Thirdly, through the equipment online database and query database, and setting up an online database to specifically store the business data required for accounting transactions, and setting up a query database to specifically store the business data required for query transactions, the read-write separation of data is achieved. Based on these three improvements, the storage of business data is more reasonable, and the processing efficiency of subsequent operations such as adding, deleting, modifying and querying business data is improved. In addition, the technical solution provided by the embodiment of the present application can also quickly expand the database according to changes in business scenarios and transaction volumes without affecting the original data division.
[0068] For example, Figure 1 Schematic diagram of application scenarios of the embodiments of the present application, such as Figure 1As shown, the acquiring business system includes: a server and a transaction terminal, wherein the transaction terminal can be a point of sales (POS) machine, an automated teller machine (ATM) and various smart terminals supporting third-party payment, such as mobile phones, computers, etc. The transaction terminal is connected to the server for communication to generate transaction data and send the generated transaction data to the server. The server processes and stores the received transaction data, and according to the relevant request of the transaction terminal, loads the data requested by the transaction terminal, and according to the request of the transaction terminal, performs operations such as querying, adding, deleting, and modifying the business data.
[0069] Embodiment 1
[0070] Figure 2 The flowchart of the business data processing method provided in the first embodiment of the present application is as follows. The method of this embodiment can be executed by the business data processing device provided in the embodiment of the present application. The device can be implemented by software and / or hardware and can be integrated into Figure 1 As shown in the server. Figure 2 As shown, the service data processing method of this embodiment includes:
[0071] S101. Acquire multiple business data.
[0072] In this step, the server obtains the business data generated by the acquiring business from the transaction terminal, and the business data includes the order number, transaction date, institution number and transaction scenario code.
[0073] Among them, the order number is a transaction serial number randomly generated during the transaction process.
[0074] Transaction date refers to the date when the transaction is established.
[0075] The institution number refers to the institution number of the branch institution to which the merchant with which the transaction occurs belongs. The institution number is used to distinguish different branch institutions, and each branch institution has a unique institution number;
[0076] The transaction scenario code is a mark or symbol used to refer to different transaction scenarios. Each transaction scenario code corresponds to a specific transaction scenario. After the category of the transaction scenario is determined, a unique mark can be assigned to each transaction scenario as the transaction scenario code corresponding to the transaction scenario.
[0077] Optionally, in this embodiment, the transaction scenarios are divided into three categories: quick payment (payment transaction initiated by a third-party payment institution binding a bank card through China UnionPay or China National Payment Corporation), domestic bank payment (acquiring transaction initiated by the bank's domestic merchants) and overseas bank payment (acquiring transaction initiated by the bank's overseas merchants), and X, Y and Z are used as transaction scenario codes for these three types of transaction scenarios, respectively.
[0078] It is understandable that, in addition to the order number, transaction date, institution number and transaction scenario code, the business data may also include information such as merchant number, transaction type, transaction finance, etc. For example, the format of the business data is shown in Table 1. As can be seen from Table 1, each piece of business data is composed of data such as transaction date, transaction scenario code, institution number and order number.
[0079] Table 1
[0080] Transaction scenario code Institution Number Order Number Transaction Date …… X 11000457 d00001 20200824 …… X 44012789 a00001 20200731 …… X 11010263 d00002 20200530 …… Z 33033662 b00001 20200512 …… Y 44011580 a00002 20200615 ……
[0081] S102. Determine the first name of the online library data table storing each business data according to the order number, transaction date, institution number and transaction scenario code.
[0082] In this step, for each piece of business data, the name of the online library data table storing it (i.e., the first name) is determined according to its order number, transaction date, institution number, and transaction scenario code. The online library data table refers to a data table stored in the online library, and the first name refers to the name of the online library data table storing the business data. The first names storing multiple pieces of business data may be the same or different.
[0083] It should be noted that, in order to achieve the separation of reading and writing in the subsequent processing of business data, the database is divided into an online database and a query database in this embodiment, wherein the online database is used in accounting transactions, such as adding, deleting, modifying and writing operations on certain business data, and the query database is used in query transactions, such as query operations on certain business data. For the convenience of distinction, in this embodiment, the data table stored in the online database is called the online library data table, and the data table stored in the query library is called the query library data table.
[0084] For example, Figure 3 This is a flow chart of a specific implementation of S102 in Example 1 of the present application, such as Figure 3 As shown, in this embodiment, S102 may include:
[0085] S1021. Based on the organization number and according to pre-stored organization configuration information, determine the number of tables and organization sequence number corresponding to the organization number.
[0086] In this step, the server pre-stores the organization configuration information, which includes the correspondence between the organization number and the organization serial number and the organization number and the number of tables. Therefore, for each determined organization number, the organization serial number and the number of tables corresponding to the organization number can be determined by searching the organization configuration information.
[0087] Since different branches serve different numbers of merchants, in order to make the amount of data in each data table relatively uniform, in this embodiment, by configuring an institution number for each branch, a branch with a large number of merchants has a separate institution number, while multiple branches with less merchant data share one institution number. When the institution number is used as the basis for dividing the business data into tables, each institution number corresponds to a type of table. The business data of a branch with a large number of merchant data can be in an independent table, while the business data of multiple branches with less merchant data can be merged into one type of data table, thereby ensuring uniform distribution of data in each type of data table.
[0088] In addition, since the transaction volumes of different branch institutions are also different, in the embodiment, different numbers of data tables (i.e., the number of tables) are configured for different branch institutions so that the amount of data in each data table is relatively average, and the number of tables configured for each branch institution is proportional to the transaction volume of the branch institution.
[0089] Furthermore, in this embodiment, the organization configuration information is generated according to the correspondence between the organization number and the organization serial number of each branch organization and the correspondence between the organization number and the number of tables, and is stored in the cache.
[0090] Optionally, the organization configuration information may be stored in the cache in the form of a data list. Exemplarily, the format of the data list of the organization configuration information may be as shown in Table 2.
[0091] Table 2
[0092] Institution Number Institution No. Number of tables …… 11000457 110 5 …… 44012789 440 2 …… 11010263 110 1 …… 33033662 330 3 …… 44011580 440 6 ……
[0093] S1022. Determine a discrete value of the order number according to the order number and the number of tables.
[0094] In this step, the business data can also be stored in separate tables through discretization. Specifically, a hash algorithm can be used to calculate the hash value (hashValue) of the order number of each business data, and then a modulus operation can be used to solve the remainder of the hash value, that is, hashValue mod N (N is the number of tables corresponding to the organization number of the business data) to obtain the discrete value of the order number.
[0095] Since the number of tables N can be configured according to actual conditions, when the database needs to be expanded (i.e., a new data table is added), the original business data can be discretized according to the new number of tables N′, thereby allocating the business data to different data tables.
[0096] Exemplarily, the discrete values corresponding to each order number are shown in Table 3.
[0097] Table 3
[0098] Order Number Hash value Number of tables Discrete Values d00001 1 5 001 a00001 1 2 001 d00002 2 3 002 b00001 1 3 001 a00002 2 6 002
[0099] S1023. Determine the type code of the online library data table storing the business data according to the transaction date.
[0100] In this step, in order to realize the separate storage of real-time data and historical data, in this implementation, the type of the online library data table storing each business data is obtained based on the transaction date, and then the type code of the online library data table storing each business data is determined according to the correspondence between the type of pre-stored online library data and the type code.
[0101] It should be noted that since the online database has high real-time requirements for business data, all real-time (such as the day's) business data and historical (such as non-day's) business data are included in the online database. Also, because the frequency of use of real-time business data is quite high, the frequency of use of historical business data may be higher. Therefore, in the embodiment, the online library data tables are divided into two categories: daily data tables and historical data tables. Among them, the daily data tables are used to store real-time business data, and the historical data tables are used to store historical business data.
[0102] In addition, in this embodiment, by setting the daily data table, the business data in the daily data table is automatically migrated to the historical data table at 24:00 every day. Specifically, it can be achieved through database partition exchange technology.
[0103] In a possible implementation, in this step, the transaction date of each business data is first obtained respectively, and it is determined whether the transaction date is consistent with the current date. If the transaction date is consistent with the current date (the Tth day), the type of the online library data table storing the business data is determined to be a daily data table; if the transaction date is inconsistent with the current date (the Tth day), the type of the online library data table storing the business data is determined to be a historical data table.
[0104] Exemplarily, in this implementation, the type code of the daily data table is A / B, the type code of the historical data table is C, and the correspondence between the type of the online library data table and the type code is stored in the cache. After the type of the online library data table is determined, the type code of the online data table can be determined by querying the correspondence between the type of the online library data table and the type code stored in the cache.
[0105] It can be understood that since the data in the daily data table will be automatically migrated to the historical data table on the T+1 day, and the newly generated business data on the T+1 day needs to be stored in the daily data table, in order to avoid conflicts between the storage of business data in the daily data and the migration of business data, in this embodiment, the daily data table is divided into a first sub-category daily data table and a second sub-category daily data table. After determining that the type of the online library data table storing the business data is the daily data table, further, according to the parity of the number of days between the transaction date and the initial date (that is, whether the number of days is divisible by 2), the subtype of the daily data table is determined as the type of the online library data table storing the business data.
[0106] The initial date is a date selected in advance by the server. Once selected, it will not change.
[0107] Optionally, the first subcategory daily data table is used to store business data whose transaction date is consistent with the current date and the number of days between the transaction date and the initial date is an even number, and the second subcategory daily data table is used to store business data whose transaction date is consistent with the current date and the number of days between the transaction date and the initial date is an odd number.
[0108] Optionally, the second subcategory daily data table is used to store business data whose transaction date is consistent with the current date and the number of days between the transaction date and the initial date is an even number, and the first subcategory daily data table is used to store business data whose transaction date is consistent with the current date and the number of days between the transaction date and the initial date is an odd number.
[0109] Correspondingly, the type codes of the first subcategory daily cutting data table and the second subcategory daily cutting data are also different. For example, the type code of the first subcategory daily cutting data table is A, and the type code of the second subcategory daily cutting data table is B.
[0110] It can be understood that in this embodiment, since the amount of historical business data is usually large, in order to improve the data loading speed when the business data in the historical data table is used subsequently, in this embodiment, the historical data table is divided according to the time partition to which the transaction time of each historical business data belongs, and multiple historical data partition tables are obtained. Each historical data partition table is a type of historical data table, represented by different type codes, wherein the time partition can be configured according to actual conditions. For example, if every six months is used as a time partition, there can be two historical data partition tables each year, and their type can be expressed as the Nth (1 or 2) partition table of historical data in a certain year. If a year is used as a time partition, there is a historical data partition table corresponding to each year, and its type can be expressed as the historical data partition table of a certain year.
[0111] Exemplarily, the type code of the historical data partition table is obtained by concatenating the type code of the historical data table with the year, etc. Exemplarily, if each year is used as a time partition, C_2020 can be used to represent the 2020 historical data partition table, and C_2019 can be used to represent the 2019 historical data partition table, etc.; if each half year is used as a time partition, C_2020_1 can be used to represent the first partition table of historical data in 2020, and C_2020_2 can represent the second partition table of historical data in 2020, and so on.
[0112] Specifically, when determining that the type of the online library data table is a historical data table, further, according to the time partition (such as year) to which the transaction date belongs, determine the subtype of the historical data table as the type of the online library data table storing the business data.
[0113] Correspondingly, in the correspondence between the type of the online library data table and the type code, the type of the online library data table is the various subtypes of the daily data table and the various subtypes of the historical data table, and the type code of the online library data table is the type code corresponding to the various subtypes of the daily data table and the type code corresponding to the various subtypes of the historical data table. Optionally, the correspondence between the type of the online library data table and the type code can be stored in the cache in the form of a data list. Exemplarily, the format of the data list storing the correspondence between the type of the online library data table and the type code is shown in Table 4. It is not difficult to see that after determining the type of the online library data storing each business data, the type code of the online library data table storing each business data can be determined according to the correspondence between the type of each online library data table and the type code.
[0114] Table 4
[0115] Types of online library tables Type code of the online library data table First sub-category daily cutting data table A Second sub-category daily cutting data table B The first partition table of historical data in 2020 C_2020_1 Second partition table of historical data in 2020 C_2020_2 The first partition table of historical data in 2019 C_2019_1 Second partition table of historical data in 2019 C_2019_2
[0116] S1024. According to the naming rules of the online library data table, the institution serial number, discrete value, type code, and transaction scenario code are concatenated to obtain a first name.
[0117] In this step, according to the naming rules of the online library data table, the institution serial number, discrete value and type code obtained in the above steps and the transaction scenario code in the business data are spliced to obtain the first name of the online library data table storing each business data.
[0118] Among them, the naming rules of the online library data table are the naming rules of all online library data tables in the online library, that is, the order of the organization serial number, discrete value, type code and transaction scenario code, which are pre-configured. It is not difficult to see that the difference in the names of different online library data tables lies in the difference in the data values of the organization serial number, discrete value, type code and / or transaction scenario code.
[0119] Optionally, using "transaction scenario code_type code_institution serial number_discrete value" as the naming rule, the institution serial number, discrete value, type code and transaction scenario code of each business data are concatenated to obtain the name of the online library data table storing the various business data.
[0120] Assuming that the initial date is 20200701 and the current date is 20200824, the first type of daily cut data table is used to store business data whose transaction date is the same as the current date and the number of days between the transaction date and the initial date is an even number. Every half year is used as a time partition. By way of example, the names of the online library data tables corresponding to the business data in Table 1 obtained according to the above method are shown in Table 5.
[0121] Table 5
[0122] Serial number Scenario Code Institution Number Order Number Transaction Date First name confirmed 1 X 11000457 d00001 20200824 X_A_110_001 2 X 44012789 a00001 20200731 X_C_2020_2_440_001 3 X 11010263 d00002 20200530 X_C_2020_1_110_002 4 Z 33033662 b00001 20200512 X_C_2020_1_330_001 5 Y 44011580 a00002 20200615 X_C_2020_1_440_001
[0123] S103: Store multiple business data according to the first name.
[0124] In this step, each business data is stored separately according to each first name of the online library data table storing each business data determined in S102, so as to realize the storage of business data in separate libraries and tables. By storing business data in separate tables based on transaction date, business data (real-time data) generated on the same day are stored in the daily data table, and business data (historical data) not generated on the same day are stored in the historical data table, so as to realize the separation of real-time data and historical data. In addition, business data is stored in separate tables based on business scenario and institution number, so that real-time business data with the same business scenario, the same institution serial number and the same discrete value are stored in the same daily data table, and historical business data with the same business scenario, the same institution serial number and the same discrete value are stored in the same historical data table, so as to ensure the relative uniformity of business data in each online library data table.
[0125] In this embodiment, since the query database is used in query transactions, it only performs read operations on business data and does not involve write operations on business data, that is, the query database does not have high requirements for the real-time performance of data. Therefore, the query database can only include historical data tables. In order to facilitate the distinction between historical data tables in the query library and historical data tables in the online library, in this embodiment, Q is used as the type code for historical data tables in the query library.
[0126] Correspondingly, in this step, if it is determined according to the first name that the online library data table storing certain business data is a daily data table, the business data is stored in the online library data table corresponding to the first name in the online library; if it is determined according to the first name that the online library data table storing certain business data is a historical data table, then according to the naming rule of the query library data table, the first name is converted into a second name, and the business data is respectively stored in the online library data table corresponding to the first name in the online library and in the query library data table corresponding to the second name in the query library.
[0127] From the above analysis, it can be known that the type of the online library data table storing business data can be determined according to the type code in the first name. Specifically, if it is determined to be a daily-cut data table, it is only stored in the corresponding online library data table in the online database. If it is determined to be a daily-cut data table, it is not only necessary to store it in the corresponding online library data table in the online database, but also to store it in the corresponding query data table in the query library.
[0128] It should be noted that the difference between the name of the query library data table and the name of the online library data table lies only in the type code. Therefore, it is sufficient to change the type code in the first name to the type code of the query library data table. For example, if the first name is X_C_2020_2_440_001, the converted second name is X_Q_2020_2_440_001.
[0129] In this embodiment, in order to meet the growing demand for business data volume and further improve the efficiency of subsequent read and write operations on business data, multiple online databases and multiple query databases can be set in this embodiment, and the data volume of the online database data table in each online database is basically the same, and the number of query database data tables in each query database is basically the same. For example, Figure 4 This is a schematic diagram of the structure of the acquiring business database provided in Example 1 of the present application, such as Figure 4 As shown, the business database includes n online databases and m query databases, the n online databases are named P1, P2, P3...Pn, and the m query databases are named Q1, Q2, Q3...Qn, where n and m are positive integers. It can be understood that in this embodiment, the specific number of online databases and the specific number of query databases can be set according to actual conditions and application scenarios, and are not limited here.
[0130] To facilitate the search of business data, this implementation can pre-generate the correspondence between the online database name and the online library data table name, as well as the correspondence between the query database name and the query library data table name, based on the actual situation of each online database and each query database storing data tables, and store them in the cache. Optionally, the correspondence between the online database name and the online library data table name, as well as the correspondence between the query database name and the query library data table name can be stored in the cache in the form of a data list. Exemplarily, the format of the data list of the correspondence between the online database name and the online library data table name can be as shown in Table 6, and the format of the data list of the correspondence between the query database name and the query library data table name can be as shown in Table 7.
[0131] Optionally, in this step, the name of the online database storing the business data is determined according to the correspondence between the pre-stored online database name and the online library data table name, and the storage address of the business data is determined according to the name of the online database and the first name, such as "P2:X_C_2020_1_330_001", and then the business data is stored according to the determined storage address, thereby storing the business data in the online library data table corresponding to the first name in the online database.
[0132] Table 6
[0133]
[0134] Similarly, in this step, the name of the query database storing the business data is determined according to the correspondence between the pre-stored query database name and the query library data table name, and the storage address of the business data is determined according to the name of the query database and the second name, such as "Q1:X_Q_2020_2_440_001", and then the business data is stored according to the determined storage address, thereby storing the business data in the query library data table corresponding to the second name in the query database.
[0135] From the correspondence between the online database name and the online library data table name in Table 6 and the correspondence between the query database name and the query library data table name in Table 7, it can be seen that in this step, when storing the business data shown in Table 5, the business data with sequence number 1 should be stored in the online database P1, the business data with sequence numbers 2, 4 and 5 should be stored in the online database P2 and the query database Q1, and the business data with sequence number 3 should be stored in the online database P3 and the query database Q2.
[0136] Table 7
[0137]
[0138] It can be understood that if the online library data table storing certain business data is a daily data table, such as the business data with sequence number 1 in Table 5, it will be automatically migrated to the historical data table on the next day (such as 20200825). For example, based on the time partition to which the transaction date of the business data belongs, the type code in the name of the daily data table can be changed to the type code of the historical data table, such as converting X_A_110_001 to X_C_2020_2_110_001, and obtaining the name of the online library data table after migration, and determining the name of the online database after migration according to the correspondence between the online database name and the online library data table name, and migrating the business data to the corresponding online library data table of the corresponding online database according to the determined name of the online library data table and the name of the online database. Similarly, according to the determined name of the online library data table, determine the name of the query library data table, and then determine the name of the query database storing the query library data table, and then copy the business data to the corresponding query library data table of the corresponding query database.
[0139] In this embodiment, by obtaining multiple business data, the business data includes order number, transaction date, institution number and transaction scenario code, the first name of the online library data table storing each business data is determined according to the order number, transaction date, institution number and transaction scenario code, and each business data is stored according to the first name, thereby realizing the storage of business data in separate libraries and tables, improving the rationality and orderliness of business data storage, improving the convenience of managing and using business data, and thereby improving the efficiency of adding, deleting, modifying and checking data during business processing.
[0140] Embodiment 2
[0141] Figure 5 A flowchart of a business data processing method provided in Example 2 of the present application is shown in FIG. Figure 5 As shown, based on the above embodiment 1, the service data processing method of this embodiment further includes:
[0142] S201: Receive a processing request for target business data.
[0143] In this step, when the transaction terminal needs to operate the target business data (including at least one of adding, deleting, modifying, and querying), the transaction terminal sends a processing request for the target business data to the server, and correspondingly, the server receives the processing request for the target business data.
[0144] Among them, the processing request is used to request the server to add, delete, modify and query the target business data. In this embodiment, the processing request includes information such as the order number, transaction date, institution number and transaction scenario code of the target business data to be processed.
[0145] Target business data refers to the business data requested for processing by the transaction terminal. In this embodiment, the target business data included in the processing request sent by the transaction terminal to the server can be one or more. When there are multiple target business data, the processing request should include the order number, transaction date, institution number and transaction scenario code of each target data, so that the server can locate the storage location of each target business data and perform corresponding processing.
[0146] S202. Determine the name of the target online library data table storing the target business data according to the order number, transaction date, institution number and transaction scenario code of the target business data.
[0147] In this step, the specific implementation method of determining the name of the target online library data table storing the target business data based on the order number, transaction date, institution number and transaction scenario code of the target business data is similar to the specific implementation method of S102 in Example 1 and will not be repeated here.
[0148] S203: Process the target business data according to the name of the target online library data table.
[0149] In this step, the storage location of the target business data in the server is determined according to the name of the target online library data table determined in S202, and the target business data is processed by routing to the data in the corresponding database according to the determined storage location.
[0150] Optionally, the processing request also includes a processing method for the target business data, which is one of adding, deleting, modifying or querying. Before S203, the method of this embodiment also includes:
[0151] According to the processing method, the transaction type of the transaction terminal is determined, and the transaction type is either an accounting transaction or an inquiry transaction.
[0152] Specifically, if the processing method in the processing request is addition, deletion or modification, the transaction type of the transaction terminal is determined to be an account transaction; if the processing method in the processing request is query, the transaction type of the transaction terminal is determined to be a query transaction.
[0153] Accordingly, in this step, if the transaction type is determined to be an accounting transaction, the name of the target online database storing the target business data is determined based on the name of the target online library data table and according to the pre-stored correspondence between the online database name and the online library data table name, and according to the name of the target online database and the name of the target online library data table, the process jumps to the target online library data table in the target online database to process the target business data (including adding target business data to the target online library data table, deleting target business data in the target online library data table, or modifying relevant information of the target business data in the target online library data table).
[0154] If it is determined that the transaction type of the transaction terminal is a query transaction, the name of the target online library data table is converted into the name of the target query library data table according to the naming rule of the query library data table, based on the name of the target query library data table, according to the correspondence between the query database name and the query library data table name stored in advance, the name of the target query database storing the target business data is determined, according to the name of the target query database and the name of the target query library data table, jump to the target query library data table of the target query database to process the target business data, specifically, obtain the target business data or the target query library data table including the target business data, and send the target business data or the target query library data table including the target business data to the transaction terminal.
[0155] In this embodiment, by receiving a processing request for target business data, the processing request includes the order number, transaction date, institution number and transaction scenario code of the target business data, and determining the name of the target online library data table storing the target business data based on the order number, transaction date, institution number and transaction scenario code of the target business data, and processing the target business data based on the name of the target online library data table, thereby improving the processing efficiency of adding, deleting, modifying or querying the business data.
[0156] Embodiment 3
[0157] Figure 6 This is a schematic diagram of the structure of the business data processing device provided in Example 3 of the present application, such as Figure 6 As shown, the service data processing device 10 in this embodiment includes:
[0158] An acquisition module 11 and a processing module 12.
[0159] The acquisition module 11 is used to acquire multiple business data, each of which includes an order number, a transaction date, an institution number and a transaction scenario code;
[0160] The processing module 12 is used to determine the first name of the online library data table storing each business data according to the order number, the transaction date, the institution number and the transaction scenario code; and store the multiple business data according to the first name.
[0161] Optionally, according to the order number, the transaction date, the institution number and the transaction scenario code, the processing module 12 is specifically used to:
[0162] Based on the organization number, according to pre-stored organization configuration information, determine the number of tables and organization sequence numbers corresponding to the organization number;
[0163] Determine a discrete value of the order number according to the order number and the number of tables;
[0164] Determine, according to the transaction date, a type code of an online library data table storing the business data;
[0165] According to the naming rules of the online library data table, the institution serial number, the discrete value, the type code, and the transaction scenario code are concatenated to obtain the first name.
[0166] Optionally, the processing module 12 is specifically used for:
[0167] Determine whether the transaction date is consistent with today's date;
[0168] If the transaction date is consistent with the current date, determining that the type of the online database data table storing the business data is a daily-cutting data table;
[0169] If the transaction date is inconsistent with the current date, determining that the type of the online database data table storing the business data is a historical data table;
[0170] Based on the determined type of the online library data table, the type code of the online library data table storing the business data is determined according to the pre-stored correspondence between the type of the online library data table and the type code.
[0171] Optionally, the daily cut data table includes a first sub-category daily cut data table and a second sub-category daily cut data table, and the processing module 12 is further used for:
[0172] Determining the parity of the number of days between the transaction date and the initial date;
[0173] According to the parity of the interval of days, the subtype of the daily cut data table to which the online library data table storing the business data belongs is determined.
[0174] Optionally, the historical data table includes multiple types of historical data partition tables, and the processing module 12 is further used to:
[0175] Determining the time zone to which the transaction date belongs;
[0176] According to the time partition, the subtype of the historical data table to which the online library data table storing the business data belongs is determined.
[0177] Optionally, the processing module 12 is specifically used for:
[0178] If it is determined according to the first name that the online library data table storing the business data is a daily cut data table, the business data is stored in the online library data table corresponding to the first name in the online database;
[0179] If it is determined based on the first name that the online library data table storing the business data is a historical data table, then according to the naming rule of the query library data table, the first name is converted into a second name, and the business data is stored in the online library data table corresponding to the first name in the online database and in the query library data table corresponding to the second name in the query database.
[0180] Optionally, the processing module 12 is specifically used for:
[0181] Determine the name of the online database storing the business data according to the pre-stored correspondence between the name of the online database and the name of the online library data table;
[0182] The plurality of business data are stored according to the name of the online database and the first name.
[0183] Optionally, the processing module 12 is specifically used for:
[0184] Determine the name of the query database storing the business data according to the pre-stored correspondence between the query database name and the query database data table name;
[0185] The plurality of business data are stored according to the name of the query database and the second name.
[0186] Optionally, the service data processing device 10 further includes:
[0187] A receiving module, configured to receive a processing request for target business data, wherein the processing request includes an order number, a transaction date, an institution number, and a transaction scenario code of the target business data;
[0188] The processing module 12 is also used for:
[0189] Determine the name of the target online library data table storing the target business data according to the order number, transaction date, institution number and transaction scenario code of the target business data; and process the target business data according to the name of the target online library data table.
[0190] Optionally, the processing request also includes a processing method for the target business data, and the processing method is one of adding, deleting, modifying or querying. The processing module 12 is further used to:
[0191] According to the processing method, determining the transaction type of the transaction terminal, the transaction type being an account transaction or an inquiry transaction;
[0192] Accordingly, the processing module 12 is specifically used for:
[0193] If it is determined that the transaction type is an accounting transaction, then based on the name of the target online database data table and the pre-stored correspondence between the online database name and the online database data table name, the name of the target online database storing the target business data is determined;
[0194] According to the name of the target online database and the name of the target online library data table, jump to the target online library data table of the target online database to process the target business data.
[0195] Optionally, the processing module 12 is further used for:
[0196] If it is determined that the transaction type is a query transaction, the name of the target online library data table is converted into the name of the target query library data table according to the naming rule of the query library data table;
[0197] Based on the name of the target query database data table, and according to the pre-stored correspondence between the query database name and the query database data table name, determine the name of the target query database storing the target business data;
[0198] According to the name of the target query database and the name of the target query database data table, jump to the target query database data table to process the target business data.
[0199] The service data processing device provided in this embodiment can execute the service data processing method provided in the above method embodiment, and has the corresponding functional modules and beneficial effects of the execution method. The implementation principle and technical effects of this embodiment are similar to those of the above method embodiment, and will not be described one by one here.
[0200] Embodiment 4
[0201] Figure 7 A schematic diagram of the structure of a server provided in Embodiment 4 of the present application, such as Figure 7 As shown, the server 20 includes a memory 21, a processor 22, and a computer program stored in the memory and executable on the processor; the number of the processor 22 in the server 20 may be one or more. Figure 7 A processor 22 is taken as an example; the processor 22 and the memory 21 in the server 20 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0202] The memory 21, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the acquisition module 11 and the processing module 12 in the embodiment of the present application. The processor 22 executes various functional applications and data processing of the server by running the software programs, instructions and modules stored in the memory 21, that is, implements the above-mentioned business data processing method.
[0203] The memory 21 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 21 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 21 may further include a memory remotely arranged relative to the processor 22, and these remote memories may be connected to the server via a grid. Examples of the above-mentioned grid include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0204] Embodiment 5
[0205] Embodiment 5 of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a computer processor, it is used to execute a business data processing method, the method comprising:
[0206] Obtain multiple business data, each of which includes order number, transaction date, institution number and transaction scenario code;
[0207] Determine, according to the order number, the transaction date, the institution number and the transaction scenario code, a first name of an online library data table storing each business data;
[0208] The plurality of business data are stored according to the first name.
[0209] Of course, the computer-readable storage medium provided in the embodiment of the present application, whose computer program is not limited to the method operations described above, can also execute related operations in the business data processing method provided in any embodiment of the present application.
[0210] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or grid device, etc.) to execute the methods described in each embodiment of the present application.
[0211] It is worth noting that in the embodiment of the above-mentioned business data processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0212] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A business data processing method, characterized in that: include: Obtain multiple business data, each of which includes order number, transaction date, institution number and transaction scenario code; Determine, according to the order number, the transaction date, the institution number and the transaction scenario code, a first name of an online library data table storing each business data; storing the plurality of business data according to the first name; The step of determining the first name of the online library data table storing each business data according to the order number, the transaction date, the institution number and the transaction scenario code comprises: Based on the organization number, according to pre-stored organization configuration information, determine the number of tables and organization sequence numbers corresponding to the organization number; Determine a discrete value of the order number according to the order number and the number of tables; Determine, according to the transaction date, a type code of an online library data table storing the business data; According to the naming rules of the online library data table, the institution serial number, the discrete value, the type code, and the transaction scenario code are concatenated to obtain the first name.
2. The method according to claim 1, characterized in that Determining the type code of the online library data table storing the business data according to the transaction date includes: Determine whether the transaction date is consistent with today's date; If the transaction date is consistent with the current date, determining that the type of the online database data table storing the business data is a daily-cutting data table; If the transaction date is inconsistent with the current date, determining that the type of the online database data table storing the business data is a historical data table; Based on the determined type of the online library data table, the type code of the online library data table storing the business data is determined according to the pre-stored correspondence between the type of the online library data table and the type code.
3. The method according to claim 2, characterized in that The daily cut data table includes a first sub-category daily cut data table and a second sub-category daily cut data table. After determining that the type of the online library data table storing the business data is a daily cut data table, the method further includes: Determining the parity of the number of days between the transaction date and the initial date; According to the parity of the number of days between each other, the subtype of the daily cut-off data table to which the online library data table storing the business data belongs is determined.
4. The method according to claim 2, characterized in that: The historical data table includes multiple types of historical data partition tables. After determining that the type of the online library data table storing the business data is a historical data table, the method further includes: Determining the time zone to which the transaction date belongs; According to the time partition, the subtype of the historical data table to which the online library data table storing the business data belongs is determined.
5. The method according to claim 1, characterized in that The storing of the plurality of business data according to the first name includes: If it is determined according to the first name that the online library data table storing the business data is a daily cut data table, the business data is stored in the online library data table corresponding to the first name in the online database; If it is determined based on the first name that the online library data table storing the business data is a historical data table, then according to the naming rule of the query library data table, the first name is converted into a second name, and the business data is stored in the online library data table corresponding to the first name in the online database and in the query library data table corresponding to the second name in the query database.
6. The method according to claim 5, characterized in that Storing the business data in an online database in an online database data table corresponding to the first name includes: Determine the name of the online database storing the business data according to the pre-stored correspondence between the name of the online database and the name of the online library data table; The plurality of business data are stored according to the name of the online database and the first name.
7. The method according to claim 5, characterized in that Storing the business data in a query database data table corresponding to the second name includes: Determine the name of the query database storing the business data according to the pre-stored correspondence between the query database name and the query database data table name; The plurality of business data are stored according to the name of the query database and the second name.
8. A method according to any one of claims 1 to 7, characterized in that The method further comprises: Receive a processing request for target business data, wherein the processing request includes an order number, a transaction date, an institution number, and a transaction scenario code of the target business data; Determine the name of the target online library data table storing the target business data according to the order number, transaction date, institution number and transaction scenario code of the target business data; The target business data is processed according to the name of the target online library data table.
9. The method according to claim 8, characterized in that The processing request also includes a processing method for the target business data, and the processing method is one of adding, deleting, modifying or querying. Before processing the target business data according to the name of the target online library data table, the method also includes: According to the processing method, determining the transaction type of the transaction terminal, the transaction type being an account transaction or an inquiry transaction; Accordingly, the processing of the target business data according to the name of the target online library data table includes: If it is determined that the transaction type is an accounting transaction, then based on the name of the target online database data table and the pre-stored correspondence between the online database name and the online database data table name, the name of the target online database storing the target business data is determined; According to the name of the target online database and the name of the target online library data table, jump to the target online library data table of the target online database to process the target business data.
10. The method according to claim 9, characterized in that The method further comprises: If it is determined that the transaction type is a query transaction, the name of the target online library data table is converted into the name of the target query library data table according to the naming rule of the query library data table; Based on the name of the target query database data table, and according to the pre-stored correspondence between the query database name and the query database data table name, determine the name of the target query database storing the target business data; According to the name of the target query database and the name of the target query database data table, jump to the target query database data table to process the target business data.
11. A business data processing device, characterized in that: include: The acquisition module is used to acquire multiple business data, each of which includes order number, transaction date, institution number and transaction scenario code; A processing module, configured to determine a first name of an online library data table storing each business data according to the order number, the transaction date, the institution number and the transaction scenario code; and store the plurality of business data according to the first name; The processing module is specifically used for: Based on the organization number, according to pre-stored organization configuration information, determine the number of tables and organization sequence numbers corresponding to the organization number; Determine a discrete value of the order number according to the order number and the number of tables; Determine, according to the transaction date, a type code of an online library data table storing the business data; According to the naming rules of the online library data table, the institution serial number, the discrete value, the type code, and the transaction scenario code are concatenated to obtain the first name.
12. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the business data processing method as described in any one of claims 1-10 is implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the business data processing method as described in any one of claims 1 to 10 is implemented.
