Database dividing and table dividing method and device for database, equipment and storage medium

By dynamically configuring the database through vertical and horizontal sub-databases and tables, the problem of increasing data inventory in multi-user operation scenarios is solved, management and operation risks are reduced, and the fault tolerance and smooth operation of the business management system are improved.

CN118733559APending Publication Date: 2024-10-01CHINA CONSTRUCTION BANK +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410714592.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In business scenarios run by multiple users, the increase in data inventory of financial institutions leads to increased costs and is not conducive to management and maintenance, affecting the operation of the business management system.

Method used

By obtaining the production stock database data, vertical database division is carried out according to the business scenario of the business data table, split into a middle-end database and a front-end database, and horizontal division is carried out according to the geographical location, and multiple front-end shared databases are constructed to realize the dynamics of the database. Configuration and data distribution, reduce database management and operation risks, and optimize processing performance.

Benefits of technology

It reduces the risk of large database table management, operation and maintenance, improves the fault tolerance and smooth operation of the business management system, avoids cost increases, and achieves flexible deployment and management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733559A_ABST
    Figure CN118733559A_ABST
Patent Text Reader

Abstract

The invention provides a database dividing method and device, equipment and a storage medium, and relates to the technical field of big data. The production stock database data comprises the total business data table amount of a transaction center, a middle-stage database and a foreground database are obtained according to a business scene vertical sub-database of the business data table, the foreground database comprises a horizontal sub-database and a basic shared database, and the horizontal sub-database is split according to the region affiliation of the business data table; and obtaining a plurality of foreground shared databases. A business data table is analyzed to formulate a vertical database division strategy comprising a middle database and a foreground database, stock data is divided into the foreground database and the middle database, large table management, operation and maintenance risks are reduced, and database processing performance is optimized. And the database management is realized by taking the place of each region as the dimension, the deployment is convenient and flexible, the problems of database large result sets and the like can be reduced, and the stable operation of the business management system is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a method, device, equipment and storage medium for partitioning a database. Background Art

[0002] Some business management systems of financial institutions, such as the maintenance fund business management system, currently use a monolithic architecture, and users are subordinate institutions in provinces, cities, districts and counties across the country. With the increase in business, the number of core accounting tables has exceeded 100 million records, and the demand development level faces problems such as large table changes, which have a wide impact and are prone to cause problems such as large data result sets; at the operation and maintenance level, the database backup time is long, the database query performance is low, and the deployment mode is single and inflexible.

[0003] At present, some business management systems have not yet realized microservices and are mostly deployed locally. Therefore, in order to solve the problem of increasing stock data, adding database resources or optimizing database scripts have become the main means.

[0004] However, in the case of a monolithic architecture, the problem of data growth can be overcome for a single user. However, in a business scenario with multiple users, adding new database resources and other means to deal with the growing amount of existing data will increase costs and be detrimental to database management, operation and maintenance, which will in turn affect the operation of the business management system. Summary of the invention

[0005] The present application provides a database sub-library and table sub-library method, device, equipment and storage medium, which are used to overcome the defects that the existing means for financial institutions to solve the problem of increasing database inventory data will lead to increased costs and be unfavorable for database management, operation and maintenance in multi-user operation scenarios.

[0006] In a first aspect, the present application provides a method for sharding a database, comprising:

[0007] Acquire production stock database data, wherein the production stock database data includes the total amount of business data tables of the transaction center;

[0008] According to the business scenario of the business data table, vertical sub-library is performed to obtain a middle-end database and a front-end database, wherein the middle-end database includes a plurality of databases corresponding to different middle-end services, and the front-end database includes a horizontal sub-library and a basic shared database;

[0009] The horizontal sub-database is split according to the region of the business data table to obtain multiple front-end shared databases.

[0010] In one possible design, the method further includes:

[0011] The database is configured according to the business dynamics of the region to which the area belongs, and a mapping relationship between the region to which the area belongs and the front-end shared database is obtained.

[0012] In a possible design, obtaining production inventory database data includes:

[0013] In response to the data import command, the test environment database environment is imported from the production environment backup database file and desensitized to initialize the test environment database so that the total amount of data in the test environment database is consistent with that in the production environment backup database;

[0014] The business data in the test environment database is obtained to obtain the production stock database data.

[0015] In one possible design, the databases corresponding to the different middle-office services include at least one of a fund deposit database, an electronic invoice database, a collective decision-making database, a fund settlement database, and an accounting database.

[0016] In one possible design, the transaction center includes a maintenance fund center, and the geographical location includes the provinces where transactions are carried out in the maintenance fund center.

[0017] In one possible design, the method further includes:

[0018] In response to the front-end application request, the dynamic data generated by the business dynamics is allocated to the front-end shared database corresponding to the region according to the region, and the front-end application is deployed in a standard version.

[0019] In one possible design, the standard version includes at least one application of a collection microservice, a fund usage microservice, a front-end public service microservice, and an integrated management microservice.

[0020] In a possible design, the middle-end database and the front-end application exchange information via the remote procedure call protocol or the hypertext transfer protocol.

[0021] In a second aspect, the present application provides a database sub-library and table sub-device, including:

[0022] An acquisition module, used to acquire production stock database data, wherein the production stock database data includes the total amount of business data tables of the transaction center;

[0023] The first processing module is used to perform vertical sub-library according to the business scenario of the business data table to obtain a middle-end database and a front-end database, wherein the middle-end database includes a plurality of databases corresponding to different middle-end services, and the front-end database includes a horizontal sub-library and a basic shared database;

[0024] The second processing module is used to split the horizontal sub-database according to the region of the business data table to obtain multiple front-end shared databases.

[0025] In a possible design, the apparatus further includes: a configuration module; the configuration module is used to:

[0026] The database is configured according to the business dynamics of the region to which the area belongs, and a mapping relationship between the region to which the area belongs and the front-end shared database is obtained.

[0027] In a possible design, the acquisition module is specifically used to:

[0028] In response to the data import command, the test environment database environment is imported from the production environment backup database file and desensitized to initialize the test environment database so that the total amount of data in the test environment database is consistent with that in the production environment backup database;

[0029] The business data in the test environment database is obtained to obtain the production stock database data.

[0030] In one possible design, the databases corresponding to the different middle-office services include at least one of a fund deposit database, an electronic invoice database, a collective decision-making database, a fund settlement database, and an accounting database.

[0031] In one possible design, the transaction center includes a maintenance fund center, and the geographical location includes the provinces where transactions are carried out in the maintenance fund center.

[0032] In a possible design, the apparatus further includes: a data allocation module; the data allocation module is used to:

[0033] In response to the front-end application request, the business data dynamically generated by the business is allocated to the front-end shared database corresponding to the region according to the region. The front-end application is deployed in a standard version, and the business data table is obtained based on the business data.

[0034] In one possible design, the standard version includes at least one application of a collection microservice, a fund usage microservice, a front-end public service microservice, and an integrated management microservice.

[0035] In a possible design, the middle-end database and the front-end application exchange information via the remote procedure call protocol or the hypertext transfer protocol.

[0036] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0037] The memory stores computer-executable instructions;

[0038] The processor executes the computer-executable instructions stored in the memory to implement any possible database partitioning method provided in the first aspect.

[0039] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement any possible database sub-library and table sub-method provided in the first aspect.

[0040] In a fifth aspect, the present application provides a computer program product, comprising computer execution instructions, which, when executed by a processor, are used to implement any possible database sub-library and table sub-division method provided in the first aspect.

[0041] The present application provides a method, device, equipment and storage medium for database sub-library and table sub-library. First, the production stock database data is obtained, wherein the production stock database data includes the total amount of business data tables of the transaction center, and then the database is vertically sub-libraryed according to the business scenarios of the business data tables to obtain the middle-end database and the front-end database. The middle-end database includes multiple databases corresponding to different middle-end services, and the front-end database includes horizontal sub-library and basic shared database. By analyzing the business data tables of the transaction center, a vertical sub-library strategy including the middle-end database and the front-end database is constructed, and the stock data can be split into the front-end database and the middle-end database, reducing the management, operation and maintenance risks of large database tables and optimizing the database processing performance. Then, the horizontal sub-library is split based on the regional location of the business data table as the dimension to obtain multiple front-end shared databases. For this multi-user operation scenario of each regional location, database management based on the regional location can be realized, which is not only convenient and flexible to deploy, but also can reduce problems such as large result sets of the database, improve the fault tolerance of the business management system, and ensure the smooth operation of the business management system. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0044] Figure 2A schematic diagram of a flow chart of a method for dividing a database into different libraries and tables provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of a vertical sub-library architecture provided in an embodiment of the present application;

[0046] Figure 4 It is a schematic diagram of a single database architecture in the prior art;

[0047] Figure 5 A schematic diagram of the architecture of a front-end application and a front-end shared database provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of a flow chart of another database partitioning method provided in an embodiment of the present application;

[0049] Figure 7 A schematic diagram of an application of a database provided in an embodiment of the present application in a business scenario;

[0050] Figure 8 A schematic diagram of an application of a database provided in an embodiment of the present application in another business scenario;

[0051] Fig. 9 A schematic diagram of the structure of a database sub-library and sub-table device provided in an embodiment of the present application;

[0052] Fig.10 A schematic diagram of the structure of another database sub-library and sub-table device provided in an embodiment of the present application;

[0053] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of methods and devices consistent with some aspects of the present application as detailed in the appended claims.

[0055] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of data and other information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0056] 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.

[0057] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0058] At present, some business management systems, such as the maintenance fund business management system, have a monolithic application architecture, and users are subordinate institutions in provinces, cities, districts and counties across the country. With the increasing amount of business stock data, and because these business management systems have not yet realized microservices and are more often deployed locally, adding database resources or optimizing database scripts have become the main means to address issues such as the increasing amount of stock data. However, in the case of a monolithic architecture, the problem of data growth can be overcome for a single user, but in a business scenario with multiple users, adding database resources and other means to address issues such as the increasing amount of stock data will increase costs and be detrimental to database management, operation and maintenance, which will in turn affect the operation of the business management system.

[0059] In view of the above-mentioned problems existing in the prior art, the present application provides a method, device, equipment and storage medium for database sub-library and table sub-library. The inventive concept of the database sub-library and table sub-library method provided in the present application is that the production stock database data exists in the form of a business data table. First, the production stock database data is obtained, that is, the business data table is obtained. The business scenario of the business data table obtained is analyzed to generate the business data table and vertical sub-library is performed to split the production stock database into a middle-office database and a front-end database. The middle-office database includes a plurality of databases corresponding to different middle-office services, and the front-end database includes horizontal sub-libraries and a basic shared database. By analyzing the business data table of the transaction center, a vertical sub-library strategy including the middle-office database and the front-end database is constructed, and the stock data can be split into the front-end database and the middle-office database, reducing the risk of large database table management, operation and maintenance, and optimizing database processing performance. Further, the horizontal database is split based on the geographical location of the business data table to obtain multiple front-end shared databases. For this multi-user operation scenario, database management based on the geographical location is implemented. This is not only convenient and flexible to deploy, but also does not increase costs compared to the existing technology. It is economical and effective, and can also reduce problems such as large database result sets, improve the fault tolerance of the business management system, and ensure the smooth operation of the business management system.

[0060] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, a transaction center such as a government service or financial institution 100 runs a business management system to provide corresponding business services. For example, the business management system for maintenance funds has users such as subordinate agencies in provinces, cities, districts and counties across the country, such as the Housing Authority. During the operation of the business management system, a large amount of business data will be generated, for example, in the form of business data tables. The generated business data is collectively referred to as stock data. With the increasing amount of stock data, when multiple users participate in the business management system to carry out business, the use of new databases or optimization of database scripts will increase costs and be unfavorable to database management, operation and maintenance, such as reducing database processing performance and affecting the operation of the business management system.

[0061] The electronic device 200 can be configured to execute the database sub-library and table sub-library method provided in the embodiment of the present application, and vertically sub-library is performed for the business scenario of the business data table generated by analyzing the acquired business data table, so as to split the production stock database into the middle-end database and the front-end database. By analyzing the business data table of the transaction center, a vertical sub-library strategy including the middle-end database and the front-end database is formulated, and the stock data is split into the front-end database and the middle-end database, thereby reducing the risk of large database table management, operation and maintenance, and optimizing the database processing performance. Further, the horizontal sub-library can be split based on the regional location of the business data table as a dimension to obtain multiple front-end shared databases. For such multi-user operation scenarios of each regional location, database management based on the regional location as a dimension is implemented, which is not only convenient and flexible to deploy, but also economical and effective compared with the prior art, and can reduce problems such as large result sets of the database, improve the fault tolerance of the business management system, and ensure the smooth operation of the business management system.

[0062] In some embodiments, the electronic device 200 may be, for example, a computer, a server, a server cluster, a smart phone, or other device. The embodiment of the present application does not limit the device type. Figure 1 The electronic device 200 is shown as a computer by way of example.

[0063] It should be noted that the application scenarios described above are merely illustrative, and the database sub-library and table sub-method provided in the embodiments of the present application includes but is not limited to the application scenarios listed above.

[0064] Figure 2 A flowchart of a method for partitioning a database into different libraries and tables is provided in an embodiment of the present application.

[0065] like Figure 2 As shown, the database partitioning method provided in the embodiment of the present application includes:

[0066] S101: Obtain production inventory database data.

[0067] Among them, the production inventory database data includes the total amount of business data tables of the trading center.

[0068] The trading center can generate business data when conducting business. The generated business data is collectively referred to as stock data, that is, production stock database data. The production stock database is the database that stores business data. Among them, business data exists in the form of business data tables.

[0069] Taking the maintenance fund center as an example, the business data of the transaction center is the transaction data generated by the transactions conducted by various housing management bureaus in the maintenance fund business management system.

[0070] S102: Perform vertical database division according to the business scenario of the business data table to obtain a middle-end database and a front-end database.

[0071] Among them, the middle-office database includes multiple databases corresponding to different middle-office services, and the front-end database includes horizontal sub-databases and basic shared databases.

[0072] S103: Split the horizontal database according to the region of the business data table to obtain multiple front-end shared databases.

[0073] Taking the transaction center as the maintenance fund center as an example, the business data table is analyzed. By analyzing the total number of transactions of the transaction center that has been online in the test environment database, it is used as one of the bases for splitting the sub-library and sub-table. For example, the top 30 transaction centers account for about 67% of the total transaction volume, and the transactions of other transaction centers account for about 33%. There are 10 transaction centers with a transaction volume greater than 2%. After statistics as shown in Table 1, it is found that the transaction volume of individual centers accounts for a relatively large proportion, and the transaction volume of other centers accounts for a small proportion, with no obvious difference. Therefore, it is possible to consider further analysis according to the geographical location of the business data table generated by the transaction center. The geographical location of the business data table can be the provinces where the maintenance fund center realizes transactions, that is, the provinces.

[0074] Table 1

[0075] Name of client Trading Volume Transaction ratio Other 437 clients ####65 **.**71% A City ** Management Center ###026 *.**59% B City ** Management Center ###460 *.**49% C County ** Service Center ##702 *.**17% D City ** Construction Bureau ##960 *.**56% E City ** Construction Bureau ###93 ***87% F District** Committee ###00 *.**82% G City ** Management Center ###89 *.**69% H City ** Service Center ###33 *.**46% I City ** Management Center ###54 *.**89% J District ** Service Center ###64 *.**55% K City ** Service Center ###77 *.**89% L County ** Construction Bureau ###14 *.**63% M County ** ###61 *.**37% N County ** Construction Bureau ###45 *.**27% O City ** Construction Bureau ###27 *.**51% P City ** Bureau ###85 *.**11% Q City ** Construction Bureau ###11 *.**01% R District ** Construction Bureau ###70 *.**90% S City ** Construction Bureau ###35 *.**46% T City ** Administration ###94 *.**70% U City ** Management Center ###82 *.**77% V County ** Management Center ###07 *.**65% W City ** Bureau ###62 *.**36% X District ** Management Center ###25 *.**35% Y City ** Service Center ###46 *.**2020% Z District ** Construction Bureau ###13 *.**70%

[0076] It should be noted that, taking the maintenance fund center as an example, the principals in Table 1 are the housing management bureaus of provinces, cities, districts and counties. The transaction volume and transaction proportion are shown from most to least, that is, the transaction volume and transaction proportion of the ** Management Center of City A are the largest, and the transaction volume and transaction proportion of the ** Construction Bureau of District Z are the smallest.

[0077] Further analysis based on the region where the transaction center generates the business data table can yield the statistical details shown in Table 2. As shown in Table 2, there are 25 provinces, municipalities and autonomous regions in the current transactions, 3 provinces have a transaction volume greater than 10%, 9 provinces have a transaction volume of 2%-7%, and other provinces have a small transaction volume. Based on this, it is possible to consider splitting the database by province.

[0078] Table 2

[0079] Province Name Trading Volume Transaction ratio Province A ###,439 **.**43% N Autonomous Region ###,966 **.**17% G Autonomous Region ###,202 **.**43% Province H ###,671 *.**48% Province G ##,998 *.**11% YN Province ##,911 *.**77% City C ##,900 *.**82% AC Autonomous Region ##,948 *.**50% Province E ##,689 *.**83% Province F ##,568 *.**63% Province G ##,438 *.**80% Province H ##,445 *.**16% Province L ##,048 *.**35% Province M ##,507 *.**88% Province J ##,107 *.**78% Province S ##,053 *.**02% Province R ##,215 *.**95% Province T ##,882 *.**97% Province L ##,356 *.**49% Province Q #,#38 *.**44% Province Z #,#60 *.**02% AC Province ##4 *.**57% XZ Autonomous Region ##1 *.**23% N Autonomous Region ##9 *.**83% Province X #1 *.**33%

[0080] Furthermore, some of the business data tables with the highest data volume, such as the top 30 business data tables, are shown in Table 3 below:

[0081] Table 3

[0082]

[0083]

[0084] From Table 3, we can analyze that the largest table is the **Details table, and there are more than a dozen tables that are also large tables. It can be seen that the business data tables of the maintenance fund center are mostly large tables, and it is very necessary to divide the database and tables.

[0085] Based on the analysis of the business data table, in some embodiments, the production stock database can be split into a middle-end database and a front-end database according to the business scenario of the business data table, wherein the middle-end database includes multiple databases corresponding to different middle-end services. The front-end database is a database corresponding to the front-end service, which includes a horizontal sub-database and a basic shared database. It can be understood that the specific content of the business scenario is determined by the type of business actually carried out by the transaction center, which is not limited in the embodiments of this application.

[0086] The database is further split horizontally according to the geographical location of the business data table. For example, the database is split horizontally based on the province location as the dimension to subdivide the horizontal database of the front-end database and obtain multiple front-end shared databases.

[0087] In some embodiments, the middle-end database and front-end database are obtained by vertically dividing the database according to the business scenario. Taking the maintenance fund center as an example, the middle-end database and front-end database obtained after vertical division can be as follows: Figure 3 See Figure 3 As shown in FIG. 1 , different databases corresponding to middle office services include at least one of a fund deposit database, an electronic bill database, a collective decision database, a fund settlement database, and an accounting database. It should be noted that the databases corresponding to middle office services in actual working conditions include but are not limited to the following: Figure 3 The middle-end database shown in the figure can be divided according to specific business scenarios. The multiple front-end shared databases obtained by horizontal splitting are as follows: Figure 3 From the foreground shared DB1 to the foreground shared DBn, the value of n can be the number of provinces or less than the number of provinces.

[0088] Further, Figure 3 Also shown are examples of corresponding databases of supporting platforms and other platforms. In actual working conditions, the database of the corresponding platform can be constructed according to the specific business of the business management system run by the transaction center, and this embodiment of the present application is not limited to this.

[0089] The maintenance fund business management system adopts a single application architecture such as Figure 4 As shown by Figure 4It can be seen that the architecture is a centralized deployment mode, which mainly includes multiple subsystems such as basic data and fund deposit. Large tables such as transaction details are stored in the same database (DataBase, referred to as DB). As the number of transaction centers increases, there are problems such as wide functional adjustment, large impact range, and high test complexity. The database sub-library and table method provided in the embodiment of the present application can obtain the following through vertical sub-library and horizontal splitting: Figure 3 As shown in the architecture. Figure 3 As shown in the figure, the deployment of middle-office services can independently split the common services in the monolithic architecture into different middle-office services. Different middle-office services can correspond to at least one of fund deposit, electronic invoice, collective decision-making, fund settlement and accounting. Based on this middle-office service, the front-end application of the foreground can realize various business scenarios of the maintenance fund center, such as account opening, deposit and use, etc., and then the business data generated by different businesses can be subdivided into corresponding databases based on the databases corresponding to different middle-office services, so that special databases can be used for special purposes.

[0090] In one possible design, the middle-end database and the front-end application can complete service communication and information interaction between applications through the Remote Procedure Call Protocol (RPC) or the HyperText Transfer Protocol (HTTP).

[0091] In order to reduce the consistency complexity caused by database partitioning, the front-end database only performs horizontal database partitioning and shared database splitting, as shown below: Figure 3 Multiple front-end shared databases and basic shared databases shown in .

[0092] By performing horizontal splitting based on the geographical location of the business data table, different data in the business data table can be distributed to different database tables, which can reduce the amount of data in a single table and optimize database processing performance.

[0093] In a possible design, the front-end application and the front-end share a database comparison diagram as shown below: Figure 5 In order to reduce the complexity of transaction consistency, the front-end shared database can be planned and shared in a unified manner. The front-end application can be deployed in a standard version. For example, the standard version may include: Figure 5 At least one of the collection microservices, fund use microservices, front-end public service microservices, and integrated management microservices shown in the figure. The front-end application is deployed using the standard version, which can decouple the regions such as provinces and reduce the dependency between modules. It is conducive to optimizing applications and carrying out customized development based on the standard version in each region, with strong scalability, high fault tolerance, and improved operation and maintenance efficiency.

[0094] In the actual business development process, the electronic device can respond to the front-end application request, and then distribute the business data generated by the business dynamics from the region to the front-end shared database corresponding to the region according to the region.

[0095] From the analysis results of the business data generated by transactions in each province shown in Table 2, it can be seen that the business volume in provinces such as Province A, Autonomous Region N, and Province G is relatively large, while the business volume in provinces such as Province M, Province S, and Province Q is relatively small. Therefore, the database can be divided according to the province, that is, the business data tables of different provinces can be stored in different front-end shared databases. In some embodiments, provinces with large transaction volumes can be considered to be independent libraries, and provinces with small transaction volumes can also be considered for unified and centralized management. For example, if resources are sufficient, corresponding front-end shared databases can also be configured for independent provinces. In actual working conditions, the size of the front-end shared database can be estimated according to the transaction volume. For example, the front-end shared database configured for each region, such as each province, can be horizontally split as shown in Table 4 below:

[0096] Table 4

[0097]

[0098] The serial number in Table 4 can be Figure 3 and Figure 5 The serial number of the foreground shared database.

[0099] Through the description of the above embodiments, the database sub-library and sub-table method provided by the embodiment of the present application first obtains the production stock database data, wherein the production stock database data includes the total amount of the business data table of the transaction center, and then performs vertical sub-library according to the business scenario of the business data table to obtain the middle-end database and the front-end database. The middle-end database includes multiple databases corresponding to different middle-end services, and the front-end database includes horizontal sub-library and basic shared database, and then splits the horizontal sub-library according to the regional location of the business data table to obtain multiple front-end shared databases. By analyzing the business data table of the transaction center, a vertical sub-library strategy including the middle-end database and the front-end database is formulated, and the stock data can be split into the front-end database and the middle-end database, reducing the risk of large database table management, operation and maintenance, and optimizing the database processing performance. Then, the horizontal sub-library in the front-end database is split based on the regional location of the business data table as the dimension to obtain multiple front-end shared databases. For this multi-user operation scenario of each regional location, database management can be realized based on the regional location as the dimension, which is not only convenient and flexible to deploy, but also can reduce problems such as large result sets of the database, improve the fault tolerance of the business management system, and ensure the smooth operation of the business management system. Compared with the prior art, the maintenance risk of large tables in a monolithic architecture can be reduced in view of too many large tables, and the shortcomings of a single deployment mode of a monolithic architecture can be optimized. The deployment method combining the front-end and the middle-end provided in the embodiment of the present application is more flexible, and has low risks in upgrading, optimizing and putting into production. When the demand changes or the operation and maintenance is abnormal, there is no need to shut down the entire system. Only the corresponding modules need to be changed or maintained, which is convenient for operation and maintenance management.

[0100] Figure 6 A flowchart of another method for partitioning libraries and tables provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the database partitioning method provided in the embodiment of the present application includes:

[0101] S201: In response to a data import command, the test environment database environment is imported from the production environment backup database file and desensitized to initialize the test environment database so that the total amount of data in the test environment database is consistent with that in the production environment backup database.

[0102] S202: Acquire the business data in the test environment database to obtain the production stock database data.

[0103] In some embodiments, production stock database data may be obtained by initializing a test environment database.

[0104] For example, the electronic device can respond to the data import command to first import the test environment database environment from the production environment backup database file, and then perform desensitization to initialize the test environment database and make the total amount of data in the test environment database consistent with that in the production environment backup database. Among them, the production environment backup database is a backup database of the production stock database, so the production environment backup database synchronizes the business data in the production stock database. Further, the business data in the test environment database is obtained to obtain the production stock database data.

[0105] It is understandable that the purpose of desensitizing is to process sensitive fields that may be involved in business data, such as personal related information, and the embodiments of the present application do not limit the means of desensitizing.

[0106] S203: Perform vertical database division according to the business scenario of the business data table to obtain a middle-end database and a front-end database.

[0107] Analyze the business data table. For example, according to the business scenario of the business data table, the production stock database can be split into a middle-end database and a front-end database according to the business scenario, wherein the middle-end database includes multiple databases corresponding to different middle-end services. The front-end database is a database corresponding to the front-end service, which includes horizontal sub-databases and basic shared databases. It can be understood that the specific content of the business scenario is determined by the type of business actually carried out by the transaction center, which is not limited in the embodiments of this application.

[0108] S204: Split the horizontal database according to the region of the business data table to obtain multiple front-end shared databases.

[0109] On the basis of vertical database division, the business data tables are further analyzed. For example, the database can be horizontally split according to the geographical location of the business data tables. For example, the number of horizontal databases in the front-end database can be horizontally split based on the province location as the dimension, so as to horizontally split the horizontal database of the front-end database into multiple front-end shared databases.

[0110] Furthermore, the database partitioning method provided in the embodiment of the present application further includes:

[0111] S205: Perform database configuration according to the business dynamics of the region, and obtain a mapping relationship between the region and the front-end shared database.

[0112] After obtaining multiple front-end shared databases through water splitting and horizontal database division, a mapping relationship between each front-end shared database and its regional location can be constructed through database configuration to ensure that the business data tables generated by the business of the trading center in the corresponding regional location can be stored in the corresponding front-end shared database.

[0113] In some embodiments, the mapping relationship, that is, the corresponding relationship, between the regional locations, such as provinces and the front-end shared database can be established by configuring the database according to the business dynamics of the regional locations, so that multiple data sources, that is, the business data tables of each province, can be automatically allocated to the corresponding front-end shared database.

[0114] It should be noted that in actual working conditions, one regional location can correspond to one front-end shared database, or one regional location can correspond to multiple front-end shared databases. For example, for a regional location with a large amount of business data, multiple front-end shared databases can be configured for it, and this embodiment of the present application is not limited to this.

[0115] The database sub-library and table sub-method provided in the embodiment of the present application first initializes the test environment database to obtain the production stock database data, and then vertically sub-libraries the obtained business data table according to its business scenario to obtain the middle-end database and the front-end database, and then splits the horizontal sub-libraries in the front-end database according to the regional location of the business data table to obtain multiple front-end shared databases, and establishes a mapping relationship between each front-end database and each regional location through database configuration to ensure that the business data generated by each regional location can be automatically allocated to its corresponding front-end database. In this way, the stock data can be split into the front-end database and the middle-end database, reducing the management, operation and maintenance risks of large database tables, and optimizing the database processing performance. And further split the horizontal sub-libraries in the front-end database based on the regional location as the dimension, so that each regional location corresponds to its corresponding front-end shared database, further optimizing the database processing performance, improving the operation and maintenance efficiency, and ensuring the smooth operation of the business management system.

[0116] The following describes the application of the database obtained after sharding in business scenarios.

[0117] The middle office service takes the deposit of funds as an example. Figure 7 As shown, the funds are deposited into the middle office service and the front-end application (such as Figure 7The collection front desk in the system can use RPC or HTTP for service communication and information interaction between applications. The front desk can use the Application Program Interface (API) to call the business account management platform to complete the information interaction with the business account management module, and maintain the synchronization of transactions on database transactions; channel customers can use the RPC method to complete business requests and responses with the funds deposit middle desk through the channel interface, and the funds deposit middle desk completes payment requests and responses by calling the services provided by the payment platform; the accounting middle desk is relatively independent and lagging, that is, the accounting middle desk does not interact directly with the collection front desk, and its data comes from the funds account and business account information of the corresponding business. Among them, the funds deposit middle desk provides funds deposit middle desk services, and the accounting middle desk provides accounting middle desk services, that is, the corresponding middle desk is used to provide corresponding middle desk services.

[0118] Figure 8 A schematic diagram of a front-end architecture provided in an embodiment of the present application, such as Figure 8 As shown, n is the number of front-end shared databases obtained after horizontal splitting according to the geographical location of the business data table, such as provinces. In some embodiments, the front-end and back-end services can dynamically complete the database configuration according to the province to which the current transaction center belongs through an interceptor, so that the mapping relationship between the geographical location and its corresponding front-end shared database can be obtained. The table of the basic shared database can be authorized to each front-end shared database respectively, and the front-end application can directly access the front-end shared database corresponding to each geographical location. In some embodiments, the basic shared database can add filters, and the data source can be uniformly formulated according to the HTTP request header field, which is not limited to the embodiments of the present application.

[0119] It should be noted that Figure 7 and Figure 8 The front-end applications, middle-end services, foreground shared databases, etc. are shown as examples. In actual working conditions, the specific contents of applications and services can be configured according to actual conditions, and this embodiment of the present application does not limit this.

[0120] Fig. 9 A schematic diagram of the structure of a database sub-library and table sub-device provided in an embodiment of the present application.

[0121] like Fig. 9 As shown, the database sub-library and table sub-device provided in the embodiment of the present application includes:

[0122] The acquisition module 401 is used to acquire the production stock database data, and the production stock database data includes the total amount of the business data table of the transaction center;

[0123] The first processing module 402 is used to perform vertical sub-library according to the business scenario of the business data table to obtain a middle-end database and a front-end database. The middle-end database includes multiple databases corresponding to different middle-end services, and the front-end database includes horizontal sub-libraries and a basic shared database.

[0124] The second processing module 402 is used to split the horizontal sub-database according to the region of the business data table to obtain multiple front-end shared databases.

[0125] exist Fig. 9 On the basis of Fig.10 This is a schematic diagram of the structure of another database sub-library and sub-table device provided in an embodiment of the present application. Fig.10 As shown, the database sub-library and table sub-device provided in the embodiment of the present application further includes: a configuration module 404, the configuration module 404 is used to:

[0126] Configure the database according to the business dynamics of the region, and obtain the mapping relationship between the region and the front-end shared database.

[0127] In a possible design, the acquisition module 401 is specifically used to:

[0128] In response to the data import command, the test environment database environment is imported from the production environment backup database file and desensitized to initialize the test environment database so that the total amount of data in the test environment database is consistent with that in the production environment backup database;

[0129] Get the business data in the test environment database and obtain the production stock database data.

[0130] In one possible design, the databases corresponding to different middle-office services include at least one of a fund deposit database, an electronic invoice database, a collective decision-making database, a fund settlement database, and an accounting database.

[0131] In one possible design, the transaction center includes a maintenance fund center, and the geographical location includes the provinces where transactions are carried out in the maintenance fund center.

[0132] In a possible design, the database sub-library and sub-table device 400 further includes: a data allocation module, the data allocation module is used to:

[0133] Respond to the front-end application request to allocate the business data generated by business dynamics to the front-end shared database corresponding to the region according to the region. The front-end application is deployed in the standard version, and the business data table is obtained based on the business data.

[0134] In one possible design, the standard version includes at least one application of the collection microservice, fund usage microservice, front-end public service microservice, and integration management microservice.

[0135] In one possible design, the middle-end database and the front-end application exchange information through the remote procedure call protocol or the hypertext transfer protocol.

[0136] The database partitioning device provided in the embodiment of the present application can execute the corresponding steps of the database partitioning method in the above method embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0137] Fig.11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the electronic device 500 may include: a processor 501 , and a memory 502 communicatively connected to the processor 501 .

[0138] The memory 502 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer-executable instructions.

[0139] The memory 502 may include a high-speed RAM memory, and may also include a non-volatile memory (NoN-volatile memory), such as at least one disk memory.

[0140] The processor 501 is used to execute the computer execution instructions stored in the memory 502 to implement the above-mentioned database sub-library and table sub-method.

[0141] The processor 501 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0142] Optionally, the memory 502 may be independent or integrated with the processor 501. When the memory 502 is a device independent of the processor 501, the electronic device 500 may further include:

[0143] The bus 503 is used to connect the processor 501 and the memory 502. The bus can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.

[0144] Optionally, in a specific implementation, if the memory 502 and the processor 501 are integrated on a chip, the memory 502 and the processor 501 can communicate through an internal interface.

[0145] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores computer execution instructions, and the computer execution instructions are used for the methods in the above embodiments.

[0146] The present application also provides a computer program product, including computer execution instructions, which implement the method in the above embodiment when executed by a processor.

[0147] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.

[0148] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for dividing a database into different libraries and tables, characterized in that: include: Acquire production stock database data, wherein the production stock database data includes the total amount of business data tables of the transaction center; According to the business scenario of the business data table, vertical sub-library is performed to obtain a middle-end database and a front-end database, wherein the middle-end database includes a plurality of databases corresponding to different middle-end services, and the front-end database includes a horizontal sub-library and a basic shared database; The horizontal sub-database is split according to the region of the business data table to obtain multiple front-end shared databases.

2. The method for dividing libraries and tables according to claim 1, characterized in that: Also includes: The database is configured according to the business dynamics of the region to which the area belongs, and a mapping relationship between the region to which the area belongs and the front-end shared database is obtained.

3. The method for dividing libraries and tables according to claim 1, characterized in that: The obtaining of production inventory database data includes: In response to the data import command, the test environment database environment is imported from the production environment backup database file and desensitized to initialize the test environment database so that the total amount of data in the test environment database is consistent with that in the production environment backup database; The business data in the test environment database is obtained to obtain the production stock database data.

4. The method for dividing libraries and tables according to any one of claims 1 to 3, characterized in that: The databases corresponding to the different middle-office services include at least one of a fund deposit database, an electronic invoice database, a collective decision-making database, a fund settlement database, and an accounting database.

5. The method for dividing libraries and tables according to claim 4 is characterized in that: The transaction center includes a maintenance fund center, and the regional location includes the provinces where transactions are carried out in the maintenance fund center.

6. The method for dividing libraries and tables according to claim 5, characterized in that: Also includes: In response to the front-end application request, the business data dynamically generated by the business is allocated to the front-end shared database corresponding to the region according to the region. The front-end application is deployed in a standard version, and the business data table is obtained based on the business data.

7. The method for dividing libraries and tables according to claim 6, characterized in that: The standard version includes at least one application of a collection microservice, a fund usage microservice, a front-end public service microservice, and an integrated management microservice.

8. The method for dividing libraries and tables according to claim 7 is characterized in that: The middle-end database and the front-end application exchange information via the remote procedure call protocol or the hypertext transfer protocol.

9. A database sub-library and table sub-device, characterized in that: include: An acquisition module, used to acquire production stock database data, wherein the production stock database data includes the total amount of business data tables of the transaction center; The first processing module is used to perform vertical sub-library according to the business scenario of the business data table to obtain a middle-end database and a front-end database, wherein the middle-end database includes a plurality of databases corresponding to different middle-end services, and the front-end database includes a horizontal sub-library and a basic shared database; The second processing module is used to split the horizontal sub-database according to the region of the business data table to obtain multiple front-end shared databases.

10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the database partitioning method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the database partitioning method as described in any one of claims 1 to 8.

12. A computer program product, comprising computer executable instructions, which, when executed by a processor, are used to implement the database partitioning method as claimed in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for dividing database and table of data

    CN115576919A

  • Data verification method and device for sub-library and sub-table, computer equipment and storage medium

    CN117312283A

  • Region-based database partitioning method and device

    CN118093726A

  • Multi-regional data storage and querying

    US20210110056A1