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

Database connection pool updating method and device Download PDF

Info

Publication number
CN111125223B
CN111125223B CN201911330712.9A CN201911330712A CN111125223B CN 111125223 B CN111125223 B CN 111125223B CN 201911330712 A CN201911330712 A CN 201911330712A CN 111125223 B CN111125223 B CN 111125223B
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.)
Active
Application number
CN201911330712.9A
Other languages
Chinese (zh)
Other versions
CN111125223A (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

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 Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a method and a device for updating a database connection pool, wherein a configuration center is pre-configured with first connection configuration information for connecting a public database, the database connection pool is formed by at least one piece of the 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, and generating second connection configuration information; determining a service sharing the first connection configuration information; and transmitting the second connection configuration information to the service so that the service can update the first connection configuration information in the database connection pool based on the second connection configuration information. The method can update the connection configuration information once in the configuration center, further update the database connection pool without updating the connection configuration information of the database one by one in the configuration center, and improves the updating efficiency of the database connection pool.

Description

Database connection pool updating method and device
Technical Field
The present invention relates to the field of database management technologies, and in particular, to a method and an apparatus for updating a database connection pool.
Background
With the continuous development of services, service providers gradually provide a wide variety of services to the outside, and most of the services need to access databases. In order to enable these services to quickly access data in databases, a database connection pool (which is composed of connection configuration information of numerous databases) is generally used to implement a connection between the services and the databases, and each service has connection configuration information of a database corresponding to the database one by one. Where several tens of hundreds of services are connected to the same database (e.g., relational or non-relational), each service may also connect to multiple databases of different types, resulting in the presence of connection configuration information for numerous databases. Thus, managing and maintaining database connection pools at a configuration center has become a problem that is currently faced by the need.
In the related art, when data migration (the data migration involves updating connection configuration information of a database) is required or configuration parameters (such as a user name password and a port) in the connection configuration information of the database are modified, 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, where the configuration center needs to modify the username and password in the connection configuration information of the databases corresponding to the service a, the service B, and the service C one by one, and form a database connection pool based on the updated connection configuration information of the databases, so as to complete updating of the database connection pool.
Since the configuration center needs to update the connection configuration information of the database one by one, a great deal of time and effort are required, and the update efficiency of the database connection pool is low.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, a server and a storage medium for updating a database connection pool, so that one-time connection configuration information updating is realized, the database connection pool can be updated, and the updating efficiency of the database connection pool is improved. 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 a configuration center configures first connection configuration information for connecting to a public database in advance, where the 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, and generating second connection configuration information;
determining a service sharing the first connection configuration information;
and transmitting the second connection configuration information to the service so that the service can update 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, at a configuration center, first connection configuration information for connecting to a public database includes:
first connection configuration information for connecting to the common database is preconfigured in the configuration center according to the kind of database or the purpose of the database.
In an alternative implementation manner of the embodiment of the present invention, the receiving configuration parameters includes:
monitoring whether the updating operation of the user aiming at the first connection configuration information is triggered or not;
and when the trigger of the updating operation of the user for the first connection configuration information is monitored, receiving configuration parameters input by the user.
In an alternative implementation of the embodiment of the present invention, the method further includes:
receiving service identifiers input by a user in advance in a configuration center, wherein the service identifiers are identifiers corresponding to the services sharing the first connection configuration information;
establishing a shared table entry corresponding to the first connection configuration information according to the service identifier;
determining a service sharing the first connection configuration information, comprising:
determining a shared table entry corresponding to the first connection configuration information;
extracting a service identifier from the shared table entry;
and determining the service sharing the first connection configuration information according to the service identification.
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 the loading record of the first connection configuration information exists or not from the service;
and if the service locally has the loading record of the first connection configuration information, 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 so as to prompt the user whether to issue the second connection configuration information to the service;
and under the condition that an issuing instruction input by a user is received, 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 of updating the first connection configuration information 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 that a second connection configuration information acquisition request sent by the service is received, issuing the second connection configuration information to the service.
In a second aspect, an embodiment of the present invention provides a database connection pool updating apparatus, 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 the first connection configuration information;
the parameter receiving module is used for receiving the 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 determining module, configured to determine a service sharing 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, the communication interface, and the memory complete communication with each other 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 programs stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements any of the database connection pool updating methods described above.
In a fifth aspect, embodiments of the present invention provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the database connection pool updating methods described above.
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, update the first connection configuration information in the configuration center, update the database connection pool further, one by one update of the connection configuration information of the database is not needed in the configuration center, and the update 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 invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a connection between a service and a database based on a database connection pool in an embodiment of the present invention;
FIG. 2 is a schematic diagram of an implementation flow of a database connection pool update method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another method for updating a database connection pool according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a database connection pool update apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the embodiment of the invention, first connection configuration information for connecting a public database is preconfigured 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 public database a, the public database B, and the public database C, first connection configuration information a for connecting the public database a is preconfigured in the configuration center, first connection configuration information B for connecting the public database B is preconfigured in the configuration center, first connection configuration information C for connecting the public database C is preconfigured in the configuration center, 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. As shown in FIG. 1, the subsequent service may utilize a database connection pool to effect a connection between the service and the database Mysql, the database Redis, and the database Mongodb.
Based on this, as shown in fig. 2, a flowchart of an embodiment of a method for updating a database connection pool according to the present invention may specifically include the following steps:
s201, receiving configuration parameters;
in the embodiment of the present invention, for the first connection configuration information, there is a need for updating. For this purpose, the embodiment of the invention receives the configuration parameters, and the configuration parameters are used for updating the first connection configuration information.
For example, the received configuration parameters may be: the user name password 123456 may update the user name password in the first connection configuration information with the configuration parameter (user name password 123456).
Here, the sender of the configuration parameter is not limited in the embodiment of the present invention. For example, it may be a configuration parameter management center for periodically sending 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 user name password 123456) to the configuration center, which the configuration center receives.
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 shown in table 1 below.
Configuration parameter name Configuration parameters
User name password 111111
Port (port) 35
TABLE 1
The received configuration parameter may be a user name password 123456, and the user name password in the first connection configuration information may be updated based on the configuration parameter (user name password 123456) to generate second connection configuration information, where the generated second connection configuration information is shown in table 2 below.
TABLE 2
Based on the above table 1 and table 2, as for the received configuration parameters, the configuration parameters may be used to replace the corresponding configuration parameters in the first connection configuration information, and thus the second connection configuration information may be generated.
S203, determining a service sharing the first connection configuration information;
for the first connection configuration information, which may be shared by a plurality of services, it is necessary to determine a service sharing the first connection configuration information in the embodiment of the present invention.
For example, the first connection configuration information may be shared by the service a, the service B, and the service C, and then the service a, the service B, and the service C may be determined to be the service sharing the first connection configuration information. The configuration center updates the first connection configuration information once, determines the service A, the service B and the service C sharing the first connection configuration information, and the follow-up 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 configuration center can update the first connection configuration information once, 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, the execution sequence of the step and the step S102 is not limited to this, and the step S may be executed simultaneously or may have 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, the second connection configuration information is received, and the first connection configuration information in the database connection pool is updated based on the second connection configuration information, namely, the first connection configuration information in the database connection pool is replaced by the second connection configuration information.
Through the description of 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, one-time connection configuration information update in the configuration center can be realized, the database connection pool can be updated, one-by-one update of the connection configuration information of the database is not required in the configuration center, and the update efficiency of the database connection pool is improved.
In another embodiment of the present invention, first connection configuration information for connecting to a public database may be preconfigured in the configuration center according to a database type or a database use, 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 to a common database is preconfigured in the configuration center according to the database types: for the relational database Mysql, the first connection configuration information A for connecting the public database Mysql is preconfigured in the configuration center, for the non-relational database Redis, the first connection configuration information B for connecting the public database Redis is preconfigured in the configuration center, for the non-relational database Mongodb, the first connection configuration information C for connecting the public database Mongodb is preconfigured in the configuration center, and the first connection configuration information A, the first connection configuration information B and the first connection configuration information C form a database connection pool.
For another example, first connection configuration information for connecting to a common database is preconfigured at a configuration center according to database usage: for the relational database Mysql, the uses of the database Mysql may be divided into use a, use B, and use C, according to use a, first connection configuration information a for connecting to the common database Mysql is preconfigured in the configuration center, according to use B, first connection configuration information B for connecting to the common database Mysql is preconfigured in the configuration center, according to use C, first connection configuration information C for connecting to the common database Mysql is preconfigured in the configuration center, and the 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, a flowchart of another method for updating a database connection pool according to an embodiment of the present invention may specifically include the following steps:
s301, monitoring whether the updating operation of the user aiming at the first connection configuration information is triggered or not;
in the embodiment of the invention, aiming at the first connection configuration information, the user has the need of updating. For this purpose, in the embodiment of the present invention, whether the update operation of the first connection configuration information by the user is triggered is monitored.
For example, there are first connection configuration information a, first connection configuration information B, and first connection configuration information C in the configuration center, and whether the update operation of the first connection configuration information a, the first connection configuration information B, and/or the first connection configuration information C is triggered by the user is monitored.
S302, when the update operation trigger of a user for the first connection configuration information is monitored, receiving configuration parameters input by the user;
for the monitoring result in the above step S301, when it is monitored that the update operation of the user for the first connection configuration information is triggered, the configuration parameters input by the user are received, and the first connection configuration information may be updated by using the configuration parameters later.
For example, when it is monitored that the update operation of the first connection configuration information a by the user triggers, 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, the step is similar to the step S202 described above, and the embodiment of the present invention is not described here again.
S304, determining a service sharing the first connection configuration information;
for the first connection configuration information, which may be shared by a plurality of services, it is necessary to determine a service sharing the first connection configuration information in the embodiment of the present invention. Wherein an alternative embodiment of determining the service sharing the first connection configuration information is as follows:
in an optional embodiment 1, a service identifier input by a user is received in advance in 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.
And then, the sharing table item corresponding to the first connection configuration information can be determined, the service identification is extracted from the sharing table item, and the service sharing the first connection configuration information is determined according to the service identification.
For example, the configuration center receives, in advance, a service identifier a, a service identifier B, and a service identifier C input by a user, where the service identifier a, the service identifier B, and the service identifier C are identifiers corresponding to services sharing the first connection configuration information, and establishes a sharing table entry corresponding to the first connection configuration information according to the service identifier a, the service identifier B, and the service identifier C, where the sharing table entry may be as shown in table 3 below. The service identifier may be a name, an ID, etc. 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 Table 3
When 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 a service A, a service B and a service C sharing the first connection configuration information according to the service identifier A, the service identifier B and the service identifier C.
Alternative embodiment 2, locally querying from the service whether there is a loading record of the first connection configuration information, and if the service locally has the loading record of the first connection configuration information, determining that the service is a service sharing the first connection configuration information. The method comprises the steps that first connection configuration information for connecting a public database is pre-configured in a configuration center, and the first connection configuration information is pulled from the configuration center and recorded locally in the process of starting the service, so that a loading record of the first connection configuration information can exist locally in the service, and the service sharing the first connection configuration information is determined by using the loading record.
For example, for the service a, the service B, and the service C, the first connection configuration information Base for connecting to the common database is configured in advance in the configuration center, and the first connection configuration information Base is pulled from the configuration center during the startup of the service a and the service B. In the subsequent process of determining the service sharing the first connection configuration information Base, whether the 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 if the loading record of the first connection configuration information Base exists in the service A local and the service B local, the service A and the service B can be determined to be 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, for the optional implementation manner of determining the service sharing the first connection configuration information, other optional implementation manners may also be provided, and the embodiments of the present invention are not described herein in detail.
And S305, 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.
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, the user can check the update process conveniently, and before the second connection configuration information is sent to the service, the second connection configuration information can be displayed to the user so as to prompt the user whether to send the second connection configuration information to the service. And under the condition that an issuing instruction input by a user is received, issuing second connection configuration information to the service.
In addition, in the embodiment of the invention, the second connection configuration information can be passively sent to the service, that is, the updated information of the first connection configuration information is sent to the service, so as to trigger the service to send a second connection configuration information acquisition request to acquire the second connection configuration information. And under the condition that a second connection configuration information acquisition request sent by the service is received, transmitting the second connection configuration information to the service.
As a service side, a Client may be configured, configured to receive the second connection configuration information issued by the configuration center. The service will periodically check whether the first connection configuration information in the database connection pool is updated or not and if so, reconstruct the database connection pool based on the second connection configuration information, i.e. replace the first connection configuration information in the database connection pool with the second connection configuration information.
In addition, the service can dynamically load the second connection configuration information, so that the switching connection configuration information without perception can be realized without restarting the service.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a database connection pool updating device, as shown in fig. 4, where the device may include: 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 first connection configuration information for connecting to a public database in a configuration center, 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 a configuration parameter;
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 determining module 440, configured to determine a service sharing the first connection configuration information;
and 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 of the embodiment of the present invention, the information configuration module 410 is specifically configured to:
first connection configuration information for connecting to the common database is preconfigured in the configuration center according to the kind of database or the purpose of the database.
In a specific implementation of the embodiment of the present invention, the parameter receiving module 420 is specifically configured to:
monitoring whether the updating operation of the user aiming at the first connection configuration information is triggered or not;
and when the trigger of the updating operation of the user for the first connection configuration information is monitored, receiving configuration parameters input by the user.
In a specific implementation of the embodiment of the present invention, the apparatus further includes:
an entry establishing module 460, configured to receive, 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;
establishing a shared table entry corresponding to the first connection configuration information according to the service identifier;
the service determining module 440 specifically is configured to:
determining a shared table entry corresponding to the first connection configuration information;
extracting a service identifier from the shared table entry;
and determining the service sharing the first connection configuration information according to the service identification.
In a specific implementation of the embodiment of the present invention, the service determining module 440 is specifically configured to:
locally inquiring whether the loading record of the first connection configuration information exists or not from the service;
and if the service locally has the loading record of the first connection configuration information, 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 so as to prompt the user whether to issue the second connection configuration information to the service;
and under the condition that an issuing instruction input by a user is received, 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 of updating the first connection configuration information 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 that a second connection configuration information acquisition request sent by the service is received, issuing the second connection configuration information to the service.
The embodiment of the invention also provides a server, as shown in fig. 5, comprising a processor 51, a communication interface 52, a memory 53 and a communication bus 54, wherein the processor 51, the communication interface 52 and the memory 53 complete communication with each other through the communication bus 54,
a memory 53 for storing a computer program;
the processor 51 is configured to execute a program stored in the memory 53, and implement the following steps:
receiving configuration parameters;
updating the first connection configuration information based on the configuration parameters, and generating second connection configuration information;
determining a service sharing the first connection configuration information;
and transmitting the second connection configuration information to the service so that the service can update the first connection configuration information in the database connection pool based on the second connection configuration information.
The communication bus mentioned by the server may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with 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 random access memory (Random Access Memory, RAM) or 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 aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, in which instructions are stored, which when run on a computer, cause the computer to perform the database connection pool updating method according to any of the above embodiments.
In yet another embodiment of the present invention, a computer program product comprising instructions, which when run on a computer, causes the computer to perform the database connection pool updating method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part 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, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more 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)), etc.
It is noted that relational terms such as first and second, and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (10)

1. A method for updating a database connection pool, wherein a configuration center is pre-configured with first connection configuration information for connecting to a public database, and the database connection pool is formed by at least one piece of the first connection configuration information, the method comprising:
receiving configuration parameters; the configuration parameters are used for updating the first connection configuration information;
updating the first connection configuration information based on the configuration parameters, and generating second connection configuration information;
determining a service sharing the first connection configuration information;
and transmitting the second connection configuration information to the service so that the service can update the first connection configuration information in the database connection pool based on the second connection configuration information.
2. The method according to claim 1, wherein the pre-configuring, at the configuration center, the first connection configuration information for connecting to the public database, comprises:
first connection configuration information for connecting to the common database is preconfigured in the configuration center according to the kind of database or the purpose of the database.
3. The method of claim 1, wherein the receiving configuration parameters comprises:
monitoring whether the updating operation of the user aiming at the first connection configuration information is triggered or not;
and when the trigger of the updating operation of the user for the first connection configuration information is monitored, receiving configuration parameters input by the user.
4. The method according to claim 1, wherein the method further comprises:
receiving service identifiers input by a user in advance in a configuration center, wherein the service identifiers are identifiers corresponding to the services sharing the first connection configuration information;
establishing a shared table entry corresponding to the first connection configuration information according to the service identifier;
determining a service sharing the first connection configuration information, comprising:
determining a shared table entry corresponding to the first connection configuration information;
extracting a service identifier from the shared table entry;
and determining the service sharing the first connection configuration information according to the service identification.
5. The method of claim 1, wherein the determining a service that shares the first connection configuration information comprises:
locally inquiring whether the loading record of the first connection configuration information exists or not from the service;
and if the service locally has the loading record of the first connection configuration information, 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 so as to prompt the user whether to issue the second connection configuration information to the service;
and under the condition that an issuing instruction input by a user is received, 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 of updating the first connection configuration information 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 that a second connection configuration information acquisition request sent by the service is received, issuing the second connection configuration information to the service.
8. A database connection pool updating apparatus, 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 the first connection configuration information;
the parameter receiving module is used for receiving the configuration parameters; the configuration parameters are used for updating the first connection configuration information;
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 determining module, configured to determine a service sharing 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. The server is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-7 when executing a program stored on a memory.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any 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 CN111125223A (en) 2020-05-08
CN111125223B true 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)

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
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
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
数据库连接池在动态Web网页开发中的设计与实现;韩建宁;高波;;电子设计工程(第04期);全文 *
赵克全 ; .大数据背景下动态调整参数的数据库连接池性能优化研究.淮北职业技术学院学报.2017,(第01期),全文. *
邓万宇 ; 张弛 ; 郭曦 ; .基于JDBC的数据库连接池高效管理策略.现代电子技术.2006,(第05期),全文. *
黄文,谢寄石.基于J2EE的数据库连接服务.电子科技大学学报.2002,(第01期),全文. *

Also Published As

Publication number Publication date
CN111125223A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN108153670B (en) Interface testing method and device and electronic equipment
CN111314141B (en) Route updating method and device
CN107800565B (en) Inspection method, inspection device, inspection system, computer equipment and storage medium
CN109086182B (en) Automatic database alarming method and terminal equipment
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
CN107133309B (en) Method and device for storing and querying process example, storage medium and electronic equipment
CN111163159B (en) Message subscription method, device, server and computer readable storage medium
US10509716B2 (en) Automated recovery of flighted features based on service requests
WO2017101382A1 (en) Method for connecting terminal to server, terminal and domain name server
WO2018000653A1 (en) Information processing method for m2m application, cse and ae
CN113364853A (en) Business service system, business request method and gateway equipment
CN111127181A (en) Voucher bookkeeping method and device
CN114090388A (en) Information acquisition method, server cluster, server and equipment
WO2016065842A1 (en) M2m group and notification resource creation and information exchange methods therefor, and storage medium
CN111163074B (en) Gateway service control method and device
CN109391658B (en) Account data synchronization method and equipment, storage medium and terminal thereof
CN112087327B (en) Information state acquisition method and apparatus, storage medium, and electronic apparatus
CN115951923B (en) Subscription event management method, display system, device and storage medium
CN111125223B (en) Database connection pool updating method and device
CN110955460A (en) Service process starting method and device, electronic equipment and storage medium
WO2018121164A1 (en) Method, device, and system for creating service numbers
US20170353818A1 (en) Method for deleting notification resource, and common service entity
CN109104499B (en) Session establishing method, device, equipment and storage medium
CN111221847B (en) Monitoring data storage method, device and computer readable storage medium
CN113556370A (en) Service calling method and device

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