CN111277424A - Connection pool maintenance method and device and electronic equipment - Google Patents

Connection pool maintenance method and device and electronic equipment Download PDF

Info

Publication number
CN111277424A
CN111277424A CN201811477403.XA CN201811477403A CN111277424A CN 111277424 A CN111277424 A CN 111277424A CN 201811477403 A CN201811477403 A CN 201811477403A CN 111277424 A CN111277424 A CN 111277424A
Authority
CN
China
Prior art keywords
data source
tenant information
tenant
target data
connection pool
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
CN201811477403.XA
Other languages
Chinese (zh)
Other versions
CN111277424B (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 Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811477403.XA priority Critical patent/CN111277424B/en
Publication of CN111277424A publication Critical patent/CN111277424A/en
Application granted granted Critical
Publication of CN111277424B publication Critical patent/CN111277424B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The utility model provides a connection pool maintenance method, which comprises the steps of obtaining an access request of a legal user, obtaining tenant information of a first tenant to which the legal user belongs based on the access request, determining a target data source based on the tenant information, and establishing a first connection pool under the condition that the first connection pool for accessing the target data source does not exist, so that the access request can access the target data source through the first connection pool. The disclosure also provides a connection pool maintenance device, an electronic device and a computer readable storage medium.

Description

Connection pool maintenance method and device and electronic equipment
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a connection pool maintenance method and apparatus, and an electronic device.
Background
In the current known technical scheme, a configuration file is added, multi-tenant data source configuration is loaded from the configuration file when the SaaS application is initialized, a multi-tenant multi-data source database connection pool is initialized when the application is started, once the data source configuration of a tenant is changed, the application needs to be stopped, and a plurality of configuration files on a SaaS application cluster are synchronously modified, so that normal use of a user is influenced.
Disclosure of Invention
In view of this, the present disclosure provides a connection pool maintenance method, device and electronic device.
One aspect of the present disclosure provides a connection pool maintenance method, including obtaining an access request of a valid user, obtaining tenant information of a first tenant to which the valid user belongs based on the access request, determining a target data source based on the tenant information, and establishing a first connection pool for accessing the target data source so that the access request realizes access to the target data source through the first connection pool in the absence of the first connection pool.
According to the embodiment of the disclosure, the determining a target data source based on the tenant information includes accessing a main data source based on a second connection pool, obtaining a tenant information table, where the tenant information table is used for recording a corresponding relationship between the tenant information and the target data source, and determining the target data source based on the tenant information and the tenant information table.
According to an embodiment of the present disclosure, the determining a target data source based on the tenant information and the tenant information table includes, when the tenant information table is in a non-occupied state, occupying the tenant information table through a thread lock, determining a target data source based on the tenant information and the tenant information table, and releasing the thread lock.
According to the embodiment of the present disclosure, in a case that the tenant information corresponds to a plurality of target data sources, obtaining at least one identification information based on the access request, wherein the determining a target data source based on the tenant information includes determining one target data source based on the tenant information and the at least one identification information, wherein the identification information includes application information.
According to the embodiment of the present disclosure, the management method further includes signing the first connection pool using the tenant information to exclude users not belonging to the first tenant from using the first connection pool.
Another aspect of the disclosure provides a connection pool maintenance apparatus, which includes a first obtaining module, a second obtaining module, a determining module, and an establishing module. The first obtaining module is used for obtaining the access request of the legal user. And the second obtaining module is used for obtaining the tenant information of the first tenant to which the legal user belongs based on the access request. A determining module for determining a target data source based on the tenant information. The establishing module is used for establishing the first connection pool under the condition that the first connection pool for accessing the target data source does not exist, so that the access request can access the target data source through the first connection pool.
According to an embodiment of the present disclosure, the determining module includes an obtaining sub-module and a determining sub-module. And the obtaining submodule is used for accessing the main data source based on the second connection pool and obtaining the tenant information table, wherein the tenant information table is used for recording the corresponding relation between the tenant information and the target data source. And the determining submodule is used for determining a target data source based on the tenant information and the tenant information table.
According to an embodiment of the present disclosure, the determination submodule includes an occupation unit, a determination unit, and a release unit. And the occupation unit is used for occupying the tenant information table through a thread lock when the tenant information table is in a non-occupation state. A determining unit, configured to determine a target data source based on the tenant information and the tenant information table. And the releasing unit is used for releasing the thread lock.
According to the embodiment of the present disclosure, the connection pool maintaining apparatus further includes a third obtaining module, configured to obtain at least one piece of identification information based on the access request if the tenant information corresponds to multiple target data sources, and the determining module is configured to determine one target data source based on the tenant information and the at least one piece of identification information, where the identification information includes application information.
According to the embodiment of the present disclosure, the connection pool maintaining apparatus further includes a signature module, configured to sign the first connection pool using the tenant information, so as to exclude users not belonging to the first tenant from using the first connection pool.
Another aspect of the disclosure provides an electronic device comprising at least one processor and at least one memory storing one or more computer-readable instructions, wherein the one or more computer-readable instructions, when executed by the at least one processor, cause the processor to perform the method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of the disclosure provides a computer program comprising computer executable instructions for implementing the method as described above when executed.
According to the embodiment of the disclosure, the dynamic configuration of the connection pool in the multi-tenant and multi-data-source scene is realized by establishing the connection pool according to the access request of the legal user, the service system does not need to be restarted to load the configuration information of the connection pool, and the maintenance difficulty of the system is reduced.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario of a connection pool maintenance method according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a connection pool maintenance method according to an embodiment of the present disclosure;
FIG. 3A schematically illustrates a flow diagram for determining a target data source based on the tenant information, according to an embodiment of the present disclosure;
FIG. 3B schematically illustrates a flow diagram for determining a target data source based on the tenant information and the tenant information table in accordance with an embodiment of the present disclosure;
FIG. 3C schematically illustrates a flow diagram of a connection pool maintenance method according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a block diagram of a connection pool maintenance device according to an embodiment of the present disclosure;
FIG. 5A schematically illustrates a block diagram of a determination module according to an embodiment of the disclosure;
FIG. 5B schematically illustrates a block diagram of a determining sub-module according to an embodiment of the disclosure;
FIG. 5C schematically illustrates a block diagram of a connection pool maintenance apparatus according to another embodiment of the present disclosure;
FIG. 5D schematically illustrates a block diagram of a connection pool maintenance apparatus according to another embodiment of the present disclosure; and
FIG. 6 schematically illustrates a block diagram of a computer system suitable for implementing a connection pool maintenance apparatus according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The embodiment of the disclosure provides a connection pool maintenance method, which is applied to a service system, wherein the service system comprises a plurality of data sources, each tenant renting the service system corresponds to at least one legal user, the service system allows the legal user to access at least one data source, the method comprises the steps of obtaining an access request of the legal user, obtaining tenant information of a first tenant to which the legal user belongs based on the access request, determining a target data source based on the tenant information, and establishing a first connection pool under the condition that the first connection pool for accessing the target data source does not exist, so that the access request can access the target data source through the first connection pool.
Fig. 1 schematically illustrates an application scenario of a connection pool maintenance method according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of an application scenario in which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, a plurality of data sources 130 can be provided for tenants 110 to rent in a service system, each tenant 110 renting the service system corresponds to at least one legal user, and the service system allows the legal user to access at least one data source 130. For example, a certain enterprise rents services in the service system, the enterprise becomes a tenant 110 of the service system, and part or all of employees of the enterprise may be registered as legitimate users under the tenant, and can enjoy the services of the service system, for example, having access to the data source 130 corresponding to the tenant.
When a certain legal user accesses data in a data source, connection needs to be established with the data source, and in order to improve the speed of establishing connection, connection can be established in a connection pool mode. The connection pool 120 stores the connection data of the corresponding data source, and the direct use of the data in the connection pool 120 can reduce the complexity of establishing connection and improve the efficiency. However, in the prior art, the corresponding relationship between the connection pool 120 and the tenants 110 and 130 is configured in the configuration file, and the connection pool 120 is initialized when the system is started, so that the problem arises that if any one of the data sources 130 or the tenants 110 changes, the configuration file needs to be modified, and the whole system needs to be restarted, which greatly affects the system efficiency and also affects the services normally used by other tenants in the system.
The method provided by the embodiment of the present disclosure can at least partially solve the above problem, and the method of the embodiment of the present disclosure is described below with reference to fig. 2.
Fig. 2 schematically illustrates a flow chart of a connection pool maintenance method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S240.
In operation S210, an access request of a legitimate user is obtained.
According to the embodiment of the disclosure, a legal user corresponds to a tenant, so that the system has access to at least one data source, and if the system judges that an access request is from an illegal user, the access request can be directly rejected.
In operation S220, based on the access request, tenant information of a first tenant to which the legitimate user belongs is obtained.
In operation S230, a target data source is determined based on the tenant information.
According to the embodiment of the disclosure, the service system comprises a main data source storing a tenant information table and a second connection pool used for accessing the main data source, wherein the tenant information table is used for recording the corresponding relation between the tenant information and the target data source.
Fig. 3A schematically illustrates a flowchart of determining a target data source based on the tenant information according to an embodiment of the present disclosure.
As shown in fig. 3A, the method includes operations S310 and S320.
In operation S310, the tenant information table is obtained based on the second connection pool accessing the primary data source.
According to the embodiment of the disclosure, the tenant information table can record information of the tenant, information of a legal user corresponding to the tenant, information of a data source, a password and other information, and at least record a corresponding relationship between the tenant and the data source, and according to the corresponding relationship, when an access request with tenant information is obtained, the data source to be accessed can be determined.
According to the embodiment of the disclosure, the main data source is a relatively stable data source, generally does not change, and is used for storing the tenant information table. The second connection pool is used for connecting the main data source, and initialization is completed when the system is started.
In operation S320, a target data source is determined based on the tenant information and the tenant information table.
According to the embodiment of the disclosure, access to the tenant information table can be realized through threads, and under the condition that the threads have the authority of modifying the tenant information table, if a plurality of threads access the tenant information table at the same time, stability of information in the tenant information table cannot be guaranteed.
Fig. 3B schematically illustrates a flowchart for determining a target data source based on the tenant information and the tenant information table according to an embodiment of the present disclosure.
As shown in fig. 3B, the method includes operations S321 to S323.
In operation S321, the tenant information table is occupied through a thread lock in a non-occupied state of the tenant information table.
In operation S322, a target data source is determined based on the tenant information and the tenant information table.
In operation S323, the thread lock is released.
According to the method, the access of the tenant information table is limited through the thread lock, the same thread is allowed to access the tenant information table at the same time, and the stability and the safety of the system are improved.
Fig. 3C schematically illustrates a flow chart of a connection pool maintenance method according to another embodiment of the present disclosure.
As shown in fig. 3C, the method includes operations S210, S220, S330, S340 and S240, wherein the operations S210, S220 and S240 are similar to those of the previous embodiment and are not repeated herein.
In operation S330, in case the tenant information corresponds to a plurality of target data sources, at least one identification information is obtained based on the access request.
In operation S340, a target data source is determined based on the tenant information and the at least one identification information.
According to the embodiment of the disclosure, a tenant may lease a plurality of data sources, and at this time, it is not enough to determine which data source needs to be connected according to tenant information, and the embodiment of the disclosure may additionally obtain at least one piece of identification information on the basis of the foregoing embodiment to determine the data source that the user requests to access. For example, in the case where each data source corresponds to an application, the identification information may include application information.
Reference is made back to fig. 2. In operation S240, in the absence of a first connection pool for accessing the target data source, the first connection pool is established such that the access request realizes access to the target data source through the first connection pool.
According to the embodiment of the disclosure, after determining a target data source to be accessed, it may be determined whether a first connection pool for accessing the target data source exists, if so, the target data source may be directly accessed through the first connection pool, and if not, the first connection pool is established.
The method of the embodiment of the invention creates the connection pool according to the access request of the legal user, realizes the dynamic configuration of the connection pool in the multi-tenant and multi-data-source scene, avoids loading the configuration information of the connection pool according to the fixed configuration file, does not need to restart the service system to establish the connection pool under the condition of increasing the data sources, and reduces the difficulty of system maintenance.
In addition, because the data source is established in the system operation, in order to avoid that the user accesses the data source which does not have the authority by using the connection pool established by other users, the method of the embodiment of the disclosure can also add an identity verification link in the use process of the connection pool, so as to improve the safety of tenant data. According to the embodiment of the present disclosure, the connection pool maintenance method further includes signing the first connection pool using the tenant information to exclude users not belonging to the first tenant from using the first connection pool.
Fig. 4 schematically illustrates a block diagram of a connection pool maintenance apparatus 400 according to an embodiment of the present disclosure. The connection pool maintenance apparatus 400 is used for managing a service system as described above, the service system includes a plurality of data sources, each tenant renting the service system corresponds to at least one legal user, and the service system allows the legal user to access at least one data source.
As shown in fig. 4, the connection pool maintenance apparatus 400 includes a first obtaining module 410, a second obtaining module 420, a determining module 430, and an establishing module 440.
The first obtaining module 410, for example, performs operation S210 described above with reference to fig. 2, for obtaining an access request of a legitimate user.
The second obtaining module 420, for example, performs the operation S220 described above with reference to fig. 2, for obtaining tenant information of the first tenant to which the legitimate user belongs based on the access request.
The determining module 430, for example, performs operation S230 described above with reference to fig. 2, for determining a target data source based on the tenant information.
The establishing module 440, for example, performs operation S240 described above with reference to fig. 2, for establishing the first connection pool in the absence of the first connection pool for accessing the target data source, so that the access request realizes access to the target data source through the first connection pool.
Fig. 5A schematically illustrates a block diagram of the determination module 430 according to an embodiment of the present disclosure.
According to the embodiment of the disclosure, the service system comprises a main data source storing a tenant information table and a second connection pool used for accessing the main data source, wherein the tenant information table is used for recording the corresponding relation between the tenant information and the target data source.
As shown in fig. 5A, the determination module 430 includes an obtaining sub-module 510 and a determining sub-module 520.
The obtaining sub-module 510, for example, performs the operation S310 described above with reference to fig. 3A, for accessing the primary data source based on the second connection pool, and obtaining the tenant information table.
The determining sub-module 520, for example, performs the operation S320 described above with reference to fig. 3A, for determining a target data source based on the tenant information and the tenant information table.
Fig. 5B schematically illustrates a block diagram of a determining sub-module 520 according to an embodiment of the disclosure.
As shown in fig. 5B, the determination submodule 520 includes an occupation unit 521, a determination unit 522, and a release unit 523.
The occupation unit 521, for example, performs the operation S321 described above with reference to fig. 3B, for occupying the tenant information table through a thread lock when the tenant information table is in a non-occupied state.
The determining unit 522, for example, performs the operation S322 described above with reference to fig. 3B, for determining a target data source based on the tenant information and the tenant information table.
The releasing unit 523, for example, performs the operation S323 described above with reference to fig. 3B for releasing the thread lock.
Fig. 5C schematically illustrates a block diagram of a connection pool maintenance device 5100, according to another embodiment of the present disclosure.
As shown in fig. 5C, the connection pool maintenance device 5100 further includes a third obtaining module 530 on the basis of the foregoing embodiment.
A third obtaining module 530, for example, performs operation S330 described above with reference to fig. 3C, for obtaining at least one piece of identification information based on the access request in a case that the tenant information corresponds to multiple target data sources.
Wherein the determining module 430, for example, performs the operation S340 described above with reference to fig. 3C, for determining one target data source based on the tenant information and the at least one identification information. According to an embodiment of the present disclosure, the identification information may be, for example, application information.
Fig. 5D schematically illustrates a block diagram of a connection pool maintenance apparatus 5200 in accordance with another embodiment of the present disclosure.
As shown in fig. 5D, the connection pool maintaining apparatus 5200 further includes a signature module, based on the foregoing embodiment, for signing the first connection pool with the tenant information to exclude users not belonging to the first tenant from using the first connection pool.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or the same in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in any suitable combination of any several of them. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the first obtaining module 410, the second obtaining module 420, the determining module 430, the establishing module 440, the obtaining sub-module 510, the determining sub-module 520, the occupying unit 521, the determining unit 522, the releasing unit 523, the third obtaining module 530 and the signature module may be combined to be implemented in one module, or any one of the modules may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first obtaining module 410, the second obtaining module 420, the determining module 430, the establishing module 440, the obtaining sub-module 510, the determining sub-module 520, the occupying unit 521, the determining unit 522, the releasing unit 523, the third obtaining module 530, and the signing module may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, or as any one of three manners of software, hardware, and firmware, or as a suitable combination of any of them. Alternatively, at least one of the first obtaining module 410, the second obtaining module 420, the determining module 430, the establishing module 440, the obtaining sub-module 510, the determining sub-module 520, the occupying unit 521, the determining unit 522, the releasing unit 523, the third obtaining module 530 and the signing module may be at least partially implemented as a computer program module which, when executed, may perform a corresponding function.
Fig. 6 schematically illustrates a block diagram of a computer system 600 suitable for implementing the above-described method according to an embodiment of the present disclosure. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 6, a computer system 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the system 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 606. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, system 600 may also include an input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 606. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (12)

1. A connection pool maintenance method, comprising:
obtaining an access request of a legal user;
based on the access request, acquiring tenant information of a first tenant to which the legal user belongs;
determining a target data source based on the tenant information; and
and under the condition that the first connection pool for accessing the target data source does not exist, establishing the first connection pool so that the access request realizes the access to the target data source through the first connection pool.
2. The management method of claim 1, wherein the determining a target data source based on the tenant information comprises:
accessing a main data source based on a second connection pool to obtain a tenant information table, wherein the tenant information table is used for recording the corresponding relation between the tenant information and the target data source; and
and determining a target data source based on the tenant information and the tenant information table.
3. The management method of claim 2, wherein the determining a target data source based on the tenant information and the tenant information table comprises:
when the tenant information table is in a non-occupied state, the tenant information table is occupied through a thread lock;
determining a target data source based on the tenant information and the tenant information table; and
and releasing the thread lock.
4. The management method of claim 1, further comprising:
obtaining at least one identification information based on the access request in a case that the tenant information corresponds to a plurality of target data sources,
the determining a target data source based on the tenant information comprises:
determining a target data source based on the tenant information and the at least one identification information, wherein the identification information comprises application information.
5. The management method of claim 1, further comprising:
signing the first connection pool using the tenant information to exclude users not belonging to the first tenant from using the first connection pool.
6. A connection pool maintenance device, comprising:
the first obtaining module is used for obtaining an access request of a legal user;
a second obtaining module, configured to obtain, based on the access request, tenant information of a first tenant to which the valid user belongs;
a determining module for determining a target data source based on the tenant information; and
the establishing module is used for establishing the first connection pool under the condition that the first connection pool for accessing the target data source does not exist, so that the access request can access the target data source through the first connection pool.
7. The apparatus of claim 6, wherein the means for determining comprises:
the obtaining submodule is used for accessing the main data source based on the second connection pool and obtaining the tenant information table, wherein the tenant information table is used for recording the corresponding relation between the tenant information and the target data source;
and the determining submodule is used for determining a target data source based on the tenant information and the tenant information table.
8. The apparatus of claim 7, wherein the determination submodule comprises:
the occupation unit is used for occupying the tenant information table through a thread lock when the tenant information table is in a non-occupation state;
a determining unit, configured to determine a target data source based on the tenant information and the tenant information table; and
and the releasing unit is used for releasing the thread lock.
9. The apparatus of claim 6, further comprising:
a third obtaining module for obtaining at least one identification information based on the access request in case the tenant information corresponds to a plurality of target data sources,
the determining module is configured to determine a target data source based on the tenant information and the at least one identification information, where the identification information includes application information.
10. The apparatus of claim 6, further comprising:
a signature module to sign the first connection pool using the tenant information to exclude users not belonging to the first tenant from using the first connection pool.
11. An electronic device, comprising:
one or more processors;
a memory for storing one or more computer programs,
wherein the one or more computer programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 5.
12. A computer readable medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN201811477403.XA 2018-12-04 2018-12-04 Connection pool maintenance method and device and electronic equipment Active CN111277424B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811477403.XA CN111277424B (en) 2018-12-04 2018-12-04 Connection pool maintenance method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811477403.XA CN111277424B (en) 2018-12-04 2018-12-04 Connection pool maintenance method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111277424A true CN111277424A (en) 2020-06-12
CN111277424B CN111277424B (en) 2022-09-06

Family

ID=71000071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811477403.XA Active CN111277424B (en) 2018-12-04 2018-12-04 Connection pool maintenance method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111277424B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777047A (en) * 2009-01-08 2010-07-14 国际商业机器公司 System, equipment and method for accessing database under multiple-tenant environment
US20150026405A1 (en) * 2013-06-06 2015-01-22 Oracle International Corporation System and method for providing a second level connection cache for use with a database environment
CN106503163A (en) * 2016-10-31 2017-03-15 用友网络科技股份有限公司 Based on the global configuration multi-tenant dynamic data origin system that SaaS is applied
CN107203575A (en) * 2016-03-18 2017-09-26 北京京东尚科信息技术有限公司 A kind of system, apparatus and method for being used to isolate multi-tenant data
US20170331813A1 (en) * 2016-05-11 2017-11-16 Oracle International Corporation Task segregation in a multi-tenant identity and data security management cloud service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101777047A (en) * 2009-01-08 2010-07-14 国际商业机器公司 System, equipment and method for accessing database under multiple-tenant environment
US20150026405A1 (en) * 2013-06-06 2015-01-22 Oracle International Corporation System and method for providing a second level connection cache for use with a database environment
CN107203575A (en) * 2016-03-18 2017-09-26 北京京东尚科信息技术有限公司 A kind of system, apparatus and method for being used to isolate multi-tenant data
US20170331813A1 (en) * 2016-05-11 2017-11-16 Oracle International Corporation Task segregation in a multi-tenant identity and data security management cloud service
CN106503163A (en) * 2016-10-31 2017-03-15 用友网络科技股份有限公司 Based on the global configuration multi-tenant dynamic data origin system that SaaS is applied

Also Published As

Publication number Publication date
CN111277424B (en) 2022-09-06

Similar Documents

Publication Publication Date Title
CN110414268B (en) Access control method, device, equipment and storage medium
US10831915B2 (en) Method and system for isolating application data access
US20110265176A1 (en) System and Method for Creating Conditional Immutable Objects in a Storage Device
US9973193B2 (en) Enabling a field programmable device on-demand
CN110138767B (en) Transaction request processing method, device, equipment and storage medium
CN109766708B (en) Data resource access method, system, computer system and storage medium
US20180239612A1 (en) Running a kernel-dependent application in a container
US20240012883A1 (en) Monitoring license constraints in a container orchestration system
US9026456B2 (en) Business-responsibility-centric identity management
US10104163B1 (en) Secure transfer of virtualized resources between entities
US10528708B2 (en) Prevention of unauthorized resource updates
CN111831453B (en) Information processing method, device, electronic equipment and medium
US9330276B2 (en) Conditional role activation in a database
US10248784B2 (en) Sequential object set passwords
CN111277424B (en) Connection pool maintenance method and device and electronic equipment
CN110417597B (en) Method and device for monitoring certificate, electronic equipment and readable storage medium
US20200311244A1 (en) Video-based authentication
US11914717B2 (en) Information handling systems and related methods to cryptographically verify information handling system platform components and track events associated with the platform components
CN107589970B (en) Plug-in calling method and device
US20180098102A1 (en) Limited use media access tokens
US10061614B2 (en) Resource management for untrusted programs
CN113761503B (en) Interface call processing method and device
US20200117822A1 (en) Dynamic authorization matrix and related systems, methods, and computer program products
US11392898B2 (en) Secure cloud collaboration platform
US11520769B1 (en) Block level lock on data table

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