Financial database connection processing method, device, equipment and storage medium

Through the global routing interception and configuration center dynamic allocation mechanism, the problem of difficult to dynamic routing of database connection requests in financial systems under the tomcat application server is solved, and the dynamic routing of database connection requests in financial systems and the dynamic allocation of online components is realized, which improves the flexibility of the system and adaptability.

CN112597222BActive Publication Date: 2024-12-24CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011492400.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2024-12-24
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

The financial system based on tomcat application server is difficult to realize dynamic routing of database connection requests, especially in the domestic environment, it is impossible to configure multiple data sources in the configuration, making it difficult to realize dynamic routing of connection requests.

Method used

Through the global routing interception mechanism, we obtain the online component identification and library identification of the connection request belonging to, dynamically allocate the database partition from the configuration center, and route the connection request to the corresponding financial database partition, and use the Spring interceptor and Druid components to implement the database Management of connection pools.

Benefits of technology

Dynamic routing of database connection requests for financial system based on tomcat application server is realized, which improves the flexibility and adaptability of the system and reduces the complexity of database connection management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112597222B_ABST
    Figure CN112597222B_ABST
Patent Text Reader

Abstract

The embodiment of this specification provides a method, device, equipment and storage medium for processing connection of a financial database, the method comprising: globally routing and intercepting connection requests; obtaining the online component identifier to which the connection request belongs from a configuration center; routing the connection request to the online component corresponding to the online component identifier; enabling the online component to obtain the sub-library identifier corresponding to the connection request from the configuration center; enabling the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier. The embodiment of this specification can realize dynamic routing of database connection requests of a financial system based on a tomcat application server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database technology, and in particular to a method, device, equipment and storage medium for processing financial database connections. Background Art

[0002] As a national key information infrastructure, the financial system is directly related to the normal operation of the national economy and society. At present, most of the existing financial systems run on the non-open source x86 platform. However, long-term reliance on imported equipment and systems not only requires huge foreign exchange expenditures, but also involves the security and controllability of my country's financial industry. In order to realize the localization of the financial system, it is necessary to adapt the current financial system to localization so that the current financial system can be compatible with the non-open source x86 platform and the open source platform (such as the ARM platform). At the database connection operation level, the existing x86 platform-based financial system version (hereinafter referred to as the x86 version) uses the non-open source weblogic application server. The weblogic application server can configure multiple data sources, and different server configurations connect to different databases. There is no need to deal with the connection problem of the data source in the code. You only need to configure the corresponding jndi name. The weblogic application server can complete the switching of multiple data sources. After the database connection is established, the corresponding mapper is executed to complete the database operation.

[0003] In order to improve the security of financial information and help reduce costs, at the database connection operation level, the financial system version based on the open source platform (such as the ARM platform) (hereinafter referred to as the ARM version) uses the open source Tomcat application server. However, since multiple data sources cannot be configured in the Tomcat application server, the database needs to be specified in the code. As a result, it is difficult to implement dynamic routing of connection requests in the ARM version. Summary of the invention

[0004] The purpose of the embodiments of this specification is to provide a financial database connection processing method, device, equipment and storage medium to achieve dynamic routing of database connection requests of a financial system based on a tomcat application server.

[0005] To achieve the above objectives, on the one hand, an embodiment of this specification provides a financial database connection processing method, including:

[0006] Global routing interception of connection requests;

[0007] Obtaining from the configuration center an online component identifier to which the connection request belongs;

[0008] Routing the connection request to the online component corresponding to the online component identifier;

[0009] The online component obtains a sub-library identifier corresponding to the connection request from the configuration center;

[0010] The online component is enabled to route the connection request to the financial database sub-library corresponding to the sub-library identifier.

[0011] In one embodiment of the present specification, the global routing interception of the connection request includes:

[0012] The connection request is globally routed and intercepted through the preset Spring interceptor.

[0013] In one embodiment of the present specification, the step of obtaining the online component identifier to which the connection request belongs from the configuration center includes:

[0014] The online component identifier to which the transaction type identifier carried in the connection request belongs is queried from the configuration file of the configuration center; the mapping relationship between the transaction type identifier and the online component is configured in the configuration file.

[0015] In one embodiment of the present specification, enabling the online component to obtain the sub-library identifier corresponding to the connection request from the configuration center includes:

[0016] The online component initiates a financial database sub-database allocation request carrying the connection request to the configuration center;

[0017] The online component receives a sub-library identifier; the sub-library identifier is a financial database sub-library identifier dynamically allocated by the configuration center in response to the financial database sub-library allocation request.

[0018] In one embodiment of the present specification, enabling the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier includes:

[0019] A connection is allocated to the connection request from the database connection pool corresponding to the sub-library identifier.

[0020] In one embodiment of this specification, the database connection pool includes a Druid component.

[0021] In one embodiment of the present specification, the financial database sub-database includes a Gaussian database.

[0022] In one embodiment of the present specification, the online component identifier is an SPU processor identifier.

[0023] In one embodiment of the present specification, after the online component routes the connection request to the financial database sub-library corresponding to the sub-library identifier, the method further includes:

[0024] Call the Druid component to execute the SQL statement on the financial database sub-database.

[0025] In one embodiment of this specification, the calling of the Druid component to execute the SQL statement for the financial database sub-library includes:

[0026] Call the sql session factory class of the Mybatis framework to create a sql session object;

[0027] Call the sql session object to obtain the Mapper interface;

[0028] Execute the SQL statement for the financial database sub-database according to the Mapper interface.

[0029] In one embodiment of this specification, calling the sql session object to obtain the Mapper interface includes:

[0030] Call the sql session object to confirm whether the target version of the Mapper interface exists in the specified path;

[0031] If it exists, get the Mapper interface of the target version.

[0032] In one embodiment of this specification, the method further includes:

[0033] If the Mapper interface of the target version does not exist under the specified path, the original Mapper interface of the Mybatis framework is obtained.

[0034] On the other hand, the embodiment of this specification also provides a financial database connection processing device, including:

[0035] Request interception module, used to perform global routing interception on connection requests;

[0036] A first acquisition module, used to acquire the online component identifier to which the connection request belongs from a configuration center;

[0037] A first routing module, configured to route the connection request to an online component corresponding to the online component identifier;

[0038] A second acquisition module, configured to enable the online component to acquire a sub-library identifier corresponding to the connection request from the configuration center;

[0039] The second routing module is used to enable the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier.

[0040] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions of the above method are executed.

[0041] On the other hand, an embodiment of the present specification further provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer device, the instructions of the above method are executed.

[0042] It can be seen from the technical solutions provided in the above embodiments of this specification that, in the embodiments of this specification, the financial system based on the tomcat application server can perform global routing interception on database connection requests, obtain the online component identifier to which the connection request belongs from the configuration center, and route the connection request to the corresponding online component according to the online component identifier; then enable the online component to obtain the sub-library identifier corresponding to the connection request from the configuration center (that is, the configuration center dynamically allocates a database sub-library for the connection request), and enable the online component to route the connection request to the corresponding financial database sub-library according to the sub-library identifier, thereby realizing dynamic routing of database connection requests of the financial system. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0044] Figure 1 A flowchart showing a method for processing a financial database connection in some embodiments of this specification is shown;

[0045] Figure 2 It shows an interactive schematic diagram of financial database connection processing in one embodiment of this specification;

[0046] Figure 3 It shows a structural block diagram of a financial database connection processing device in some embodiments of this specification;

[0047] Figure 4 The structure block diagram of the computer device in some embodiments of the present specification is shown.

[0048] [Description of Reference Numerals]

[0049] 30. Request interception module;

[0050] 31. A first acquisition module;

[0051] 32. A first routing module;

[0052] 33. Second acquisition module;

[0053] 34. Second routing module;

[0054] 402. Computer equipment;

[0055] 404, processor;

[0056] 406. Memory;

[0057] 408, driving mechanism;

[0058] 410, input / output module;

[0059] 412. Input devices;

[0060] 414. Output device;

[0061] 416. Presentation equipment;

[0062] 418. Graphical user interface;

[0063] 420, network interface;

[0064] 422. Communication link;

[0065] 424. Communication bus. DETAILED DESCRIPTION

[0066] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0067] The embodiments of this specification relate to database technology, which can be applied to any business system based on tomcat application server. Wherein, tomcat application server is an open source lightweight Web application server, and the business system can be implemented based on tomcat application server. Since multiple data sources cannot be configured in tomcat application server (data source refers to the database or database server used by the database application), it is generally necessary to specify the database in the code. In this way, it is difficult to implement dynamic routing for database connection requests of business systems based on tomcat application server.

[0068] For example, taking a domestic financial system (such as a bank transaction system, etc.) as an example, in order to improve the operational security of the financial system, the domestic financial system uses a tomcat application server; however, in this scenario, the domestic financial system will also face the problem that it is difficult to implement dynamic routing of database connection requests. Among them, the domestic financial system refers to: the software and hardware basic environment on which the financial system depends is a domestic ARM platform. Under the ARM platform, the processor of the domestic financial system can be based on a domestic CPU of the ARM architecture (such as a 48-core Kunpeng 920 chip based on the ARM architecture); the application server of the domestic financial system can be implemented based on the open source tomcat application server; the operating system of the domestic financial system can use a domestic operating system (such as the Zhongbiao Kylin operating system, etc.); the database of the domestic financial system can use a domestic database (such as the Gauss database, etc.). The above-mentioned software basic environment is integrated together to form a full-stack domestic environment that can support the actual application of the financial system. Correspondingly, the software and hardware infrastructure that conventional financial systems (i.e. non-domestic versions of financial systems) rely on is the X86 platform. The X86 platform may include: processors based on the X86 architecture; application servers based on non-open source weblogic and other application servers; operating systems based on UNIX or Linux; and databases based on Oracle, etc.

[0069] In view of this, in order to dynamically route database connection requests of a financial system based on a tomcat application server, an embodiment of this specification provides a financial database connection processing method, which can be applied to a financial system based on a tomcat application server.

[0070] However, those skilled in the art should understand that, compared with conventional financial systems, since the financial system of the embodiment of this specification uses a different database (i.e., Gass database) and relies on a different open source basic framework, the financial system of the embodiment of this specification needs to be pre-configured with a Gass database driver. In addition, since the connection pool resources of the Gauss database need to be customized, the financial system of the embodiment of this specification also needs to be pre-configured with a domestic database connection pool component (e.g., Druid component). The developer of the financial system can provide a Gass database driver dependency package and a Druid dependency package, and before actually applying the financial database connection processing method of the embodiment of this specification, the Gass database driver dependency package and the Druid dependency package can be obtained (e.g., remotely downloaded) and installed.

[0071] Of course, for developers, in order to realize that a financial software can be compatible with the x86 platform and the ARM platform, that is, based on a financial software, a version that can run on the x86 platform (that is, a conventional financial system) and a version that runs on the ARM platform (that is, a localized financial system) are provided. In controlling version dependencies, you can use the project management tool Maven to create two parent projects, and define the x86 and localized dependency versions in the two parent projects respectively. The localized version of the Project Object Model (POM) file introduces the localized parent version, and the x86 version of the POM file introduces the x86 parent version. In this way, when compiling a version, you can compile and package different POM files to obtain different versions of dependency packages.

[0072] refer to Figure 1 As shown, in some embodiments of this specification, the financial database connection processing method may include the following steps:

[0073] S101. Perform global routing interception on the connection request.

[0074] S102: Obtain an online component identifier to which the connection request belongs from a configuration center.

[0075] S103: Routing the connection request to the online component corresponding to the online component identifier.

[0076] S104: Enable the online component to obtain a sub-library identifier corresponding to the connection request from the configuration center.

[0077] S105: Enable the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier.

[0078] In the embodiments of the present specification, a financial system based on a tomcat application server can perform global routing interception on database connection requests, obtain the online component identifier to which the connection request belongs from a configuration center, and route the connection request to the corresponding online component according to the online component identifier; then enable the online component to obtain the sub-library identifier corresponding to the connection request from the configuration center (i.e., the configuration center dynamically allocates a database sub-library to the connection request), and enable the online component to route the connection request to the corresponding financial database sub-library according to the sub-library identifier, thereby realizing dynamic routing of database connection requests of the financial system.

[0079] In the embodiments of this specification, the connection request is a database connection request. The connection request can be initiated based on any business scenario that requires operating a database. For example, in one embodiment of this specification, when a user initiates a financial transaction request (such as a transfer request, a payment request, etc.) to a financial system through a client, the financial system needs to connect to the database and perform the corresponding transaction operation; therefore, the financial system receiving the financial transaction request is equivalent to receiving the connection request. For another example, in another embodiment of this specification, the financial system also needs to connect to the database and perform the corresponding transaction operation when performing daily end-of-day data aggregation processing; when the triggering conditions for the daily end-of-day data aggregation processing are met, the financial system is also equivalent to receiving a connection request.

[0080] In one embodiment of the present specification, the client may be a desktop computer, a tablet computer, a laptop computer, a smart phone, a digital assistant, a smart wearable device, etc. Among them, the smart wearable device may include a smart bracelet, a smart watch, smart glasses, a smart helmet, etc. Of course, the client is not limited to the above-mentioned electronic device with a certain entity, and it may also be software running in the above-mentioned electronic device.

[0081] In some embodiments of this specification, a global routing interception can be performed on the connection request through a pre-configured global interceptor (Interceptor), so that all connection requests can be dynamically routed later. For example, in an embodiment of this specification, a global routing interception can be performed on the connection request through a Spring interceptor. In an exemplary embodiment, a global routing interception can be performed on the connection request through an Interceptor in the SpringMVC framework. Among them, the SpringMVC framework is a request-driven application framework based on the view, model, and controller (Model View Controller, MVC) idea designed around a service connector (Servlet), in which the core class is DispatcherServlet. The interception principle of the Interceptor in the SpringMVC framework is roughly as follows:

[0082] (1) The request sent by the client goes directly to DispatcherServlet.

[0083] (2) DispatcherServlet calls HandlerMapping based on the request information to resolve the Handler corresponding to the request.

[0084] (3) After parsing to the corresponding Handler, it begins to be processed by the HandlerAdapter adapter.

[0085] (4)HandlerAdapter will call the real processor according to the Handler to process the request and handle the corresponding business logic.

[0086] (5) After the processor completes the business, it will return a ModelAndView object, where Model is the returned data object and View is a logical View.

[0087] (6) ViewResolver searches for the actual View based on the logical View.

[0088] (7) DispaterServlet passes the returned Model to the View.

[0089] (8) Return to the client through View.

[0090] In some embodiments of the present specification, a mapping relationship between a transaction type identifier and an online component is configured in a configuration file of the configuration center. For example, multiple transaction type identifiers may correspond to one online component, or one transaction type identifier may correspond to one online component. Therefore, obtaining the online component identifier to which the connection request belongs from the configuration center may include: querying the online component identifier to which the transaction type identifier carried by the connection request belongs from the configuration file of the configuration center.

[0091] In an exemplary embodiment, taking the bank transaction code as an example of a transaction type identifier, the mapping relationship between the transaction type identifier and the online component may be as shown in Table 1 below.

[0092] Table 1

[0093] Transaction Code Online Components Business content corresponding to the transaction code 1121 SPU1001 Current account opening 1122 SPU1001 Current account renewal 1123 SPU1001 Current account withdrawal 1124 SPU1001 Current account all-in-one settlement 1125 SPU1001 Current account 1026 SPU1002 Savings Charges 1066 SPU1003 Password Reset 4114 SPU1004 Bank draft issuance 4132 SPU1005 Cashier's Check Payment … … …

[0094] In one embodiment of this specification, when a new transaction type is identified or an online component changes, the configuration center's configuration file needs to be changed accordingly. Considering that transaction types change relatively rarely in the financial field, in one embodiment of this specification, a message subscription method can be used to obtain the above changes. When the main environment configuration center changes the transaction type, the changed transaction name, component name and other information will be sent to the message middleware (such as a kafka server, etc.); the dynamic routing configuration center (such as Figure 2 The configuration center shown in the figure reads the information in the Kafka server, and if there is a new message, it will synchronously change its own configuration file. Among them, the change in the new transaction type identifier may be, for example, the addition of one or more transaction types, or the deletion of one or more old transaction types.

[0095] In the embodiments of this specification, the online component may include one or a group of database sub-databases and their corresponding access points (APs). Figure 2 In the embodiment shown, the financial system is configured with n online components, each of which provides a unified API interface for accessing six database sub-databases (eg, Figure 2 In the AP1~APn), each AP can be identified by the corresponding SPU (Sensor Processing Unit) processor identifier, that is, the SPU processor identifier. Taking the online component 1 as an example, the online component 1 includes AP1 and 6 database sub-libraries: sub-library 11~sub-library 16, and AP1 provides an API interface for accessing sub-library 11~sub-library 16.

[0096] The configuration center is not only configured with a mapping relationship between transaction type identifiers and online components; it is also equipped with processing logic for dynamically allocating databases for connection requests (the processing logic here is essentially a distributed task allocation algorithm). In actual implementation, any suitable distributed task allocation algorithm (such as an allocation algorithm based on graph theory, an overall planning method, a heuristic method, etc.) can be selected according to actual needs, and this specification does not limit this. Thus, after routing the connection request to the online component corresponding to the online component identifier, the online component can be triggered to initiate a database dynamic allocation request to the configuration center. By executing the above processing logic, the configuration center can allocate a database sub-library to the connection request and return the sub-library identifier corresponding to the database sub-library. Accordingly, the online component routes the connection request to the financial database sub-library corresponding to the sub-library identifier.

[0097] In some embodiments of the present specification, causing the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier may include: allocating a connection to the connection request from a database connection pool corresponding to the sub-library identifier.

[0098] Database connection is an expensive resource, so the management of database connection will significantly affect the performance indicators of the entire financial system, such as scalability and robustness. Database connection pool is proposed to address this problem. Database connection pool is a technology for creating and managing a buffer pool of database connections, which is responsible for allocating, managing and releasing multiple database connections. These database connections are pre-established and ready to be used by any thread that needs them. Therefore, when a connection request is received, a database connection can be taken out of the database connection pool for use by the corresponding thread and put back into the database connection pool after use.

[0099] In some embodiments of the present specification, the database connection pool can be implemented based on any existing database connection pool. For example, in an exemplary embodiment, the database connection pool can be implemented based on the Druid component. The Druid component is a Java Database Connectivity (JDBC) component. The Druid component can not only create a connection pool, but also perform database operations using a series of JDBC component libraries included in the Druid component.

[0100] After allocating a connection to the connection request from the database connection pool corresponding to the sub-library identifier, the JDBC component library can be called to execute the SQL statement on the financial database sub-library, that is, the database operation on the financial database sub-library can be performed. The database operation may include, for example, creating (CREATE), modifying (ALTER) a data table, etc.) and modifying table data (inserting (INSERT), updating (UPDATE), deleting (DELETE), etc.

[0101] For example, in an exemplary embodiment, calling the JDBC component library to execute a SQL statement on the financial database sub-library may include:

[0102] (1) Call the Mybatis framework's SQL session factory (SqlSessionFacory) class to create a SQL session object (i.e., SqlSession object). Mybatis is a persistence layer framework that supports customized SQL, stored procedures, and advanced mapping. Therefore, MyBatis avoids almost all JDBC code and manual parameter setting and result set acquisition.

[0103] (2) Call the sql session object to obtain the Mapper interface.

[0104] (3) Execute the SQL statement for the financial database sub-database according to the Mapper interface.

[0105] Specifically, after creating a SqlSession object using the SqlSessionFacory class, you can call the getMapper method to obtain the dynamic proxy object generated by Mybatis, namely MapperProxy, according to the custom Mapper interface. When calling the method of the Mapper interface, it will be intercepted by MapperProxy, and then the invoke method will be executed. In the invoke method, the execute method of MapperMethod will be called to execute the sql. In the execute method, the getType method of the SqlCommand object will be called to obtain the type of the sql statement, the resolveReturnType of the MethodSignature object will be called to obtain the method return value type, convertArgsToSqlCommandParam will be called to parse the Mapper method parameters, and finally the corresponding method of SqlSession will be called according to the sql statement type to execute the sql statement.

[0106] In one embodiment of the present specification, calling the sql session object to obtain the Mapper interface may include: calling the sql session object to confirm whether the Mapper interface of the target version (i.e., the domesticated version of the financial system) exists under the specified path (i.e., the mapper directory); if so, the Mapper interface of the target version can be obtained; otherwise, the original Mapper interface of the Mybatis framework (i.e., the Mapper interface that comes with the Mybatis framework) can be obtained.

[0107] As explained above, the financial system of the embodiment of this specification is a localized financial system, which uses the Gauss database. The grammatical compatibility of the Gauss database and the Oracle database can reach 90%. The sql statements defined in the current system can generally run effectively on the Gauss database, but in order to avoid the compatibility problems that may be caused by the 10% difference. The SqlSessionFacory class in the Mybatis framework can also be rewritten in advance (i.e., in addition to retaining the original Mapper interface of the Mybatis framework, an additional Mapper interface adapted to the financial system of the localized version can also be provided), and it is stored in the mapper directory for adaptation with the Gauss database. When performing database operations, first determine whether there is a mapper interface file of the target version in the mapper directory, if there is, the mapper interface file is parsed first, and if not, the original Mapper interface file is parsed.

[0108] Although the process flows described above include multiple operations that occur in a particular order, it should be clearly understood that the processes may include more or fewer operations, which may be performed sequentially or in parallel (eg, using parallel processors or a multi-threaded environment).

[0109] Corresponding to the above-mentioned financial database connection processing method, this specification also provides an embodiment of a financial database connection processing device. Figure 3 As shown, in some embodiments of this specification, the financial database connection processing device may include:

[0110] The request interception module 30 can be used to perform global routing interception on the connection request;

[0111] A first acquisition module 31 may be used to acquire an online component identifier to which the connection request belongs from a configuration center;

[0112] A first routing module 32, which may be used to route the connection request to the online component corresponding to the online component identifier;

[0113] The second acquisition module 33 may be used to enable the online component to acquire the sub-library identifier corresponding to the connection request from the configuration center;

[0114] The second routing module 34 may be used to enable the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier.

[0115] In some embodiments of the present specification, obtaining from the configuration center the online component identifier to which the connection request belongs may include:

[0116] The online component identifier to which the transaction type identifier carried in the connection request belongs is queried from the configuration file of the configuration center; the mapping relationship between the transaction type identifier and the online component is configured in the configuration file.

[0117] In some embodiments of the present specification, enabling the online component to obtain the sub-library identifier corresponding to the connection request from the configuration center may include:

[0118] The online component initiates a financial database sub-database allocation request carrying the connection request to the configuration center;

[0119] The online component receives a sub-library identifier; the sub-library identifier is a financial database sub-library identifier dynamically allocated by the configuration center in response to the financial database sub-library allocation request.

[0120] In some embodiments of the present specification, causing the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier includes:

[0121] A connection is allocated to the connection request from the database connection pool corresponding to the sub-library identifier.

[0122] In some embodiments of the present specification, the database connection pool may include a Druid component.

[0123] In some embodiments of the present specification, the financial database sub-database may include a Gaussian database.

[0124] In some embodiments of the present specification, the online component identifier is an SPU processor identifier.

[0125] In some embodiments of the present specification, the financial database connection processing device may further include: an operation execution module, which may be used to call a Druid component to execute a SQL statement on the financial database sub-library.

[0126] In some embodiments of this specification, calling the Druid component to execute a SQL statement on the financial database sub-library may include:

[0127] Call the sql session factory class of the Mybatis framework to create a sql session object;

[0128] Call the sql session object to obtain the Mapper interface;

[0129] Execute the SQL statement for the financial database sub-database according to the Mapper interface.

[0130] In some embodiments of this specification, calling the sql session object to obtain the Mapper interface may include:

[0131] Call the sql session object to confirm whether the target version of the Mapper interface exists in the specified path;

[0132] If it exists, get the Mapper interface of the target version.

[0133] In some embodiments of this specification, calling the sql session object to obtain the Mapper interface may also include:

[0134] If the Mapper interface of the target version does not exist under the specified path, the original Mapper interface of the Mybatis framework is obtained.

[0135] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0136] The embodiments of this specification also provide a computer device. Figure 4 As shown, in some embodiments of the present specification, the computer device 402 may include one or more processors 404, such as one or more central processing units (CPUs) or graphics processing units (GPUs), and each processing unit may implement one or more hardware threads. The computer device 402 may also include any memory 406, which is used to store any kind of information such as code, settings, data, etc. In a specific implementation, a computer program on the memory 406 and that can be run on the processor 404, when the computer program is run by the processor 404, can execute instructions according to the above method. Non-limiting, for example, the memory 406 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory can represent a fixed or removable component of the computer device 402. In one case, when the processor 404 executes an associated instruction stored in any memory or a combination of memories, the computer device 402 can perform any operation of the associated instruction. The computer device 402 also includes one or more drive mechanisms 408 for interacting with any storage, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.

[0137] The computer device 402 may also include an input / output module 410 (I / O) for receiving various inputs (via input device 412) and for providing various outputs (via output device 414). A specific output mechanism may include a presentation device 416 and an associated graphical user interface 418 (GUI). In other embodiments, the input / output module 410 (I / O), input device 412, and output device 414 may not be included, and the computer device 402 may be used as a computer device in a network. The computer device 402 may also include one or more network interfaces 420 for exchanging data with other devices via one or more communication links 422. One or more communication buses 424 couple the components described above together.

[0138] The communication link 422 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 422 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.

[0139] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of some embodiments of the present specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processor to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processor generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0140] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processor to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0141] These computer program instructions can also be loaded onto a computer or other programmable data processor so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0142] In a typical configuration, a computer device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0143] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0144] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computer device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0145] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0146] The present specification embodiments may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present specification embodiments may also be practiced in distributed computing environments where tasks are performed by remote processors connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0147] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, in the absence of contradiction, a person skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0148] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A financial database connection processing method, characterized in that: include: Perform global routing interception on connection requests; the connection requests include database connection requests of financial systems based on tomcat application servers; Obtaining the online component identifier to which the connection request belongs from the configuration center; querying the online component identifier to which the transaction type identifier carried by the connection request belongs from the configuration file of the configuration center; The configuration file is configured with a mapping relationship between transaction type identifiers and online components; Routing the connection request to the online component corresponding to the online component identifier; The online component is enabled to obtain the sub-library identifier corresponding to the connection request from the configuration center; including: enabling the online component to initiate a financial database sub-library allocation request carrying the connection request to the configuration center; enabling the online component to receive the sub-library identifier; the sub-library identifier is a financial database sub-library identifier dynamically allocated by the configuration center in response to the financial database sub-library allocation request; The online component is made to route the connection request to the financial database sub-library corresponding to the sub-library identifier; the financial database includes a database of a financial system based on a tomcat application server.

2. The financial database connection processing method according to claim 1, characterized in that: The global routing interception of the connection request includes: The connection request is globally routed and intercepted through the preset Spring interceptor.

3. The financial database connection processing method according to claim 1, characterized in that: The step of causing the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier includes: A connection is allocated to the connection request from the database connection pool corresponding to the sub-library identifier.

4. The financial database connection processing method according to claim 3, characterized in that: The database connection pool includes a Druid component.

5. The financial database connection processing method according to claim 1, characterized in that: The financial database sub-database includes a Gaussian database.

6. The financial database connection processing method according to claim 1, characterized in that: The online component identifier is an SPU processor identifier.

7. The financial database connection processing method according to claim 1, characterized in that: After causing the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier, the method further includes: Call the Druid component to execute the SQL statement on the financial database sub-database.

8. The financial database connection processing method according to claim 7, characterized in that: The calling of the Druid component to execute the SQL statement on the financial database sub-library includes: Call the sql session factory class of the Mybatis framework to create a sql session object; Call the sql session object to obtain the Mapper interface; Execute the SQL statement for the financial database sub-database according to the Mapper interface.

9. The financial database connection processing method according to claim 8, characterized in that: The calling of the sql session object to obtain the Mapper interface includes: Call the sql session object to confirm whether the target version of the Mapper interface exists in the specified path; If it exists, get the Mapper interface of the target version.

10. The financial database connection processing method according to claim 9, characterized in that: Also includes: If the Mapper interface of the target version does not exist under the specified path, the original Mapper interface of the Mybatis framework is obtained.

11. A financial database connection processing device, characterized in that: include: Request interception module, used to perform global routing interception on connection requests; The connection request includes a database connection request of a financial system based on a tomcat application server; The first acquisition module is used to acquire the online component identifier to which the connection request belongs from the configuration center; including: querying the online component identifier to which the transaction type identifier carried by the connection request belongs from the configuration file of the configuration center; the mapping relationship between the transaction type identifier and the online component is configured in the configuration file; A first routing module, configured to route the connection request to an online component corresponding to the online component identifier; The second acquisition module is used to enable the online component to obtain the sub-library identifier corresponding to the connection request from the configuration center; including: enabling the online component to initiate a financial database sub-library allocation request carrying the connection request to the configuration center; enabling the online component to receive the sub-library identifier; the sub-library identifier is a financial database sub-library identifier dynamically allocated by the configuration center in response to the financial database sub-library allocation request; The second routing module is used to enable the online component to route the connection request to the financial database sub-library corresponding to the sub-library identifier; the financial database includes a database of a financial system based on a tomcat application server.

12. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the computer program executes the instructions of the method according to any one of claims 1 to 10.

13. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the computer program executes the instructions of the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data processing method and device, electronic device and readable storage medium

    CN110222064A

  • Service calling method and device

    CN110278284A