CN111125223A - Database connection pool updating method and device - Google Patents

Database connection pool updating method and device Download PDF

Info

Publication number
CN111125223A
CN111125223A CN201911330712.9A CN201911330712A CN111125223A CN 111125223 A CN111125223 A CN 111125223A CN 201911330712 A CN201911330712 A CN 201911330712A CN 111125223 A CN111125223 A CN 111125223A
Authority
CN
China
Prior art keywords
configuration information
connection configuration
service
connection
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911330712.9A
Other languages
Chinese (zh)
Other versions
CN111125223B (en
Inventor
马铭远
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing IQIYI Science and Technology Co Ltd
Original Assignee
Beijing IQIYI Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing IQIYI Science and Technology Co Ltd filed Critical Beijing IQIYI Science and Technology Co Ltd
Priority to CN201911330712.9A priority Critical patent/CN111125223B/en
Publication of CN111125223A publication Critical patent/CN111125223A/en
Application granted granted Critical
Publication of CN111125223B publication Critical patent/CN111125223B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a method and a device for updating a database connection pool, wherein first connection configuration information used for connecting a public database is pre-configured in a configuration center, at least one piece of first connection configuration information forms the database connection pool, and the method comprises the following steps: receiving configuration parameters; updating the first connection configuration information based on the configuration parameters to generate second connection configuration information; determining a service sharing the first connection configuration information; and issuing the second connection configuration information to the service so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information. The method and the device can realize that the connection configuration information is updated once in the configuration center, and further can update the database connection pool, the connection configuration information of the database does not need to be updated one by one in the configuration center, and the updating efficiency of the database connection pool is improved.

Description

Database connection pool updating method and device
Technical Field
The invention relates to the technical field of database management, in particular to a method and a device for updating a database connection pool.
Background
With the continuous development of services, service providers gradually provide a variety of services to the outside, and most of the services need to access a database. In order to enable the services to quickly access data in the database, a database connection pool (a database connection pool is formed by connection configuration information of a plurality of databases) is generally used for realizing connection between the services and the database, and the connection configuration information of the database corresponding to the database exists in each service. Where the number of services connecting the same database (e.g., relational or non-relational) reaches hundreds, each service may also connect a plurality of different types of databases, resulting in connection configuration information of numerous databases. Therefore, managing and maintaining a pool of database connections at a configuration center has become a current problem to be faced.
In the related art, when data migration (data migration involves updating connection configuration information of a database) or modification of configuration parameters (such as a user name password and a port) in the connection configuration information of the database is required, the connection configuration information of all databases needs to be updated one by one in a configuration center, and a database connection pool is formed based on the updated connection configuration information of the databases, so as to complete updating of the database connection pool. For example, the service a, the service B, and the service C are respectively connected to the database 1, and modify the username and password in the connection configuration information of the database, and the username and password in the connection configuration information of the databases corresponding to the service a, the service B, and the service C need to be modified one by one in the configuration center, and a database connection pool is formed based on the updated connection configuration information of the databases, so as to complete the update of the database connection pool.
Because the configuration center needs to update the connection configuration information of the database one by one, a great deal of time and energy are needed, and the updating efficiency of the database connection pool is low.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a server, and a storage medium for updating a database connection pool, so as to update connection configuration information once, update the database connection pool, and improve the update efficiency of the database connection pool. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for updating a database connection pool, where first connection configuration information used for connecting to a common database is configured in advance in a configuration center, where a database connection pool is formed by at least one piece of the first connection configuration information, and the method includes:
receiving configuration parameters;
updating the first connection configuration information based on the configuration parameters to generate second connection configuration information;
determining a service sharing the first connection configuration information;
and issuing the second connection configuration information to the service so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information.
In an optional implementation manner of the embodiment of the present invention, the pre-configuring, in the configuration center, first connection configuration information for connecting to the common database includes:
first connection configuration information for connecting a common database is configured in advance in a configuration center according to the database type or the database use.
In an optional implementation manner of the embodiment of the present invention, the receiving the configuration parameter includes:
monitoring whether the updating operation of the user for the first connection configuration information is triggered;
and when the trigger of the updating operation of the user for the first connection configuration information is monitored, receiving the configuration parameters input by the user.
In an optional implementation of the embodiment of the present invention, the method further comprises:
receiving a service identifier input by a user in advance at a configuration center, wherein the service identifier is an identifier corresponding to a service sharing the first connection configuration information;
establishing a sharing table item corresponding to the first connection configuration information according to the service identifier;
determining a service sharing the first connection configuration information, comprising:
determining a sharing table entry corresponding to the first connection configuration information;
extracting a service identifier from the shared table item;
and determining the service sharing the first connection configuration information according to the service identifier.
In an optional implementation manner of the embodiment of the present invention, the determining a service that shares the first connection configuration information includes:
locally inquiring whether a loading record of the first connection configuration information exists from a service;
and if the loading record of the first connection configuration information exists locally in the service, determining that the service is the service sharing the first connection configuration information.
In an optional implementation manner of the embodiment of the present invention, the issuing the second connection configuration information to the service includes:
displaying the second connection configuration information to a user to prompt the user whether to issue the service or not;
and under the condition of receiving an issuing instruction input by a user, issuing the second connection configuration information to the service.
In an optional implementation manner of the embodiment of the present invention, the issuing the second connection configuration information to the service includes:
issuing a message that the first connection configuration information is updated to the service to trigger the service to send a second connection configuration information acquisition request to acquire the second connection configuration information;
and under the condition of receiving a second connection configuration information acquisition request sent by the service, issuing the second connection configuration information to the service.
In a second aspect, an embodiment of the present invention provides an apparatus for updating a database connection pool, where the apparatus includes:
the information configuration module is used for pre-configuring first connection configuration information for connecting a public database in a configuration center, wherein a database connection pool is formed by at least one piece of first connection configuration information;
the parameter receiving module is used for receiving configuration parameters;
the information updating module is used for updating the first connection configuration information based on the configuration parameters and generating second connection configuration information;
a service determination module, configured to determine a service that shares the first connection configuration information;
and the information issuing module is used for issuing the second connection configuration information to the service so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information.
In a third aspect, an embodiment of the present invention provides a server, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the database connection pool updating methods when executing the program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the above-mentioned database connection pool updating methods.
In a fifth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any one of the above-mentioned database connection pool updating methods.
According to the technical scheme provided by the embodiment of the invention, the configuration parameters are received, the first connection configuration information is updated based on the configuration parameters, the second connection configuration information is further generated, and the second connection configuration information is issued to the service sharing the first connection configuration information, so that the service can update the first connection configuration information in the database connection pool based on the second connection configuration information, the connection configuration information can be updated once in the configuration center, the database connection pool can be further updated, the connection configuration information of the database does not need to be updated one by one in the configuration center, and the updating efficiency of the database connection pool is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a diagram illustrating a database connection pool-based implementation of a connection between a service and a database according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating an implementation of a database connection pool updating method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating an implementation of another database connection pool updating method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a database connection pool updating apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server shown in the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
In the embodiment of the invention, first connection configuration information for connecting a common database is configured in advance in a configuration center, wherein a database connection pool is formed by at least one piece of first connection configuration information.
For example, for the common database a, the common database B, and the common database C, the first connection configuration information a for connecting the common database a is previously arranged in the configuration center, the first connection configuration information B for connecting the common database B is previously arranged in the configuration center, the first connection configuration information C for connecting the common database C is previously arranged in the configuration center, and the first connection configuration information a, the first connection configuration information B, and the first connection configuration information C constitute a database connection pool. As shown in fig. 1, the subsequent service may utilize the database connection pool to implement the connection between the service and the database Mysql, the database Redis, and the database Mongodb.
Based on this, as shown in fig. 2, an implementation flow diagram of a database connection pool updating method provided in an embodiment of the present invention is shown, where the method specifically includes the following steps:
s201, receiving configuration parameters;
in the embodiment of the present invention, there is a need for updating the first connection configuration information. To this end, the embodiment of the present invention receives a configuration parameter, where the configuration parameter is used to update the first connection configuration information.
For example, the received configuration parameters may be: the username password 123456, which may be used to update the username password in the first connection configuration information with the configuration parameter (username password 123456).
The sender of the configuration parameters is not limited in the embodiment of the present invention. For example, it may be a configuration parameter management center, which periodically sends configuration parameters to the configuration center.
For example, to increase the security factor, the configuration parameter management center periodically determines the configuration parameters and sends the configuration parameters (such as username password 123456) to the configuration center, which receives the configuration parameters.
S202, updating the first connection configuration information based on the configuration parameters, and generating second connection configuration information;
for the received configuration parameters, the first connection configuration information may be updated based on the configuration parameters, and the second connection configuration information may be generated.
For example, the configuration parameters included in the first connection configuration information are as shown in table 1 below.
Configuring parameter names Configuring parameters
Username password 111111
Port(s) 35
TABLE 1
The received configuration parameter may be a username password 123456, and the username password in the first connection configuration information may be updated based on the configuration parameter (username password 123456) to generate second connection configuration information, which is shown in table 2 below.
Figure BDA0002329480010000061
Figure BDA0002329480010000071
TABLE 2
As can be seen from tables 1 and 2, the received configuration parameters can be replaced with the corresponding configuration parameters in the first connection configuration information, and the second connection configuration information can be generated.
S203, determining a service sharing the first connection configuration information;
for the first connection configuration information, it may be shared by multiple services, and in the embodiment of the present invention, it is necessary to determine a service sharing the first connection configuration information.
For example, for the first connection configuration information, the first connection configuration information may be shared by service a, service B, and service C, and then service a, service B, and service C may be determined to be the service sharing the first connection configuration information. The first connection configuration information is updated once in the configuration center, the service A, the service B and the service C sharing the first connection configuration information are determined, and the subsequent service A, the service B and the service C can automatically update the first connection configuration information in the database connection pool once, so that the once connection configuration information can be updated in the configuration center, the database connection pool can be updated, the connection configuration information of the database does not need to be updated one by one in the configuration center, and the updating efficiency of the database connection pool is improved.
It should be noted that, as to the execution sequence of the step and the step S102, the execution sequence is not limited in the embodiment of the present invention, and the step may be executed simultaneously or in a sequential order.
S204, the second connection configuration information is issued to the service, so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information.
For the service determined in the above step, in the embodiment of the present invention, the second connection configuration information may be issued to the determined service. For each determined service, receiving the second connection configuration information, and updating the first connection configuration information in the database connection pool based on the second connection configuration information, that is, replacing the first connection configuration information in the database connection pool with the second connection configuration information.
Through the above description of the technical solution provided by the embodiment of the present invention, the configuration parameter is received, the first connection configuration information is updated based on the configuration parameter, the second connection configuration information is further generated, and the second connection configuration information is issued to the service sharing the first connection configuration information, so that the service can update the first connection configuration information in the database connection pool based on the second connection configuration information, and can update the connection configuration information once at the configuration center, and further update the database connection pool without updating the connection configuration information of the database one by one at the configuration center, thereby improving the update efficiency of the database connection pool.
In another embodiment of the present invention, first connection configuration information for connecting to a common database may be pre-configured in a configuration center according to a database type or a database usage, and a database connection pool is formed by at least one piece of first connection configuration information.
For example, the database types may be classified into a relational database and a non-relational database, and first connection configuration information for connecting the common databases is configured in advance in the configuration center according to the database types: for the relational database Mysql, a public database is configured in advance at a configuration center, first connection configuration information A used for connecting the public database Mysql is configured in advance, for the non-relational database Redis, the public database is configured at the configuration center, first connection configuration information B used for connecting the public database Redis is configured in advance at the configuration center, for the non-relational database Mongodb, the public database is configured at the configuration center, first connection configuration information C used for connecting the public database Mongodb is configured in advance, and a database connection pool is formed by the first connection configuration information A, the first connection configuration information B and the first connection configuration information C.
For another example, first connection configuration information for connecting a common database is configured in advance in a configuration center according to the database usage: for the relational database Mysql, the usage of the database Mysql may be divided into usage a, usage B, and usage C, first connection configuration information a for connecting to the public database Mysql is preconfigured in the configuration center according to the usage a, first connection configuration information B for connecting to the public database Mysql is preconfigured in the configuration center according to the usage B, first connection configuration information C for connecting to the public database Mysql is preconfigured in the configuration center according to the usage C, and a database connection pool is composed of the first connection configuration information a, the first connection configuration information B, and the first connection configuration information C.
Based on this, as shown in fig. 3, an implementation flow diagram of another database connection pool updating method provided in the embodiment of the present invention is shown, where the method specifically includes the following steps:
s301, monitoring whether the updating operation of the user for the first connection configuration information is triggered;
in the embodiment of the present invention, for the first connection configuration information, the user has an update requirement. Therefore, in the embodiment of the invention, whether the updating operation of the user for the first connection configuration information is triggered or not is monitored.
For example, the configuration center has first connection configuration information a, first connection configuration information B, and first connection configuration information C, and monitors whether an update operation of the user with respect to the first connection configuration information a, the first connection configuration information B, and/or the first connection configuration information C is triggered.
S302, when the situation that the updating operation of the user for the first connection configuration information is triggered is monitored, receiving configuration parameters input by the user;
as for the monitoring result in step S301, when it is monitored that the update operation of the first connection configuration information is triggered by the user, the configuration parameter input by the user is received, and the first connection configuration information may be updated subsequently by using the configuration parameter.
For example, when it is monitored that the update operation of the user for the first connection configuration information a is triggered, the configuration parameters input by the user may be received: 123456 (username password), the username password in the first connection configuration information a is updated with the configuration parameters (123456).
S303, updating the first connection configuration information based on the configuration parameters, and generating second connection configuration information;
in the embodiment of the present invention, this step is similar to the step S202, and the details of the embodiment of the present invention are not repeated herein.
S304, determining a service sharing the first connection configuration information;
for the first connection configuration information, it may be shared by multiple services, and in the embodiment of the present invention, it is necessary to determine a service sharing the first connection configuration information. Wherein, the optional implementation manner of determining the service sharing the first connection configuration information is as follows:
optional embodiment 1, receiving, in advance, a service identifier input by a user at a configuration center, where the service identifier is an identifier corresponding to a service sharing the first connection configuration information; and establishing a sharing table item corresponding to the first connection configuration information according to the service identifier.
Subsequently, a sharing table entry corresponding to the first connection configuration information may be determined, a service identifier is extracted from the sharing table entry, and a service sharing the first connection configuration information is determined according to the service identifier.
For example, a service identifier a, a service identifier B, and a service identifier C input by a user are received in advance in a configuration center, where the service identifier a, the service identifier B, and the service identifier C are identifiers corresponding to a service sharing the first connection configuration information, and a shared entry corresponding to the first connection configuration information is established according to the service identifier a, the service identifier B, and the service identifier C, and the shared entry may be as shown in table 3 below. The service identifier may be a name, an ID, and the like of the service, which is not limited in the embodiment of the present invention.
First connection configuration information Service identification
Base A、B、C
TABLE 3
And under the condition that the service sharing the first connection configuration information Base needs to be determined, determining a sharing table item corresponding to the first connection configuration information Base, extracting a service identifier A, a service identifier B and a service identifier C from the sharing table item, and determining the service A, the service B and the service C sharing the first connection configuration information according to the service identifier A, the service identifier B and the service identifier C.
Embodiment 2 may be implemented by locally querying whether the loaded record of the first connection configuration information exists from the service, and if the loaded record of the first connection configuration information locally exists in the service, determining that the service is a service sharing the first connection configuration information. The configuration center is configured with first connection configuration information for connecting the public database in advance, for the service, in the starting process, the first connection configuration information is pulled from the configuration center and recorded to the local, so that a loading record of the first connection configuration information may exist in the local of the service, and the loading record is used for determining the service sharing the first connection configuration information.
For example, for service a, service B, and service C, the first connection configuration information Base for connecting to the common database is configured in advance in the configuration center, and during the process of starting service a and service B, the first connection configuration information Base is pulled from the configuration center. In the subsequent process of determining the service sharing the first connection configuration information Base, whether a loading record of the first connection configuration information Base exists is queried from the service a local, the service B local, and the service C local, wherein the service a local and the service B local have the loading record of the first connection configuration information Base, it may be determined that the service a and the service B are the service sharing the first connection configuration information Base, and the service C does not share the first connection configuration information Base.
It should be noted that, as to the optional implementation manner for determining the service sharing the first connection configuration information, other optional implementation manners may also be used, and details of the embodiments of the present invention are not described herein.
S305, issuing the second connection configuration information to the service so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information.
And for the generated second connection configuration information, issuing the second connection configuration information to a service sharing the first connection configuration information, wherein the service can update the first connection configuration information in the database connection pool based on the second connection configuration information.
In order to facilitate visualization of the update process of the database connection pool and convenience for the user to check, before the second connection configuration information is issued to the service, the second connection configuration information can be displayed to the user to prompt the user whether to issue the service. And under the condition of receiving an issuing instruction input by the user, issuing second connection configuration information to the service.
In addition, in the embodiment of the present invention, the second connection configuration information may be passively issued to the service, that is, an updated message of the first connection configuration information may be issued to the service, so as to trigger the service to send the second connection configuration information acquisition request, and acquire the second connection configuration information. And under the condition of receiving a second connection configuration information acquisition request sent by the service, issuing second connection configuration information to the service.
As the service side, a Client may be configured to receive the second connection configuration information sent by the configuration center. The service will periodically check whether the first connection configuration information in the database connection pool is updated, and if there is an update (i.e., replace the first connection configuration information in the database connection pool with the second connection configuration information), reconstitute the database connection pool based on the second connection configuration information.
In addition, the service can also dynamically load the second connection configuration information, and the connection configuration information can be switched without restarting the service and sensing.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a database connection pool updating apparatus, and as shown in fig. 4, the apparatus may include: the system comprises an information configuration module 410, a parameter receiving module 420, an information updating module 430, a service determining module 440 and an information issuing module 450.
An information configuration module 410, configured to pre-configure, in a configuration center, first connection configuration information for connecting to a common database, where a database connection pool is formed by at least one piece of the first connection configuration information;
a parameter receiving module 420, configured to receive configuration parameters;
an information updating module 430, configured to update the first connection configuration information based on the configuration parameter, and generate second connection configuration information;
a service determination module 440, configured to determine a service sharing the first connection configuration information;
an information issuing module 450, configured to issue the second connection configuration information to the service, so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information.
In a specific implementation manner of the embodiment of the present invention, the information configuration module 410 is specifically configured to:
first connection configuration information for connecting a common database is configured in advance in a configuration center according to the database type or the database use.
In a specific implementation manner of the embodiment of the present invention, the parameter receiving module 420 is specifically configured to:
monitoring whether the updating operation of the user for the first connection configuration information is triggered;
and when the trigger of the updating operation of the user for the first connection configuration information is monitored, receiving the configuration parameters input by the user.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
the table item establishing module 460 is configured to receive a service identifier input by a user in advance in a configuration center, where the service identifier is an identifier corresponding to a service sharing the first connection configuration information;
establishing a sharing table item corresponding to the first connection configuration information according to the service identifier;
the service determination module 440 is specifically configured to:
determining a sharing table entry corresponding to the first connection configuration information;
extracting a service identifier from the shared table item;
and determining the service sharing the first connection configuration information according to the service identifier.
In a specific implementation manner of the embodiment of the present invention, the service determination module 440 is specifically configured to:
locally inquiring whether a loading record of the first connection configuration information exists from a service;
and if the loading record of the first connection configuration information exists locally in the service, determining that the service is the service sharing the first connection configuration information.
In a specific implementation manner of the embodiment of the present invention, the information issuing module 450 is specifically configured to:
displaying the second connection configuration information to a user to prompt the user whether to issue the service or not;
and under the condition of receiving an issuing instruction input by a user, issuing the second connection configuration information to the service.
In a specific implementation manner of the embodiment of the present invention, the information issuing module 450 is specifically configured to:
issuing a message that the first connection configuration information is updated to the service to trigger the service to send a second connection configuration information acquisition request to acquire the second connection configuration information;
and under the condition of receiving a second connection configuration information acquisition request sent by the service, issuing the second connection configuration information to the service.
The embodiment of the present invention further provides a server, as shown in fig. 5, including a processor 51, a communication interface 52, a memory 53 and a communication bus 54, where the processor 51, the communication interface 52, and the memory 53 complete mutual communication through the communication bus 54,
a memory 53 for storing a computer program;
the processor 51 is configured to implement the following steps when executing the program stored in the memory 53:
receiving configuration parameters;
updating the first connection configuration information based on the configuration parameters to generate second connection configuration information;
determining a service sharing the first connection configuration information;
and issuing the second connection configuration information to the service so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information.
The communication bus mentioned in the above server may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the server and other devices.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, and when the computer-readable storage medium is executed on a computer, the computer is caused to execute the database connection pool updating method described in any one of the above embodiments.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the database connection pool updating method of any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A database connection pool updating method, which is characterized in that first connection configuration information used for connecting a public database is configured in advance in a configuration center, wherein a database connection pool is formed by at least one piece of first connection configuration information, and the method comprises the following steps:
receiving configuration parameters;
updating the first connection configuration information based on the configuration parameters to generate second connection configuration information;
determining a service sharing the first connection configuration information;
and issuing the second connection configuration information to the service so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information.
2. The method of claim 1, wherein pre-configuring, at a configuration center, first connection configuration information for connecting to a common database comprises:
first connection configuration information for connecting a common database is configured in advance in a configuration center according to the database type or the database use.
3. The method of claim 1, wherein the receiving the configuration parameter comprises:
monitoring whether the updating operation of the user for the first connection configuration information is triggered;
and when the trigger of the updating operation of the user for the first connection configuration information is monitored, receiving the configuration parameters input by the user.
4. The method of claim 1, further comprising:
receiving a service identifier input by a user in advance at a configuration center, wherein the service identifier is an identifier corresponding to a service sharing the first connection configuration information;
establishing a sharing table item corresponding to the first connection configuration information according to the service identifier;
determining a service sharing the first connection configuration information, comprising:
determining a sharing table entry corresponding to the first connection configuration information;
extracting a service identifier from the shared table item;
and determining the service sharing the first connection configuration information according to the service identifier.
5. The method of claim 1, wherein determining the service sharing the first connection configuration information comprises:
locally inquiring whether a loading record of the first connection configuration information exists from a service;
and if the loading record of the first connection configuration information exists locally in the service, determining that the service is the service sharing the first connection configuration information.
6. The method of claim 1, wherein the issuing the second connection configuration information to the service comprises:
displaying the second connection configuration information to a user to prompt the user whether to issue the service or not;
and under the condition of receiving an issuing instruction input by a user, issuing the second connection configuration information to the service.
7. The method of claim 1, wherein the issuing the second connection configuration information to the service comprises:
issuing a message that the first connection configuration information is updated to the service to trigger the service to send a second connection configuration information acquisition request to acquire the second connection configuration information;
and under the condition of receiving a second connection configuration information acquisition request sent by the service, issuing the second connection configuration information to the service.
8. An apparatus for updating a database connection pool, the apparatus comprising:
the information configuration module is used for pre-configuring first connection configuration information for connecting a public database in a configuration center, wherein a database connection pool is formed by at least one piece of first connection configuration information;
the parameter receiving module is used for receiving configuration parameters;
the information updating module is used for updating the first connection configuration information based on the configuration parameters and generating second connection configuration information;
a service determination module, configured to determine a service that shares the first connection configuration information;
and the information issuing module is used for issuing the second connection configuration information to the service so that the service updates the first connection configuration information in the database connection pool based on the second connection configuration information.
9. A server is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201911330712.9A 2019-12-20 2019-12-20 Database connection pool updating method and device Active CN111125223B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911330712.9A CN111125223B (en) 2019-12-20 2019-12-20 Database connection pool updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911330712.9A CN111125223B (en) 2019-12-20 2019-12-20 Database connection pool updating method and device

Publications (2)

Publication Number Publication Date
CN111125223A true CN111125223A (en) 2020-05-08
CN111125223B CN111125223B (en) 2023-10-10

Family

ID=70501334

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911330712.9A Active CN111125223B (en) 2019-12-20 2019-12-20 Database connection pool updating method and device

Country Status (1)

Country Link
CN (1) CN111125223B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113779119A (en) * 2021-01-27 2021-12-10 北京沃东天骏信息技术有限公司 Method, device and system for configuring database connection pool

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605727A (en) * 2013-11-19 2014-02-26 浪潮电子信息产业股份有限公司 Connection pool based efficient multiuser database access optimization method and framework
US9098565B1 (en) * 2009-10-08 2015-08-04 Cellco Partnership In-house elegant JDBC connection pooling solution for message broker
CN106484882A (en) * 2016-10-14 2017-03-08 腾讯科技(深圳)有限公司 A kind of management method of database connection pool and device
CN106897365A (en) * 2017-01-11 2017-06-27 北京市天元网络技术股份有限公司 Data processing method and device
CN107291747A (en) * 2016-03-31 2017-10-24 北京优朋普乐科技有限公司 A kind of management method of database connection pool, apparatus and system
CN109471896A (en) * 2018-11-01 2019-03-15 数贸科技(北京)有限公司 Data source information dynamic altering method and device
CN109474456A (en) * 2018-09-26 2019-03-15 中国平安人寿保险股份有限公司 Configuration data processing method, device, computer equipment and storage medium
CN110308976A (en) * 2018-03-27 2019-10-08 优酷网络技术(北京)有限公司 Task processing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9098565B1 (en) * 2009-10-08 2015-08-04 Cellco Partnership In-house elegant JDBC connection pooling solution for message broker
CN103605727A (en) * 2013-11-19 2014-02-26 浪潮电子信息产业股份有限公司 Connection pool based efficient multiuser database access optimization method and framework
CN107291747A (en) * 2016-03-31 2017-10-24 北京优朋普乐科技有限公司 A kind of management method of database connection pool, apparatus and system
CN106484882A (en) * 2016-10-14 2017-03-08 腾讯科技(深圳)有限公司 A kind of management method of database connection pool and device
CN106897365A (en) * 2017-01-11 2017-06-27 北京市天元网络技术股份有限公司 Data processing method and device
CN110308976A (en) * 2018-03-27 2019-10-08 优酷网络技术(北京)有限公司 Task processing method and device
CN109474456A (en) * 2018-09-26 2019-03-15 中国平安人寿保险股份有限公司 Configuration data processing method, device, computer equipment and storage medium
CN109471896A (en) * 2018-11-01 2019-03-15 数贸科技(北京)有限公司 Data source information dynamic altering method and device

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
赵克全;: "大数据背景下动态调整参数的数据库连接池性能优化研究", no. 01 *
邓万宇;张弛;郭曦;: "基于JDBC的数据库连接池高效管理策略", no. 05 *
韩建宁;高波;: "数据库连接池在动态Web网页开发中的设计与实现", 电子设计工程, no. 04 *
黄文,谢寄石: "基于J2EE的数据库连接服务", no. 01 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113779119A (en) * 2021-01-27 2021-12-10 北京沃东天骏信息技术有限公司 Method, device and system for configuring database connection pool

Also Published As

Publication number Publication date
CN111125223B (en) 2023-10-10

Similar Documents

Publication Publication Date Title
CN108153670B (en) Interface testing method and device and electronic equipment
US11068964B2 (en) Method and device for processing service request
CN107800565B (en) Inspection method, inspection device, inspection system, computer equipment and storage medium
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
CN109086182B (en) Automatic database alarming method and terminal equipment
US9930632B2 (en) M2M application remote registration method, device, system and storage medium
CN108520401B (en) User list management method, device, platform and storage medium
CN111125223B (en) Database connection pool updating method and device
CN109391658B (en) Account data synchronization method and equipment, storage medium and terminal thereof
CN108132836B (en) Task distribution method and device and electronic equipment
CN110955460A (en) Service process starting method and device, electronic equipment and storage medium
US10282527B2 (en) Information processing apparatus, information processing method, program, storage medium, and password entry apparatus
CN115951923A (en) Subscription event management method and related product
WO2018121164A1 (en) Method, device, and system for creating service numbers
CN112583890B (en) Message pushing method and device based on enterprise office system and computer equipment
CN115037653A (en) Service flow monitoring method and device, electronic equipment and storage medium
CN113010587B (en) Data source configuration method, device, terminal, server and medium
CN111221847B (en) Monitoring data storage method, device and computer readable storage medium
CN109450885B (en) Network data interception method and device, electronic equipment and storage medium
US20150310449A1 (en) Management system and control method
CN113556370A (en) Service calling method and device
US10432465B2 (en) Automatic provisioning of a network access point
CN111258896A (en) Method and device for automatic number-making breakpoint continuous making and computer readable storage medium
CN112905427B (en) Data processing method and device
CN115834179B (en) Policy aggregation method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant