WO2021000622A1 - 数据库访问方法和装置、计算设备和计算机程序产品 - Google Patents

数据库访问方法和装置、计算设备和计算机程序产品 Download PDF

Info

Publication number
WO2021000622A1
WO2021000622A1 PCT/CN2020/084353 CN2020084353W WO2021000622A1 WO 2021000622 A1 WO2021000622 A1 WO 2021000622A1 CN 2020084353 W CN2020084353 W CN 2020084353W WO 2021000622 A1 WO2021000622 A1 WO 2021000622A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
database access
access
service engine
scheduling module
Prior art date
Application number
PCT/CN2020/084353
Other languages
English (en)
French (fr)
Inventor
郭寿敏
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20834288.1A priority Critical patent/EP3951592B1/en
Publication of WO2021000622A1 publication Critical patent/WO2021000622A1/zh
Priority to US17/541,242 priority patent/US20220091902A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5055Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1029Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers using data related to the state of servers by a load balancer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2129Authenticate client device independently of the user

Definitions

  • This application relates to the field of databases, in particular to database access methods, database access initiation modules, database access service engines, database access scheduling modules, computing equipment, and computer program products.
  • the database connection pool is deployed inside the application.
  • a database connection pool only provides services for one application to access the database instance.
  • a single application can be distributed on multiple servers.
  • the database connection pool of the application is deployed on each server, and all connections in each database connection pool are used to connect to the same database instance.
  • a single application used to access the database connection pool of the same database instance on different servers cannot be shared between different servers.
  • connection protocol Internet Protocol, IP
  • port number the connection protocol used to establish the connection between the networks of the database instance.
  • this application provides a database access method, database access initiation module, database access service engine, computing equipment and computer program products to avoid exposing the IP address and port of the database instance to establish a database for accessing the database instance connection.
  • the database access scheduling module uses the identifier of the database access service engine (for example, the IP address of the database access service engine) to establish a communication connection with the database access service engine. Subsequently, the database access scheduling module receives the access request sent by the database access service engine, and the access request carries the identifier of the database instance. The database access scheduling module sends the access request to the database instance.
  • the database access service engine for example, the IP address of the database access service engine
  • the database access service engine when it receives the access request of the application, it can send the access request to the database instance through the database access scheduling module.
  • the database access scheduling module when the database access scheduling module sends a request to establish the communication connection to the database access service engine, the request carries the identifier of the database access service engine and the database access service The public key of the engine. In this way, the database access engine can authenticate whether to agree to establish a communication connection with the database access scheduling module based on the public key of the database access service engine.
  • the database access scheduling module uses the private key of the database access scheduling module to decrypt the access request from the encrypted access request, so as to send the decrypted access request to the database instance.
  • the database instance processes the access request and obtains the processing result, and sends the processing result to the database access scheduling module.
  • the database access scheduling module receives the processing result sent by the database instance. Then, the database access scheduling module sends the processing result to the database access service engine. In this way, the database access service engine implements access to the database instance through the access request.
  • the database access scheduling module uses the public key of the database access service engine to encrypt the processing result, so that the database access scheduling module sends the encrypted processing result to the database access service engine.
  • the application if the application needs to access the database instance, the application sends an access request of the application to the database access initiation module, and the access request carries the identifier of the database instance.
  • the database access initiation module When the database access initiation module receives the access request, it determines the database access service engine used to access the database instance, and sends the access request to the determined database access service engine.
  • the database access service engine is deployed independently of the application.
  • the database access service engine can establish a connection with a database access implementation module (such as a database instance, such as a database access scheduling module).
  • a database access implementation module such as a database instance, such as a database access scheduling module.
  • the database access service engine can send the access request to the database instance through the connection, and the database instance processes the access request.
  • the database access service engine can send the access request to the database access scheduling module through the connection.
  • the database access scheduling module can send the access request to the database instance, so that the database instance can process the access request.
  • this application implements the access to the database instance through the database access service engine independent of the application.
  • the connection used to access the database instance is established by the access service engine and not maintained by the application, thereby reducing the load of the application.
  • the database access initiation module when the database access initiation module receives the access request, the database access initiation module selects a database access service engine from a plurality of database access service engines, and sends the database access service engine to the selected database access service engine. Access request. In this way, multiple database access service engines can share the pressure of forwarding multiple access requests.
  • the database access initiation module when the database access initiation module receives the access request, the database access initiation module selects one database access service engine from the multiple database access service engines according to the load of the multiple database access service engines Service engine. In this way, load sharing can be achieved in multiple database access service engines.
  • the load of each database access service engine refers to the number of connections established by the database access service engine and a database access implementation module (such as a database instance, such as a database access scheduling module).
  • a database access implementation module such as a database instance, such as a database access scheduling module.
  • the database access initiation module when the database access initiation module receives the access request, the database access initiation module selects a database access service engine with the least load from a plurality of database access service engines.
  • the load of each database access service engine refers to the number of connections established by the database access service engine and a database access implementation module (such as a database instance, such as a database access scheduling module).
  • the database access initiation module when the database access initiation module receives the access request, if the access request carries the identifier of the database instance, and there is already a database access service engine that has established a connection with the database instance, Then determine the database access service engine bound to the identifier of the database instance.
  • the database access initiation module when the database access initiation module receives the access request, if the access request carries the identifier of the database access scheduling module, and there is already a database connected to the database access scheduling module The access service engine determines the database access service engine bound to the database access scheduling module. In this way, the database access initiation module sends the access request to the database access service engine, so that the database access scheduling module receives the access request from the database access service engine. Since the database instance specified by the access request is associated with the database access scheduling module, after the database access scheduling module receives the access request, the database access scheduling module can forward the access request to the database instance specified by the access request.
  • the database access service engine when the database access service engine receives the access request, the database access service engine establishes a connection between the database access service engine and the database instance according to the identifier of the database instance. In this way, based on the connection, data can be transmitted between the database access service engine and the database instance. For example, the database access service engine sends the access request to the database instance, for example, the database instance sends the access request to the database access service engine. Request the corresponding processing result.
  • the database access service engine when the database access service engine receives the access request, if the access request carries a keyword that identifies the connection, use the keyword to identify the access service engine in the database
  • the established connection with the database instance sends the access request to the database instance.
  • the application can use the same connection to access the same database instance based on the keyword.
  • the database access service engine when the database access service engine receives the access request, if the access request does not carry a keyword for identifying the connection, the database access service engine uses the identifier of the database instance Establish a connection between the database access service engine and the database instance. Since the access request does not carry a keyword for identifying the connection, even if there is an existing connection between the database access service engine and the database instance, the database access service engine still needs to create a new connection and use the newly created connection to The data related to the access request (for example, the access request or the processing result corresponding to the access request) is transmitted between the database access service engine and the database instance.
  • the database access service engine when the database access service engine receives the access request, if the access request carries the identifier of the database access scheduling module, the database access service engine sends the database access scheduling module to the database access scheduling module. The access request.
  • the application may specify the identifier of the database access scheduling module in the access request.
  • the database access service engine can determine the communication connection based on the identifier of the database access scheduling module; thus, the database access service engine can continue to use the communication connection to send an access request to the database access scheduling module.
  • the database instance after the database instance processes the access request and generates the processing result corresponding to the access request, if the database instance is directly connected to the database access service engine, the database instance sends to the database access service engine The processing result; if the database instance is connected to the database access scheduling module, the database instance sends the processing result to the database access scheduling module, so that the database access scheduling module forwards the processing result to the database access service engine.
  • the database access service engine sends the processing result to the database access initiation module.
  • the database access initiation module sends the processing result to the application.
  • the application can access the database instance through the access request, and obtain the processing result of the access request.
  • this application provides a database access device.
  • the functional modules included in the device are used to implement the steps performed by the database access initiation module in the first aspect or any possible design and provision of the first aspect, or to implement the second aspect or any possible design and provision of the second aspect The steps performed by the database access initiation module in the party.
  • This application provides another database access device.
  • the device includes functional modules that are used to implement the steps performed by the database access service engine in the first aspect or any possible design and provision of the first aspect, or to implement the second aspect or any possible design and provision of the second aspect The steps performed by the database access service engine in the method.
  • the device includes functional modules that are used to implement the steps performed by the database access implementation module (such as a database instance, such as a database access scheduling module) in the first aspect or any possible design of the first aspect, or to implement the first aspect
  • the steps performed by the database access implementation module (such as a database instance, such as a database access scheduling module) in the method provided by the second aspect or any possible design of the second aspect.
  • the present application provides a computing device, which includes a processor and a memory.
  • the memory stores computer instructions; the processor executes the computer instructions stored in the memory, so that the computing device executes the steps performed by the database access initiation module in the above-mentioned first aspect or various possible designs of the first aspect, or causes The computing device executes the steps performed by the database access service engine in the method provided by the foregoing first aspect or various possible designs of the first aspect, or causes the computing device to execute the foregoing first aspect or various possible designs of the first aspect
  • the steps performed by the database access implementation module such as a database instance, such as a database access scheduling module
  • the computing device executes the above-mentioned second aspect or various possible designs of the second aspect.
  • the steps executed by the access initiation module, or the computing device is caused to execute the steps performed by the database access service engine in the method provided in the second aspect or various possible designs of the second aspect, or the computing device is caused to execute the second aspect.
  • the steps performed by the database access implementation module (such as a database instance, such as a database access scheduling module) in the methods provided by various possible designs of the second aspect.
  • the present application provides a computer-readable storage medium that stores computer instructions.
  • the processor of a computing device executes the computer instructions
  • the computing device executes the first aspect or the first aspect.
  • the computing device executes the steps performed by the database access implementation module (such as a database instance, such as a database access scheduling module) in the methods provided by the first aspect or various possible designs of the first aspect, or the computing device executes the above The steps performed by the database access initiation module in the methods provided by the second aspect or various possible designs of the second aspect, or the computing device executes the steps provided by the second aspect or the methods provided by the various possible designs of the second aspect. Access the steps executed by the service engine, or the computing device executes the steps executed by the database access implementation module (such as a database instance, such as a database access scheduling module) in the above-mentioned second aspect or various possible designs of the second aspect.
  • the database access implementation module such as a database instance, such as a database access scheduling module
  • the present application provides a computer program product.
  • the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computing device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computing device executes the above-mentioned first aspect or the method provided by the various possible designs of the first aspect.
  • the steps performed by the database access implementation module (such as a database instance, such as a database access scheduling module), or the computing device executes the above-mentioned second aspect or various aspects of the second aspect
  • the steps performed by the database access initiation module in the provided method, or make the computing device execute the steps performed by the database access service engine in the above-mentioned second aspect or various possible designs of the second aspect, or make The computing device executes the steps performed by the database access implementation module (for example, a database instance, such as a database access scheduling module) in the methods provided by the foregoing second aspect or various possible designs of the second aspect.
  • Figure 1 is a schematic diagram of an application scenario to which this application applies;
  • Figure 2 is a schematic diagram of an application scenario applicable to this application.
  • FIG. 3 is a schematic diagram of an application scenario to which this application applies;
  • Figure 4 is a schematic flowchart of a method for accessing a database provided by this application.
  • FIG. 5 is a schematic flowchart of a method for accessing a database provided by this application.
  • FIG. 6 is a schematic diagram of a logical structure of the database access initiation module 600 provided by this application.
  • FIG. 7 is a schematic diagram of a logical structure of the database access service engine 700 provided by this application.
  • FIG. 8 is a schematic diagram of a logical structure of a database access scheduling module 800 provided by this application.
  • FIG. 9 is a schematic structural diagram of a computing device 900 provided by this application.
  • the database access initiation module (for example, the database access initiation module 111, the database access initiation module 112, and the database access initiation module 113) are used to receive the access request and forward the access request to the database access service engine.
  • the database access service engine (for example, the database access service engine 121, the database access service engine 122, and the database access service engine 123) are used to forward the access request to the database access implementation module.
  • the database access implementation module (for example, the database access implementation module 131, the database access implementation module 132, and the database access implementation module 133) are used to schedule or process the access request.
  • the database access service engine is independent of application deployment.
  • the database access service engine is not integrated into the application.
  • the database access service engine and the application are deployed on different servers. In this way, the database access service engine can serve different database access initiation modules.
  • the database access initiation module can be integrated into the application; optionally, the database access initiation module can be deployed independently of the application, for example, the application and the database access initiation module are deployed on the server where the application is located at the same time.
  • the database access initiation module can receive access requests from the application.
  • the access request may include a SQL-formatted statement, and “SQL-formatted statement” may be abbreviated as “SQL statement” below.
  • SQL statement the user can operate the application to input a SQL statement to trigger the application to generate an access request including the SQL statement.
  • the database access initiation module may be implemented in a software development kit (SDK).
  • SDK software development kit
  • each database access initiation module provides services for a single application. Specifically, each database access initiation module receives the access request generated by its responsible application. For example, the database access initiation module 111 may be responsible for receiving an access request of one application; the database access initiation module 112 and the database access initiation module 113 may be responsible for receiving an access request of another application at the same time. For example, the other application may send an access request to the database access initiation module 112 or the database access initiation module 113, so that the database access initiation module 112 and the database access initiation module 113 can implement load balancing for receiving the access request of the other application.
  • the database access initiation module can send an access request to the database access service engine.
  • the database access initiating module 111 may query the metadata database 14 and determine that the database access service engine with the least current load is the database access service engine 121 through the metadata database 14. Thus, the database access initiation module 111 sends an application access request to the database access service engine 121. Load balancing can be done between database access service engines.
  • the database access initiation module 111 records the binding relationship between the identifier of the database instance 231 and the database access service engine 121 in the metadata database 14. Subsequently, when the database access initiation module 111 receives a new access request of the application, if the new access request carries the identifier of the database instance 231, the database access initiation module 111 uses the identifier of the database instance 231 to find it in the metadata database 14. The binding relationship, thereby sending the new access request to the database access service engine 121 specified by the binding relationship.
  • IP Internet Protocol
  • the database access service engine 121 can establish a connection to access the database instance 231 according to the identifier of the database instance 231. In a possible implementation manner, after the database access service engine 121 successfully establishes a connection with the database instance 231, the database access service engine 121 records a key for identifying the connection.
  • the database access service engine 121 may also send the keyword to the database access initiation module 111 so that the database access initiation module 111 feeds back the keyword to the application.
  • the database access service engine 121 may also record the number of connections established by the database access service engine 121 in the metadata database 14. In this way, the more connections that belong to the database access service engine 121 recorded in the metabase 14, the greater the load of the database access service engine 121; on the contrary, the records in the metabase 14 belong to the database access service engine 121 The smaller the number of connections, the smaller the load of the database access service engine 121.
  • the metabase 14 records the number of connections that all database access service engines have; subsequently, the database access initiation module can perform load balancing among multiple database access service engines according to the number of connections, for example, according to the number of connections Select the database access service engine with the least load from the multiple database access service engines shown in FIG. 1.
  • the database access implementation module may be a database instance.
  • the database instance receives an access request sent by the database access service engine, the database instance processes the access request.
  • the database access implementation module 133 is a database instance 233, and after receiving an access request sent by the database access service engine 122, the database instance 233 according to the SQL statement carried in the access request.
  • the database access implementation module may be a database access scheduling module, and the database access scheduling module is in communication connection with at least one database instance.
  • the database access scheduling module receives the access request sent by the database access service engine
  • the database access scheduling module sends the access request to the database instance specified by the access request.
  • the database access scheduling module 333 receives the access request sent by the database access service engine 122, if the access request carries the identifier of the database instance 373, it sends the access request to the database instance 373.
  • the database access scheduling module 331 receives the access request sent by the database access service engine 121, if the access request carries the identifier of the database instance 372, it sends the access request to the database instance 372.
  • a possible implementation of this application as shown in Figure 3, if the database access scheduling module and the database access service engine are deployed in the same network; for example, the database access scheduling module 333 and the database access service engine 122 are both deployed in the public cloud to provide Services, that is, the database access scheduling module 333 and the database access service engine 122 are deployed in the network used by the public cloud.
  • the database access scheduling module 333 can access the database instance 373 and the database instance 374.
  • the database access scheduling module 333 After the database access scheduling module 333 receives the access request sent by the database access service engine 122, if the access request carries the identifier of the database instance 373, the access request is sent To the database instance 373, if the access request carries the identifier of the database instance 374, the access request is sent to the database instance 374.
  • both the database instance 373 and the database instance 374 are deployed in the public cloud to provide services, that is, the database instance 373 and the database instance 374 are both deployed in the network used by the public cloud.
  • the database access implementation module is the database access scheduling module 331 in the local area network.
  • the database access scheduling module 331 can access database instances in the local area network.
  • the database access scheduling module 331 in the local area network 381 receives the access request sent by the database access service engine 121; the database access scheduling module 331 sends the access request to the database instance 372 according to the identifier of the database instance 372 specified by the access request;
  • the database instance 372 processes the access request, for example, executes the SQL statement carried in the access request.
  • the database access service engine 122 records the identification of the database access scheduling module 332 and the database access service engine 122 in the metadata database 14. Subsequently, if the access request received by the database access initiation module 112 records the identification of the database access scheduling module 333, the database access initiation module 112 sends the database access service engine to the database access service engine according to the binding relationship recorded by the metabase 14 122 sends the access request, so that the database access service engine 122 finally forwards the access request to the database access scheduling module 333. It can be seen that the metadata database 14 records the binding relationship between the database access scheduling module and the database access service engine.
  • the database access service engine 121 is deployed in a public cloud, and the database access scheduling module 331 and multiple database instances (for example, database instance 371 and database instance 372) are deployed in a local area network 381.
  • the database access scheduling module 331 obtains the IP address of the database access service engine 121, for example, manually enters the IP address of the database access service engine 121 in the database access scheduling module 331; the database access scheduling module 331 uses the IP address to request a connection with the database access service engine 121
  • the communication connection for example, establishes a communication connection based on the Transmission Control Protocol (TCP).
  • TCP Transmission Control Protocol
  • the database access service engine 121 can establish a communication connection with the database access scheduling module 331, so that the database access service engine 121 in the public cloud can access multiple database instances in the local area network 381 through the database access scheduling module 331 (such as database instance 371). , Database instance 372).
  • the database access service engine 122 in the public cloud can access multiple database instances in the local area network 382 through the database access scheduling module 332 (not shown in FIG. 3).
  • the database access service engine in the public cloud can access the database instance in the local area network through the database access scheduling module.
  • the local area network is a private cloud network.
  • the database access service engine 121 records the data in the metadata database 14.
  • the binding relationship recorded in 14 sends the access request to the database access service engine 121, so that the database access service engine 121 forwards the access request to the database access scheduling module 331.
  • the database access service engine 122 records the identity of the database access scheduling module 332 and the database access service engine 122 in the metadata database 14. Binding relationship.
  • the database access service engine 122 records the binding relationship between the identifier of the database access scheduling module 333 and the database access service engine 122 in the metadata database 14. It can be seen that the application records the binding relationship between the database access scheduling module and the database access service engine in the metadata database 14.
  • the metadata database 14 records the binding relationship between the identifier of the database access scheduling module and the database access service engine; if The database access service engine directly connects to the database instance, and the binding relationship between the database instance and the database access service engine is recorded in the metadata database 14.
  • the database access initiation module searches the metadata database 14 to determine the destination of the access request
  • the database access service engine directly connects to the database access scheduling module
  • the database access scheduling carried by the access request is used.
  • the module identifier is used to find the binding relationship to determine the database access service engine. If the database access service engine directly connects to the database instance, the database instance identifier carried in the access request is used to find the binding relationship to determine the database access service engine.
  • Fig. 4 illustrates a flow of the database access method, and the flow includes step S411 to step S417.
  • Step S411 The application sends an access request to the database access initiation module.
  • the application sends an access request to the database access initiation module that provides services for the application.
  • the database access initiation module 111 provides services for an application; for an access request generated by the application, the application sends the access request to the database access initiation module 111.
  • the access request carries the identifier of the database instance.
  • the database instance used to process the access request can be determined through the identifier of the database instance.
  • the identifier of the database instance is the IP address of the database instance.
  • the identifier of the database instance is the IP address and port number of the database instance.
  • the identifier of the database instance includes the name of the database instance. In this way, it is possible to further determine whether the database instance is the database instance that needs to be accessed based on the name of the database instance.
  • the identifier of the database instance may be one or a combination of the following parameters: the IP address of the database instance, or the IP address and port number, or the name of the database instance.
  • the access request may include statements in SQL format.
  • the database instance can execute the SQL-formatted statement carried in the access request.
  • the access request carries the identifier of the service currently provided by the application.
  • Step S412 The database access initiation module determines the database access service engine associated with the database instance.
  • Step S413 The database access initiation module sends the access request to the determined database access service engine.
  • the database access initiation module selects a database access service engine from multiple database access service engines, and the database The access initiation module sends the access request to the selected database access service engine.
  • the database access initiation module records the binding relationship between the identifier of the database instance and the database access service engine in the metadata database 14.
  • the database access initiation module 111 when it receives an access request sent by an application, it can query the metadata database 14. If the query result is not the database instance allocation database specified by the database instance identifier carried by the access request To access the service engine, select one database access service engine from multiple database access service engines (for example, database access service engine 121, database access service engine 122, database access service engine 123), for example, select database access service engine 121. Thus, the database access initiation module 111 sends the access request to the database access service engine 121.
  • database access service engine 121 for example, database access service engine 121, database access service engine 122, database access service engine 123
  • the database access initiation module 111 when it receives an access request sent by an application, it can query the metadata database 14. If the query result is not the database instance allocation database specified by the database instance identifier carried by the access request To access the service engine, select one database access service engine from the multiple database access service engines according to the load of multiple database access service engines (for example, database access service engine 121, database access service engine 122, database access service engine 123), For example, select the database access service engine 121. Thus, the database access initiation module 111 sends the access request to the database access service engine 121.
  • multiple database access service engines for example, database access service engine 121, database access service engine 122, database access service engine 123
  • the database access initiation module 111 when it receives an access request sent by an application, it can query the metadata database 14. If the query result is not the database instance allocation database specified by the database instance identifier carried by the access request To access the service engine, select the database access service engine with the least load from multiple database access service engines (for example, database access service engine 121, database access service engine 122, database access service engine 123); suppose the database access service with the least current load The engine is the database access service engine 121, and the database access initiation module 111 sends the access request to the database access service engine 121. In addition, the database access initiation module 111 records the binding relationship between the database access service engine 121 and the identifier of the database instance in the metadata database 14.
  • database access service engine 121 for example, database access service engine 121, database access service engine 122, database access service engine 123
  • the database access initiation module 111 sends the access request to the database access service engine 121.
  • the database access initiation module 111 records the binding relationship between the database access service engine
  • the database access initiating module queries the metadata database 14 to determine the binding relationship specified Database access service engine.
  • the database access initiation module sends the access request to the determined database access service engine.
  • each database access service engine (for example, database access service engine 121 or database access service engine 122 or database access service engine 123) will periodically update its own load information (for example, the number of deployed connections) And the heartbeat information is recorded in the metadata database 14.
  • the database access initiation module uses the metabase 14 to determine the database access service engine for sending the access request, it can further use the heartbeat information of the database access service engine to determine whether the database access service engine is available; if the database access service engine is available If the engine is available, the database access initiation module executes step S413 to send the access request to the database access service engine; if the database access service engine is unavailable, the database access initiation module executes step S412 again to select a new The database access service engine.
  • the database access initiation module determines a possible implementation mode that the database access service engine is available, and the database access initiation module determines that the database access service engine is not down according to the heartbeat information of the database access service engine recorded in the metadata database 14, or Make sure that the database access service engine has not lost the communication connection.
  • Step S414 The database access service engine sends the access request to the database instance.
  • the connection refers to the connection between the database access service engine and the database instance specified by the access request
  • the database access service engine uses the connection to send the access request to the database instance. In this way, if a keyword identifying the connection is added to multiple access requests sent by the application, these access requests are all sent to the database instance through the same connection. If these multiple access requests are issued consecutively, they are sent to the database instance through the same connection, ensuring the transaction consistency of the transaction composed of these multiple access requests.
  • the database access service engine can create a new entry between the database access service engine and the database instance specified by the access request for the access request.
  • connection may be a communication connection, for example, a JDBC (Java database connectivity) connection.
  • the database access service engine For a newly established connection between the database access service engine and the database instance, the database access service engine records a key used to identify the connection. Taking Figure 2 as an example, the database access engine 121 will record the newly established connection between the database access service engine 121 and the database instance 231; the database access engine 122 will record the newly established connection between the database access service engine 122 and the database instance 232 Connection; the database access engine 122 records the keyword used to identify the connection, and records the binding relationship between the keyword and the database instance 231. Subsequently, the database access service engine 122 may determine the keyword through the binding relationship to determine the connection specified by the keyword.
  • the database access service engine still needs to create a new connection, using the newly created connection Connect to transmit data related to the access request (for example, the access request or the processing result corresponding to the access request) between the database access service engine and the database instance.
  • the database access service engine may also send the keyword to the database access initiation module that previously forwarded the access request, so that the database access initiation module feeds back the keyword to the application that previously generated the access request.
  • the application may add the keyword to the new access request. Accordingly, after the database access service engine receives the keyword through the database access initiation module, it will send the new access request to the database instance associated with the keyword. Therefore, it is ensured that the new access request with the keyword issued by the application is sent to the database instance for processing, and the consistency of the transaction composed of the multiple new access requests with the keyword is ensured.
  • the database access service engine 121 may send a keyword (used to identify the newly established connection) to the database access initiation module 111, so that The database access initiating module 111 feeds back the keyword to the application that previously generated the access request. Subsequently, the application can add the keyword to the new access request; accordingly, after the database access service engine 121 receives the keyword through the database access initiation module 111, it will send the new keyword to the database instance 231 associated with the keyword. Access request.
  • Step S415 The database instance sends the processing result corresponding to the access request to the database access service engine.
  • the database instance After the database instance receives the access request sent by the database access service engine, it will process the access request and obtain the processing result.
  • the database instance sends the processing result corresponding to the access request to the database access service engine.
  • the database instance 231 receives the access request sent by the access service engine 121, and the database instance 231 processes the access request, for example, executes the SQL format statement carried in the access request, for example, uses the SQL format statement to query data and obtain the query result.
  • the database instance 231 sends the processing result corresponding to the access request (for example, the query result) to the access service engine 121. If a JDBC connection is established between the database instance 231 and the access service engine 121, the JDBC connection is used to complete the transmission of the access request and the processing result between the database instance 231 and the access service engine 121.
  • Step S416 The database access service engine sends the processing result corresponding to the access request to the database access initiation module.
  • the database access service engine that previously forwarded the access request sends the processing result corresponding to the access request to the database access initiation module that previously forwarded the access request. For example, if the access request is forwarded to the database instance 231 through the database access initiation module 111 and the database access service engine 121, the database instance 231 sends the processing result corresponding to the access request to the database access service engine 121 so that the database The access service engine 121 sends the processing result to the database access initiation module 111.
  • Step S417 The database access initiating module sends the processing result corresponding to the access request to the application.
  • the database access initiation module that previously forwarded the access request sends the processing result corresponding to the access request to the application that generated the access request (that is, the application served by the database access initiation module).
  • the database access initiation module 111 receives the processing result corresponding to the access request from the access service engine 121, it sends the processing result to the application that previously generated the access request.
  • the application obtains the processing result corresponding to the access request, for example, obtains the query result obtained by querying the database instance 231 according to the SQL format statement included in the access request.
  • Fig. 5 illustrates a flow of the database access method, and the flow includes step S511 to step S521.
  • Step S511 the database access scheduling module establishes a communication connection with the database access engine.
  • the database access scheduling module and the database access service engine are deployed in the same network, and the database access scheduling module and the database access service engine can establish a communication connection in the network.
  • the database access scheduling module 333 and the database access service engine 122 are both deployed in a public cloud to provide services, that is, the database access scheduling module 333 and the database access service engine 122 are both deployed in the network used by the public cloud.
  • the database access scheduling module 333 uses the IP address of the database access service engine 122 to establish a communication connection with the database access service engine 122, or the database access service engine 122 uses the IP address of the database access scheduling module 333 to establish a communication connection with the database access scheduling module 333.
  • the database access scheduling module is located in the local area network.
  • the database access engine is not located in the local area network, that is, the database access engine is not located in the same local area network as the database access scheduling module.
  • the database access scheduling module 331 in the local area network 381 obtains the IP address of the database access service engine 121, for example, the IP address of the database access service engine 121 has been recorded in the database access scheduling module 331 in advance, for example, the database access scheduling module 331 is manually entered The IP address of the database access service engine 121.
  • the database access scheduling module 331 uses the IP address to actively request to establish a communication connection with the database access service engine 121 (for example, the communication connection may be a TCP-based communication connection).
  • the database access scheduling module 331 can establish a communication connection with the database access service engine 121.
  • the database access scheduling module 332 can use the IP address of the database access service engine 122 to actively establish a communication connection with the database access service engine 122;
  • the database access scheduling module 333 can use the IP address of the database access service engine 122 to actively establish a communication connection with the database access service engine 122 122 Establish a communication connection. It can be seen that each database access scheduling module can use the IP address of the database access service engine to actively establish a communication connection with the database access service engine.
  • the communication connection established between the database access scheduling module and the database access engine may be a communication connection based on TCP, or a communication connection established based on other protocols. Therefore, based on the communication connection, data can be transmitted between the database access scheduling module and the database access engine.
  • the database access scheduling module When the database access scheduling module successfully establishes a communication connection with the database access engine (for example, the communication connection may be a TCP-based communication connection), the database access engine records the binding relationship between the identifier of the database access scheduling module and the communication connection.
  • the database access engine When the database access scheduling module successfully establishes a communication connection with the database access engine (for example, the communication connection may be a TCP-based communication connection), the database access engine records the binding relationship between the identifier of the database access scheduling module and the communication connection.
  • the database access service engine 121 when the database access scheduling module 331 and the database access service engine 121 successfully establish a communication connection, the database access service engine 121 records the identifier of the database access scheduling module 331 and the communication connection (the database access scheduling module 331 and the database access service engine 121 Communication connection).
  • the database access service engine 122 When the database access scheduling module 332 and the database access service engine 122 successfully establish a communication connection, the database access service engine 122 records the identifier of the database access scheduling module 332 and the communication connection (the communication connection between the database access scheduling module 332 and the database access service engine 122) ) Binding relationship.
  • the database access service engine 122 When the database access scheduling module 333 successfully establishes a communication connection with the database access service engine 122, the database access service engine 122 records the identifier of the database access scheduling module 333 and the communication connection (the communication connection between the database access scheduling module 333 and the database access service engine 122) ) Binding relationship.
  • step S512 the database access engine records the binding relationship between the database access service engine that has established a communication connection and the database access scheduling module in the metadata database 14.
  • a single database access scheduling module actively requests to establish a communication connection with a single database access service engine. If the communication connection is established successfully, the database access engine records the database access scheduling module and the single database access service engine in the metadata database 14. The binding relationship of the database access service engine.
  • the binding relationship between a single database access scheduling module and a single database access service engine may specifically include the identifier of the database access scheduling module and the identifier of the database access service engine.
  • the database access scheduling module 332 can use the IP address of the database access service engine 122 to actively establish a communication connection with the database access service engine 122. If the communication connection is established successfully, the database access service engine 122 records the communication in the metadata database 14. The corresponding binding relationship is connected, and the binding relationship includes the identifier of the database access scheduling module 332 (such as the keyword of the database access scheduling module 332) and the identifier of the database access service engine 122 (such as the IP address of the database access service engine 122). Similarly, the database access scheduling module 333 can use the IP address of the database access service engine 122 to actively establish a communication connection with the database access service engine 122. If the communication connection is established successfully, the database access service engine 122 records the communication in the metadata database 14.
  • the binding relationship includes the identifier of the database access scheduling module 333 (such as the keyword of the database access scheduling module 333) and the identifier of the database access service engine 122 (such as the IP address of the database access service engine 122).
  • the load size of the database access service engine can be determined according to the number of binding relationships that a single database access service engine has recorded in the metadata database 14.
  • the binding relationship may be the binding relationship between the database access scheduling module and the database access service engine (for example, the binding relationship between the identifier of the database access scheduling module 333 and the identifier of the database access service engine 122
  • the binding relationship between the identification of the database access scheduling module 331 and the identification of the database access service engine 121), the binding relationship or the binding relationship between the identification of the database instance and the database access service engine for example, the identification of the database instance 374 and The binding relationship of the database access service engine 123).
  • all binding relationships of the database access service engine can be comprehensively considered to evaluate the load size of the database access service engine.
  • the database access initiation module can search the metabase 14 according to the identifier of the database access scheduling module carried in the access request, and find the binding relationship that matches the identifier of the database access scheduling module.
  • the access request is sent to the database access service engine specified by the binding relationship.
  • Step S513 The application sends an access request to the database access initiation module.
  • the application sends an access request to the database access initiation module that provides services for the application.
  • the database access initiation module 111 provides services for an application; for an access request generated by the application, the application sends the access request to the database access initiation module 111.
  • the access request carries the identifier of the database access scheduling module.
  • the identifier of the database access scheduling module may be the IP address of the database access scheduling module.
  • the identifier of the database access scheduling module may be the IP address and port number of the database access scheduling module.
  • the access request carries the identifier of the database instance.
  • the database instance used to process the access request can be determined through the identifier of the database instance.
  • the identifier of the database instance is the IP address of the database instance.
  • the identifier of the database instance is the IP address and port number of the database instance.
  • the identifier of the database instance includes the name of the database instance. In this way, it is possible to further determine whether the database instance is the database instance that needs to be accessed based on the name of the database instance.
  • the identifier of the database instance may be one or a combination of the following parameters: the IP address of the database instance, or the IP address and port number, or the database instance.
  • the access request may include statements in SQL format.
  • the database instance can execute the SQL-formatted statement carried in the access request.
  • the access request carries the identifier of the service currently provided by the application.
  • Step S514 The database access initiating module determines the database access service engine associated with the database access scheduling module.
  • Step S515 The database access initiation module sends the access request to the determined database access service engine.
  • the database access initiation module searches the metadata database 14 based on the identifier of the database access scheduling module carried in the access request, and finds the binding relationship that matches the identifier of the database access scheduling module.
  • the database access initiation module sends the access request to the database access service engine specified by the binding relationship.
  • the database access initiation module 113 uses the identifier of the database access scheduling module 333 carried in the access request to find the binding relationship corresponding to the identifier of the database access scheduling module 333 in the metadata database 14, and the binding relationship records the database access If the service engine 122 is identified, the database access initiating module 113 sends the access request to the database access service engine 122.
  • the database access initiation module 111 uses the identifier of the database access scheduling module 331 carried in the access request to find the binding relationship corresponding to the identifier of the database access scheduling module 331 in the metadata database 14, and the binding relationship records the database access If the service engine 121 is identified, the database access initiating module 111 sends the access request to the database access service engine 121.
  • Step S516 The database access service engine sends the access request to the database access scheduling module.
  • the access request carries the identifier of the database access scheduling module.
  • the database access service engine searches for the binding relationship that matches the identifier of the database access scheduling module.
  • the binding relationship records the identifier of the database access scheduling module and the database access service engine and the database. Access the communication connection between the scheduling modules. In this way, the database access service engine sends the access request to the database access scheduling module based on the communication connection.
  • the database access service engine 121 records the binding relationship between the identifier of the database access scheduling module 331 and the communication connection (the communication connection between the database access scheduling module 331 and the database access service engine 121).
  • the database access service engine 121 receives an access request, if the access request carries the identifier of the database access scheduling module 331, the database access service engine 121 sends the access request to the database access according to the communication connection recorded by the binding relationship. Scheduling module 331.
  • the database access service engine 122 records the binding relationship between the identifier of the database access scheduling module 332 and the communication connection (the communication connection between the database access scheduling module 332 and the database access service engine 122).
  • the database access service engine 122 receives an access request, if the access request carries the identifier of the database access scheduling module 332, the database access service engine 122 sends the access request to the database access according to the communication connection recorded by the binding relationship.
  • the scheduling module 332 is the binding relationship between the identifier of the database access scheduling module 332 and the communication connection (the communication connection between the database access scheduling module 332 and the database access service engine 122).
  • the database access service engine 122 records the binding relationship between the identifier of the database access scheduling module 333 and the communication connection (the communication connection between the database access scheduling module 333 and the database access service engine 122).
  • the database access service engine 122 receives an access request, if the access request carries the identifier of the database access scheduling module 333, the database access service engine 122 sends the access request to the database access according to the communication connection recorded by the binding relationship.
  • the scheduling module 333 is referring to FIG. 3, the database access service engine 122 records the binding relationship between the identifier of the database access scheduling module 333 and the communication connection (the communication connection between the database access scheduling module 333 and the database access service engine 122).
  • step S517 the database access scheduling module sends the access request to the database instance specified by the access request.
  • the access request carries the identifier of the database instance.
  • the database access scheduling module sends the access request to the database instance specified by the identifier.
  • the database access scheduling module and the database instance are located in the same local area network.
  • the database access scheduling module 331 when the database access scheduling module 331 receives an access request, if the access request carries the identifier of the database instance 371, the database access scheduling module 331 sends the access request to the database instance 371; The request carries the identifier of the database instance 372, and the database access scheduling module 331 sends the access request to the database instance 372, so that the database instance 372 can process the access request.
  • the database access scheduling module 333 when the database access scheduling module 333 receives an access request, if the access request carries the identifier of the database instance 373, the database access scheduling module 333 sends the access request to the database instance 373; if the access request carries the database instance 374 ID, the database access scheduling module 333 sends the access request to the database instance 374.
  • the database instance processes the access request and obtains the processing result.
  • the access request carries a statement in the SQL format
  • the database instance performs data query according to the statement in the SQL format to obtain the query result.
  • Step S518 The database instance sends the processing result corresponding to the access request to the database access scheduling module.
  • the database instance sends the processing result corresponding to the access request to the database access scheduling module that previously forwarded the access request to the database instance.
  • the database instance 371 processes the access request to obtain a processing result, and accordingly sends the processing result to the database access scheduling module 331.
  • the database instance 373 processes the access request to obtain the processing result, and sends the processing result to the database access scheduling module 333 accordingly.
  • Step S519 The database access scheduling module sends the processing result corresponding to the access request to the database access service engine.
  • the database access service engine is the database access service engine that previously sent the access request to the database access scheduling module. After the database access scheduling module obtains the processing result corresponding to the access request from the database instance, the database access scheduling module sends the processing result to the database access service engine.
  • the database access scheduling module 331 After receiving the processing result corresponding to the access request, the database access scheduling module 331 sends the processing result to the database access service engine 121 through the communication connection between the database access scheduling module 331 and the database access service engine 121.
  • the database access scheduling module 333 After receiving the processing result corresponding to the access request, the database access scheduling module 333 sends the processing result to the database access service engine 122 through the communication connection between the database access scheduling module 333 and the database access service engine 122.
  • Step S520 The database access service engine sends the processing result corresponding to the access request to the database access initiation module.
  • the database access service engine that previously forwarded the access request sends the processing result corresponding to the access request to the database access initiation module that previously forwarded the access request.
  • the database access scheduling module 331 sends the processing result corresponding to the access request to the database access service engine After 121, the database access service engine 121 sends the processing result to the database access initiation module 111.
  • the database access scheduling module 333 sends the processing result corresponding to the access request to the database access service engine After 122, the database access service engine 122 sends the processing result to the database access initiation module 112.
  • Step S521 The database access initiation module sends the processing result corresponding to the access request to the application.
  • the database access initiation module that previously forwarded the access request sends the processing result corresponding to the access request to the application that generated the access request (that is, the application served by the database access initiation module).
  • the database access initiation module 111 receives the processing result corresponding to the access request from the access service engine 121, it sends the processing result to the application that previously generated the access request.
  • the application obtains the processing result corresponding to the access request, for example, obtains the query result obtained by querying the database instance 231 according to the SQL format statement included in the access request.
  • the application can access the database instance in the local area network.
  • the application, database access initiation module 111, and access service engine 121 are all deployed in a public cloud, and the database access scheduling module 331, database instance 371, and database instance 372 are deployed in a private cloud.
  • the network used by the public cloud is different from the local area network 381 used by the private cloud.
  • the database access scheduling module 331 uses the IP address of the access service engine 121 in advance to successfully establish a communication connection with the access service engine 121. Based on the communication connection, the application can access the database access scheduling module 331 in the local area network 381 through the access service engine 121.
  • the access to the database instance in the local area network 381 (for example, the database instance 371 or the database instance 372) is indirectly realized.
  • step S511 the database access service engine
  • step S521 the application can access the database instance in the same network.
  • this application provides a database access method.
  • the steps included in the database access method are further optimized from the perspective of security.
  • step S511 when the database access scheduling module actively establishes a communication connection with the database access engine, it sends the public key of the database access engine to the database access engine so that the database access engine can check whether or not according to the public key. Agree to establish the authentication of the communication connection. In addition, if the communication connection is successfully established, the database access scheduling module uses the public key to encrypt data to be sent to the database access engine.
  • the database access engine 122 generates a public key and a private key used by the database access engine 122, and stores the public key and the private key in the metadata database 14.
  • the database access scheduling module uses the public key of the database access engine 122 to request to establish a communication connection with the database access engine 122, and the database access engine 122 uses the public key to query the metabase 14, if the metabase 14 records that the public key is the database access engine 122 The authentication is successful, and the database access engine 122 successfully establishes a communication connection with the database access scheduling module.
  • the database access scheduling module uses the public key of the database access engine 122 for encryption, and then sends the encrypted data to the database access engine 122 based on the communication connection.
  • step S5128 for the processing result corresponding to the access request sent by the database access scheduling module to the database access engine, the database access scheduling module uses the public key of the database access engine to encrypt the processing result, and then sends The database access engine sends the encrypted processing result.
  • the database access scheduling module 333 uses the public key of the database access engine 122 for the processing result Encrypt, and send the encrypted processing result to the database access engine 122.
  • a possible implementation is that the data sent by the database access engine to the database access scheduling module (for example, the access request generated by the application) is encrypted using the public key of the database access scheduling module, and the database access engine sends to the database access scheduling module Encrypted data.
  • the database access scheduling module uses the private key of the database access scheduling module to decrypt the data from the encrypted data.
  • the database access scheduling module 332 generates a public key and a private key used by the database access scheduling module 332, and saves the public key and the private key.
  • the database access scheduling module 332 sends the public key to the database access engine 122.
  • the database access engine 122 uses the public key to encrypt the access request, and then sends the encrypted access request to the database access scheduling module 332.
  • the database access scheduling module 332 uses the private key to decrypt the access request from the encrypted access request.
  • the application also provides a database access initiation module (for example, the database access initiation module 111 or the database access initiation module 112 or the database access initiation module 113), which is deployed on the computing device (for example, the server) of the application.
  • the database access initiation module includes functional units for the database access initiation module to implement the above-mentioned database access method; this application does not limit how to divide the functional units in the database access initiation module.
  • the following example provides a functional unit Division, as shown in Figure 6.
  • the database access initiation module 600 includes:
  • the receiving unit 602 is configured to receive an access request of the application, where the access request carries the identifier of the database instance;
  • the determining unit 601 is configured to determine a database access service engine, where the database access service engine is independent of the application, and the database access service engine is configured to establish a connection for accessing the database instance;
  • the sending unit 603 sends the access request to a determined database access service engine, the database access service engine having the ability to send the access request to the database instance
  • the determining unit 601 is configured to select a database access service engine from a plurality of database access service engines.
  • the determining unit 601 is configured to select a database access service engine from the multiple database access service engines according to the load of the multiple database access service engines.
  • the determining unit 601 is configured to select a database access service engine with the smallest load from a plurality of database access service engines.
  • the determining unit 601 is configured to determine the database access service engine bound to the identifier of the database instance according to the identifier of the database instance carried in the access request.
  • the determining unit 601 is configured to determine the database access service engine bound to the database access scheduling module according to the identifier of the database access scheduling module carried in the access request, and the database access scheduling module is configured to The access request received by the database access service engine is sent to the database instance.
  • the receiving unit 602 is configured to receive the processing result corresponding to the access request sent by the database access service engine; accordingly, the sending unit 603 is configured to send the processing result to the application.
  • the application also provides a database access service engine (for example, the database access service engine 121 or the database access service engine 122 or the database access service engine 123), which is deployed on the computing device (for example, the server) of the application.
  • the database access service engine includes functional units for the database access initiation module to implement the above database access method; this application does not limit how to divide the functional units in the database access service engine.
  • the following example provides a functional unit Division, as shown in Figure 7.
  • the database access service engine 700 includes:
  • the receiving unit 701 is configured to receive an access request sent by a database access initiation module, where the access request carries an identifier of the database instance;
  • the sending unit 702 is configured to send the access request to the database instance, or send the access request to a database access scheduling module associated with the database instance.
  • the database access service engine includes:
  • the connection establishment unit 703 is configured to establish a connection between the database access service engine and the database instance according to the identifier of the database instance, and the connection is used to transfer data between the database access service engine and the database instance .
  • the sending unit 702 is configured to, according to the keywords carried in the access request, use the established connection between the database access service engine and the database instance identified by the keyword to send the The instance sends the access request.
  • the sending unit 702 is configured to send the access request to the database access scheduling module according to the identifier of the database access scheduling module carried in the access request.
  • the receiving unit 701 is configured to receive the processing result corresponding to the access request sent by the database instance, or receive the processing result corresponding to the access request sent by the database access scheduling module;
  • the sending unit 702 is configured to send the processing result corresponding to the access request to the database access initiation module.
  • the application also provides a database access scheduling module (for example, the database access scheduling module 331 or the database access scheduling module 332 or the database access scheduling module 333), which is deployed on the computing device (for example, the server) of the application.
  • the database access scheduling module includes functional units for the database access scheduling module to implement the above-mentioned database access method; this application does not limit how to divide the functional units in the database access scheduling module.
  • the following example provides a functional unit Division, as shown in Figure 8.
  • the database access scheduling module 800 shown in FIG. 8 is characterized in that the database access scheduling module 800 includes:
  • the connection establishment unit 803 is configured to use the identifier of the database access service engine to establish a communication connection with the database access service engine;
  • the receiving unit 801 is configured to receive an access request sent by the database access service engine, where the access request carries an identifier of the database instance;
  • the sending unit 802 is configured to send the access request to the database instance.
  • the identifier of the database access service engine is an IP address of the database access service engine.
  • connection establishment unit 803 is configured to send a request for establishing the communication connection to the database access service engine, where the request carries the identifier of the database access service engine and the public key of the database access service engine, The public key of the database access service engine is used for the authentication of the database access engine to establish the communication connection.
  • the database access scheduling module 800 includes:
  • the decryption unit 804 is configured to use the database access scheduling module when the access request received by the database access scheduling module from the database access service engine is an access request encrypted based on the public key of the database access scheduling module The private key for decrypts the access request from the encrypted access request, so that the sending unit 802 sends the decrypted access request to the database instance.
  • the receiving unit 801 is configured to receive a processing result corresponding to the access request sent by the database instance;
  • the sending unit 802 is configured to send the processing result to the database access service engine.
  • the database access scheduling module 800 includes:
  • the encryption unit 805 is configured to encrypt the processing result using the public key of the database access service engine, so that the sending unit 802 sends the encrypted processing result to the database access service engine.
  • FIG. 9 schematically provides a possible basic hardware architecture of the computing device described in this application.
  • the computing device 900 includes a processor 901, a memory 902, a communication interface 903, and a bus 904.
  • the number of processors 901 may be one or more, and FIG. 9 only illustrates one of the processors 901.
  • the processor 901 may be a central processing unit (CPU). If the computing device 900 has multiple processors 901, the types of the multiple processors 901 may be different or may be the same.
  • multiple processors 901 of the computing device 900 may also be integrated into a multi-core processor.
  • the memory 902 stores computer instructions and data; the memory 902 can store computer instructions and data required to implement the database access method provided by the present application.
  • the memory 902 stores instructions for implementing steps performed by the database access initiation module in the database access method.
  • the memory 902 stores instructions for implementing steps executed by the database access service network engine in the database access method, and for another example, the memory 902 stores instructions for implementing the database access implementation module (such as database instance, For example, the database access scheduling module) executes the instructions of the steps.
  • the memory 902 may be any one or any combination of the following storage media: non-volatile memory (for example, read only memory (ROM), solid state drive (SSD), hard disk (HDD), optical disk)), volatile memory.
  • the communication interface 903 may be any one or any combination of the following devices: a network interface (for example, an Ethernet interface), a wireless network card, and other devices with a network access function.
  • the communication interface 903 is used for data communication between the computing device 900 and other computing devices or terminals.
  • FIG. 9 shows the bus 904 with a thick line.
  • the bus 904 can connect the processor 901 with the memory 902 and the communication interface 903. In this way, through the bus 904, the processor 901 can access the memory 902, and can also use the communication interface 903 to interact with other computing devices or terminals.
  • the computing device 900 executes the computer instructions in the memory 902, so that the computing device 900 implements the database access method provided in this application, for example, causes the computing device to execute the database access initiation module in the above database access method.
  • the computing device is caused to execute the steps executed by the database access service engine in the above database access method, and for another example, the computing device is caused to execute the database access implementation module (such as database instance) in the above database access method. , Such as database access scheduling module).
  • This application provides a computer-readable storage medium in which computer instructions are stored.
  • the computing device 900 executes the database access method described above. Initiate the steps executed by the module, or the computing device 900 executes the steps executed by the database access service engine in the above database access method, or the computing device 900 executes the database access implementation module (such as a database instance, such as The steps performed by the database access scheduling module).
  • the present application provides a computer program product.
  • the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor 901 of the computing device 900 can read the computer instructions from a computer-readable storage medium, and the processor 901 executes the computer instructions, so that the computing device 900 executes the steps performed by the database access initiation module in the database access method described above, so that The computing device 900 executes the steps executed by the database access service engine in the above database access method, so that the computing device 900 executes the steps executed by the database access implementation module (such as a database instance, such as a database access scheduling module) in the above database access method. step.
  • the database access implementation module such as a database instance, such as a database access scheduling module
  • the present application provides a computer program product.
  • the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor 901 of the computing device 900 can read the computer instructions from a computer-readable storage medium, and the processor 901 executes the computer instructions, so that the computing device 900 executes the steps performed by the database access initiation module in the database access method described above, so that The computing device 900 executes the steps executed by the database access service engine in the above database access method, so that the computing device 900 executes the steps executed by the database access implementation module (such as a database instance, such as a database access scheduling module) in the above database access method. step.
  • the database access implementation module such as a database instance, such as a database access scheduling module

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种数据库访问方法、数据库访问调度模块、计算设备和计算机程序产品。在该方法中,数据库访问调度模块(331-333)使用数据库访问服务引擎(121-123)的标识(例如数据库访问服务引擎的IP地址)与该数据库访问服务引擎(121-123)建立通信连接。该数据库访问调度模块(331-333)接收该数据库访问服务引擎(121-123)发送的访问请求,该访问请求携带有数据库实例(371-375)的标识。该数据库访问调度模块(331-333)向所述数据库实例(371-375)发送所述访问请求。这样,基于数据库访问调度模块(331-333)主动与数据库访问服务引擎(121-123)建立的通信连接,该数据库访问服务引擎(121-123)接收到应用的访问请求时,可以通过该数据库访问调度模块(331-333)向所述数据库实例发送所述访问请求。

Description

数据库访问方法和装置、计算设备和计算机程序产品 技术领域
本申请涉及数据库领域,尤其涉及数据库访问方法、数据库访问发起模块、数据库访问服务引擎、数据库访问调度模块、计算设备和计算机程序产品。
背景技术
现有技术中,数据库连接池部署在应用内部。一个数据库连接池只为一个应用提供访问数据库实例的服务。
另外,单个应用可以分布式地部署在多个服务器上。每个服务器上部署该应用的数据库连接池,每个数据库连接池中的所有连接用于连接同一个数据库实例。换句话说,如果该个应用需要通过每个服务器连接多个数据库实例,则在每个服务器上均需要针对每个数据库实例部署一个连接池。但是,单个应用在不同服务器上用于访问同一数据库实例的数据库连接池,也不能在不同服务器之间共享。
另外,现有技术中,在建立连接池中的连接来访问数据库实例时,是使用数据库实例的网络之间互连的协议(Internet Protocol,IP)地址和端口(port)号)来建立该连接。
发明内容
有鉴于此,本申请提供了一种数据库访问方法、数据库访问发起模块、数据库访问服务引擎、计算设备和计算机程序产品,避免暴漏数据库实例的IP地址和端口来建立用于访问该数据库实例的连接。
第一方面,在本申请提供的数据库访问方法中,数据库访问调度模块使用数据库访问服务引擎的标识(例如数据库访问服务引擎的IP地址)与该数据库访问服务引擎建立通信连接。后续,该数据库访问调度模块接收该数据库访问服务引擎发送的访问请求,该访问请求携带有数据库实例的标识。该数据库访问调度模块向所述数据库实例发送所述访问请求。
这样,基于数据库访问调度模块主动与数据库访问服务引擎建立的通信连接,该数据库访问服务引擎接收到应用的访问请求时,可以通过该数据库访问调度模块向所述数据库实例发送所述访问请求。
第一方面的一种可能设计,在数据库访问调度模块向所述数据库访问服务引擎发送建立所述通信连接的请求时,在该请求中携带所述数据库访问服务引擎的标识和所述数据库访问服务引擎的公钥。这样,所述数据库访问引擎可以基于该数据库访问服务引擎的公钥对是否同意与该数据库访问调度模块建立通信连接进行鉴权。
第一方面的一种可能设计,在所述数据库访问调度模块从所述数据库访问服务引擎接收的所述访问请求为基于所述数据库访问调度模块的公钥加密的访问请求时,所述数据库访问调度模块使用所述数据库访问调度模块的私钥从加密的访问请求中解密出访问请求,以便向所述数据库实例发送解密的访问请求。
第一方面的一种可能设计,数据库实例处理该访问请求并得到处理结果,并将该处理结果发送数据库访问调度模块。该数据库访问调度模块接收该数据库实例发送的该处理结果。然后,该数据库访问调度模块向该数据库访问服务引擎发送所述处理结果。这样,数据库访问服务引擎通过该访问请求实现了对该数据库实例的访问。
可选地,数据库访问调度模块使用所述数据库访问服务引擎的公钥对所述处理结果加密,以便所述数据库访问调度模块向所述数据库访问服务引擎发送加密的所述处理结果。
第二方面,在本申请提供的数据库访问方法中,如果应用需要访问数据库实例,则该应用向数据库访问发起模块发送应用的访问请求,该访问请求携带数据库实例的标识。
该数据库访问发起模块在接收到该访问请求时,确定用于访问该数据库实例的数据库访问服务引擎,向确定的数据库访问服务引擎发送所述访问请求。该数据库访问服务引擎是独立于该应用部署的。
该数据库访问服务引擎可以与数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)建立连接。
如果该连接是建立在数据库访问服务引擎与数据库实例之间的,则该数据库访问服务引擎可以通过该连接向该数据库实例发送该访问请求,该数据库实例处理该访问请求。
如果该连接是建立在数据库访问服务引擎与数据库访问调度模块之间的,则该数据库访问服务引擎可以通过该连接向该数据库访问调度模块发送该访问请求。这样,该数据库访问调度模块可以将该访问请求发送至该数据库实例,从而该数据库实例可以处理该访问请求。
相比于现有技术是使用应用内部的连接池提供的连接来访问数据库实例,本申请是通过独立于应用的数据库访问服务引擎来实现对数据库实例的访问。另外,用于访问数据库实例的连接是访问服务引擎建立的,并非应用维护的,从而减少了应用的负载。
第二方面的一种可能设计,该数据库访问发起模块在接收到该访问请求时,数据库访问发起模块从多个数据库访问服务引擎中选择一个数据库访问服务引擎,向选择的数据库访问服务引擎发送该访问请求。这样,多个数据库访问服务引擎可以分担转发多个访问请求的压力。
第二方面的一种可能设计,该数据库访问发起模块在接收到该访问请求时,数据库访问发起模块根据多个数据库访问服务引擎的负载,从所述多个数据库访问服务引擎中选择一个数据库访问服务引擎。这样,可以在多个数据库访问服务引擎实现负载分担。
可选地,每个数据库访问服务引擎的负载,是指该个数据库访问服务引擎与数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)建立的连接的条数。条数越多,则该个数据库访问服务引擎的负载越大;反之,条数越少,则该个数据库访问服务引擎的负载越小。
第二方面的一种可能设计,该数据库访问发起模块在接收到该访问请求时,数据库访问发起模块从多个数据库访问服务引擎中选择负载最小的数据库访问服务引擎。可选地,每个数据库访问服务引擎的负载,是指该个数据库访问服务引擎与数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)建立的连接的条数。
第二方面的一种可能设计,该数据库访问发起模块在接收到该访问请求时,如果该 访问请求携带所述数据库实例的标识,并且已存在与该数据库实例建立了连接的数据库访问服务引擎,则确定与所述数据库实例的标识绑定的数据库访问服务引擎。
第二方面的一种可能设计,该数据库访问发起模块在接收到该访问请求时,如果所述访问请求携带的数据库访问调度模块的标识,并且已存在与该数据库访问调度模块建立了连接的数据库访问服务引擎,确定与所述数据库访问调度模块绑定的数据库访问服务引擎。这样,该数据库访问发起模块向该数据库访问服务引擎发送该访问请求,从而所述数据库访问调度模块才会从所述数据库访问服务引擎接收到所述访问请求。由于该访问请求指定的数据库实例是与该数据库访问调度模块关联的,待该数据库访问调度模块接收到该访问请求,该数据库访问调度模块才能够转发该访问请求至该访问请求指定的数据库实例。
第二方面的一种可能设计,所述数据库访问服务引擎在接收到该访问请求时,该数据库访问服务引擎根据所述数据库实例的标识建立所述数据库访问服务引擎与所述数据库实例的连接。这样,基于该连接,在所述数据库访问服务引擎与所述数据库实例之间可以传输数据,例如数据库访问服务引擎向数据库实例发送该访问请求,例如该数据库实例向该数据库访问服务引擎发送该访问请求对应的处理结果。
第二方面的一种可能设计,所述数据库访问服务引擎在接收到该访问请求时,如果所述访问请求携带了标识连接的关键字,使用所述关键字标识的在所述数据库访问服务引擎与所述数据库实例之间已建立的连接,向所述数据库实例发送所述访问请求。这样,如果该关键字是应用指定的,该应用可以基于该关键字来实现使用同一连接访问同一数据库实例。
第二方面的一种可能设计,所述数据库访问服务引擎在接收到该访问请求时,如果所述访问请求没有携带用于标识连接的关键字,该数据库访问服务引擎根据所述数据库实例的标识建立所述数据库访问服务引擎与所述数据库实例的连接。由于该访问请求没有携带用于标识连接的关键字,即使存在所述数据库访问服务引擎与所述数据库实例之间的已有连接,该数据库访问服务引擎仍需要新建一条连接,使用新建的连接来在所述数据库访问服务引擎与所述数据库实例之间传输该访问请求相关的数据(例如该访问请求或者该访问请求对应的处理结果)。
第二方面的一种可能设计,所述数据库访问服务引擎在接收到该访问请求时,如果所述访问请求携带有数据库访问调度模块的标识,数据库访问服务引擎向所述数据库访问调度模块发送所述访问请求。
举例说明,在该数据库访问服务引擎与该数据库访问调度模块之间已经建立了通信连接的情况下,应用可以在访问请求中指定数据库访问调度模块的标识。这样,数据库访问服务引擎可以基于数据库访问调度模块的标识,确定该通信连接;从而,数据库访问服务引擎可以继续使用该通信连接,来实现向该数据库访问调度模块发送访问请求。
如果是多个应用分别在自己的访问请求中指定了相同的数据库访问调度模块的标识,则可以共用数据库访问服务引擎、在该数据库访问服务引擎与该数据库访问调度模块之间的通信连接和该数据库访问调度模块来实现这些访问请求的相关数据的传输。
第二方面的一种可能设计,在数据库实例处理访问请求并生成该访问请求对应的处理结果之后,如果该数据库实例是直接与数据库访问服务引擎连接的,则该数据库实例 向数据库访问服务引擎发送该处理结果;如果该数据库实例是与数据库访问调度模块连接的,则该数据库实例向该数据库访问调度模块发送该处理结果,以便,该数据库访问调度模块将该处理结果转发至数据库访问服务引擎。
该数据库访问服务引擎向该数据库访问发起模块发送该处理结果。相应地,该数据库访问发起模块向该应用发送该处理结果。
这样,应用可以通过访问请求实现对该数据库实例的访问,并得到该访问请求的处理结果。
第三方面,本申请提供一种数据库访问装置。该装置包括的功能模块,用于实现第一方面或第一方面的任意可能设计提供的方中由数据库访问发起模块执行的步骤,或者用于实现第二方面或第二方面的任意可能设计提供的方中由数据库访问发起模块执行的步骤。
本申请提供另一种数据库访问装置。该装置包括的功能模块,用于实现第一方面或第一方面的任意可能设计提供的方中由数据库访问服务引擎执行的步骤,或者用于实现第二方面或第二方面的任意可能设计提供的方法中由该数据库访问服务引擎执行的步骤。
本申请提供另一种数据库访问装置。该装置包括的功能模块,用于实现第一方面或第一方面的任意可能设计提供的方中由数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤,或者用于实现第二方面或第二方面的任意可能设计提供的方法中由该数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤。
第三方面,本申请提供一种计算设备,该计算设备包括处理器和存储器。该存储器存储计算机指令;该处理器执行该存储器存储的计算机指令,使得该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由数据库访问发起模块执行的步骤,或者使得该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由该数据库访问服务引擎执行的步骤,或者使得该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由该数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤,或者使得该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方法中由数据库访问发起模块执行的步骤,或者使得该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方法中由该数据库访问服务引擎执行的步骤,或者使得该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方法中由该数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤。
第四方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当计算设备的处理器执行该计算机指令时,该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由数据库访问发起模块执行的步骤,或者该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由该数据库访问服务引擎执行的步骤,或者该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由该数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤,或者该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方 法中由数据库访问发起模块执行的步骤,或者该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方法中由该数据库访问服务引擎执行的步骤,或者该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方法中由该数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤。
第五方面,本申请提供一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算设备的处理器可以从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由数据库访问发起模块执行的步骤,或者使得该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由该数据库访问服务引擎执行的步骤,或者使得该计算设备执行上述第一方面或者第一方面的各种可能设计提供的方法中由该数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤,或者使得该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方法中由数据库访问发起模块执行的步骤,或者使得该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方法中由该数据库访问服务引擎执行的步骤,或者使得该计算设备执行上述第二方面或者第二方面的各种可能设计提供的方法中由该数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤。
附图说明
图1为本申请适用的应用场景中的一种示意图;
图2为本申请适用的应用场景中的一种示意图;
图3为本申请适用的应用场景中的一种示意图;
图4为本申请提供的数据库访问方法的一种流程示意图;
图5为本申请提供的数据库访问方法的一种流程示意图;
图6为本申请提供的数据库访问发起模块600的一种逻辑结构示意图;
图7为本申请提供的数据库访问服务引擎700的一种逻辑结构示意图;
图8为本申请提供的数据库访问调度模块800的一种逻辑结构示意图;
图9为本申请提供的计算设备900的一种结构示意图。
具体实施方式
下面将结合本申请中的附图,对本申请提供的技术方案进行描述。
图1提供了本申请适用的一种可能场景。数据库访问发起模块(例如数据库访问发起模块111、数据库访问发起模块112、数据库访问发起模块113),用于接收访问请求,和将该访问请求转发至数据库访问服务引擎。该数据库访问服务引擎(例如数据库访问服务引擎121、数据库访问服务引擎122、数据库访问服务引擎123),用于将该访问请求转发至数据库访问实现模块。该数据库访问实现模块(例如数据库访问实现模块131、数据库访问实现模块132、数据库访问实现模块133),用于调度或者处理该访问请求。
本申请中,该数据库访问服务引擎独立于应用部署。例如,该数据库访问服务引擎没有集成到该应用中。例如,该数据库访问服务引擎与该应用部署在不同服务器上。这 样,该数据库访问服务引擎可以为不同数据库访问发起模块服务。
可选地,该数据库访问发起模块可以集成到应用中;可选地,该数据库访问发起模块可以独立于该应用部署,例如该应用和该数据库访问发起模块同时部署在该应用所在的服务器上。
该数据库访问发起模块,可以接收来自该应用的访问请求。一种可能的实现方式,该访问请求可以包括SQL格式的语句,下文可以简称“SQL格式的语句”为“SQL语句”。例如,用户可以操作该应用来录入SQL语句,以触发该应用生成包括该SQL语句的访问请求。
可选地,该数据库访问发起模块可以是软件开发工具包(software development kit,SDK)的方式实现。
一种可能的实现方式,每个数据库访问发起模块为单个应用提供服务。具体地,每个数据库访问发起模块接收各自负责的应用所产生的访问请求。举例说明,数据库访问发起模块111可以负责接收一个应用的访问请求;数据库访问发起模块112和数据库访问发起模块113可以同时负责接收另一个应用的访问请求。例如,该另一个应用可以向数据库访问发起模块112或者数据库访问发起模块113发送访问请求,这样可以通过数据库访问发起模块112和数据库访问发起模块113实现接收该另一个应用的访问请求的负载均衡。
数据库访问发起模块,可以向数据库访问服务引擎发送访问请求。
举例说明,以图1为例,数据库访问发起模块111可以查询元数据库14,通过元数据库14确定出当前负载最小的数据库访问服务引擎为数据库访问服务引擎121。从而,数据库访问发起模块111向数据库访问服务引擎121发送应用的访问请求。数据库访问服务引擎之间可以做负载均衡。
举例说明,结合图1和图2,在数据库访问实现模块131是该数据库实例231的场景下,如果该应用通过访问请求指定了要访问的数据库实例231的标识(例如该数据库实例231的网络之间互连的协议(Internet Protocol,IP)地址和端口(port)号),数据库访问发起模块111在元数据库14记录该数据库实例231的标识与数据库访问服务引擎121的绑定关系。后续,数据库访问发起模块111在接收到该应用的新访问请求时,如果该新访问请求携带该数据库实例231的标识,则数据库访问发起模块111使用该数据库实例231的标识在元数据库14查找到该绑定关系,从而将该新访问请求发送至该绑定关系指定的数据库访问服务引擎121。
另外,结合图1和图2,在数据库访问实现模块131是该数据库实例231的场景下,数据库访问服务引擎121可以根据数据库实例231的标识,建立访问该数据库实例231的连接(connection)。一种可能的实现方式,数据库访问服务引擎121成功建立与该数据库实例231的连接之后,数据库访问服务引擎121记录用于标识该连接的关键字(key)。可选地,数据库访问服务引擎121还可以将该关键字发送至该数据库访问发起模块111,以便该数据库访问发起模块111将该关键字反馈至该应用。
可选地,数据库访问服务引擎121还可以在该元数据库14记录数据库访问服务引擎121已建立的连接的条数。这样,该元数据库14中记录的属于数据库访问服务引擎121的连接的条数越多,则数据库访问服务引擎121的负载越大;反之,该元数据库14中记 录的属于数据库访问服务引擎121的连接的条数越少,则数据库访问服务引擎121的负载越小。类似地,元数据库14会记录所有数据库访问服务引擎各自具有的连接的条数;后续,数据库访问发起模块可以根据连接的条数在多个数据库访问服务引擎之间做负载均衡,例如根据连接的条数从图1所示的多个数据库访问服务引擎中选择负载最小的数据库访问服务引擎。
本申请的一种可能实现方式,结合图1和图2,数据库访问实现模块可以是数据库实例。数据库实例在接收到数据库访问服务引擎发送的访问请求时,数据库实例处理该访问请求。举例说明,数据库访问实现模块133是数据库实例233,数据库实例233接收到数据库访问服务引擎122发送的访问请求后,根据该访问请求携带的SQL语句。
本申请的一种可能实现方式,结合图1和图3,数据库访问实现模块可以数据库访问调度模块,该数据库访问调度模块与至少一个数据库实例通信连接。数据库访问调度模块在接收到数据库访问服务引擎发送的访问请求时,数据库访问调度模块将该访问请求发送至该访问请求指定的数据库实例。举例说明,数据库访问调度模块333接收到数据库访问服务引擎122发送的访问请求后,如果该访问请求携带数据库实例373的标识,则将该访问请求发送至该数据库实例373。举例说明,数据库访问调度模块331接收到数据库访问服务引擎121发送的访问请求后,如果该访问请求携带数据库实例372的标识,则将该访问请求发送至该数据库实例372。
本申请的一种可能实现方式,如图3所示,如果数据库访问调度模块与数据库访问服务引擎部署在同一网络中;例如数据库访问调度模块333与数据库访问服务引擎122均部署在公有云来提供服务,即数据库访问调度模块333与数据库访问服务引擎122均部署在该公有云所使用的网络中。数据库访问调度模块333可以访问数据库实例373和数据库实例374,数据库访问调度模块333接收到数据库访问服务引擎122发送的访问请求后,如果该访问请求携带数据库实例373的标识,则将该访问请求发送至该数据库实例373,如果该访问请求携带数据库实例374的标识,则将该访问请求发送至该数据库实例374。可选地,数据库实例373和数据库实例374均部署在该公有云来提供服务,即数据库实例373和数据库实例374均部署在该公有云所使用的网络中。
本申请的一种可能实现方式,如图3所示,如果数据库访问实现模块部署在局域网内,则数据库访问实现模块是该局域网中的数据库访问调度模块331。该数据库访问调度模块331可以访问该局域网内的数据库实例。举例说明,局域网381中的数据库访问调度模块331接收到数据库访问服务引擎121发送的访问请求;数据库访问调度模块331根据该访问请求指定的数据库实例372的标识,向数据库实例372发送该访问请求;数据库实例372处理该访问请求,例如执行该访问请求携带的SQL语句。
在图3所示架构中,在数据库访问调度模块333与数据库访问服务引擎122建立通信连接后,数据库访问服务引擎122在元数据库14中记录该数据库访问调度模块332的标识与数据库访问服务引擎122的绑定关系;后续,如果数据库访问发起模块112接收到的访问请求记录有数据库访问调度模块333的标识,则数据库访问发起模块112根据元数据库14记录的该绑定关系,向数据库访问服务引擎122发送该访问请求,以便于数据库访问服务引擎122最终向数据库访问调度模块333转发该访问请求。可见,在元数据库14记录数据库访问调度模块与数据库访问服务引擎的绑定关系。
一种应用场景的举例,数据库访问服务引擎121部署在公有云,数据库访问调度模块331和多个数据库实例(例如数据库实例371、数据库实例372)部署在局域网381内。数据库访问调度模块331获得数据库访问服务引擎121的IP地址,例如人为在数据库访问调度模块331录入数据库访问服务引擎121的IP地址;数据库访问调度模块331使用该IP地址请求与数据库访问服务引擎121建立通信连接,例如基于传输控制协议(Transmission Control Protocol,TCP)建立通信连接。这样,数据库访问服务引擎121可以与数据库访问调度模块331建立通信连接,从而公有云中的数据库访问服务引擎121可以通过数据库访问调度模块331访问在局域网381中的多个数据库实例(例如数据库实例371、数据库实例372)。
类似地,公有云中的数据库访问服务引擎122可以通过数据库访问调度模块332访问在局域网382中的多个数据库实例(图3未示意)。
这样,在局域网中的数据库访问调度模块主动与公有云中的数据库访问服务引擎建立通信连接后,公有云中的数据库访问服务引擎可以通过该数据库访问调度模块访问该局域网中的数据库实例。
一种可能的应用场景,局域网为私有云的网络。
本申请的一种可能实现方式,在图3所示架构中,局域网381中的数据库访问调度模块331主动与数据库访问服务引擎121建立通信连接后,数据库访问服务引擎121在元数据库14中记录该数据库访问调度模块331的标识与数据库访问服务引擎121的绑定关系;后续,如果数据库访问发起模块331接收到的访问请求记录有数据库访问调度模块331的标识,则数据库访问发起模块331根据元数据库14记录的该绑定关系,向数据库访问服务引擎121发送该访问请求,以便于数据库访问服务引擎121向数据库访问调度模块331转发该访问请求。类似地,局域网382中的数据库访问调度模块332主动与数据库访问服务引擎122建立通信连接后,数据库访问服务引擎122在元数据库14中记录该数据库访问调度模块332的标识与数据库访问服务引擎122的绑定关系。类似地,数据库访问调度模块333主动与数据库访问服务引擎122建立通信连接后,数据库访问服务引擎122在元数据库14中记录该数据库访问调度模块333的标识与数据库访问服务引擎122的绑定关系。可见,本申请在元数据库14中记录数据库访问调度模块与数据库访问服务引擎的绑定关系。
一种可能的实现方式,在图3所示架构中,如果数据库访问服务引擎直接连接数据库访问调度模块,则在元数据库14记录数据库访问调度模块的标识与数据库访问服务引擎的绑定关系;如果数据库访问服务引擎直接连接数据库实例,则在元数据库14记录该数据库实例与该数据库访问服务引擎的绑定关系。这样,在图3所示的架构中,数据库访问发起模块在查找元数据库14来确定访问请求的去向时,如果数据库访问服务引擎直接连接数据库访问调度模块,则使用该访问请求携带的数据库访问调度模块的标识来查找绑定关系以确定数据库访问服务引擎,如果数据库访问服务引擎直接连接数据库实例,则使用该访问请求携带的数据库实例的标识来查找绑定关系以确定数据库访问服务引擎。
基于图2所示的架构,本申请提供一种数据库访问方法。结合图2,在图4中示意 了该数据库访问方法的一种流程,该流程包括步骤S411到步骤S417。
步骤S411,应用向数据库访问发起模块发送访问请求。
具体地,该应用向为该应用提供服务的该数据库访问发起模块发送访问请求。举例说明,数据库访问发起模块111为一个应用提供服务;对于该个应用生成的访问请求,该个应用均将该访问请求向数据库访问发起模块111发送。
其中,该访问请求携带数据库实例的标识。这样,通过该数据库实例的标识可以确定用于处理该访问请求的数据库实例。
举例说明,数据库实例的标识为数据库实例的IP地址。举例说明,数据库实例的标识为数据库实例的IP地址和端口号。
举例说明,数据库实例的标识包括数据库实例的名称。这样,可以基于该数据库实例的名称进一步判断数据库实例是否为需要访问的数据库实例。
举例说明,数据库实例的标识可以为下述参数中一种或者多种的组合:数据库实例的IP地址,或者IP地址和端口号,或者数据库实例的名称。
举例说明,该访问请求携带可以包括SQL格式的语句。这样,数据库实例可以执行该访问请求携带的SQL格式的语句。
举例说明,该访问请求携带该应用当前所提供的业务的标识。
步骤S412,数据库访问发起模块确定与数据库实例关联的数据库访问服务引擎。
步骤S413,数据库访问发起模块向确定的数据库访问服务引擎发送该访问请求。
一种可能的实施方式,如果未为该访问请求携带的数据库实例的标识所指定的数据库实例分配数据库访问服务引擎,则数据库访问发起模块从多个数据库访问服务引擎选择一个数据库访问服务引擎,数据库访问发起模块向选择的数据库访问服务引擎发送该访问请求。相应地,数据库访问发起模块在元数据库14中记录该数据库实例的标识与该数据库访问服务引擎的绑定关系。
举例说明,以图2为例,数据库访问发起模块111接收到应用发送的访问请求时,可以查询元数据库14,如果未查询结果为该访问请求携带的数据库实例的标识所指定的数据库实例分配数据库访问服务引擎,则从多个数据库访问服务引擎(例如数据库访问服务引擎121、数据库访问服务引擎122、数据库访问服务引擎123)中选择一个数据库访问服务引擎,例如选择数据库访问服务引擎121。从而,数据库访问发起模块111将该访问请求发送至数据库访问服务引擎121。
举例说明,以图2为例,数据库访问发起模块111接收到应用发送的访问请求时,可以查询元数据库14,如果未查询结果为该访问请求携带的数据库实例的标识所指定的数据库实例分配数据库访问服务引擎,则根据多个数据库访问服务引擎(例如数据库访问服务引擎121、数据库访问服务引擎122、数据库访问服务引擎123)的负载,从该多个数据库访问服务引擎选择一个数据库访问服务引擎,例如选择数据库访问服务引擎121。从而,数据库访问发起模块111将该访问请求发送至数据库访问服务引擎121。
举例说明,以图2为例,数据库访问发起模块111接收到应用发送的访问请求时,可以查询元数据库14,如果未查询结果为该访问请求携带的数据库实例的标识所指定的数据库实例分配数据库访问服务引擎,则从多个数据库访问服务引擎(例如数据库访问服务引擎121、数据库访问服务引擎122、数据库访问服务引擎123)中选择负载最小的 数据库访问服务引擎;假设当前负载最小的数据库访问服务引擎是数据库访问服务引擎121,则数据库访问发起模块111将该访问请求发送至数据库访问服务引擎121。另外,数据库访问发起模块111在元数据库14记录数据库访问服务引擎121与该数据库实例的标识的绑定关系。
一种可能的实施方式,如果在元数据库14中已记录与该访问请求携带的数据库实例的标识对应的绑定关系,则数据库访问发起模块查询该元数据库14,以确定该绑定关系指定的数据库访问服务引擎。从而,数据库访问发起模块向确定的数据库访问服务引擎发送该访问请求。
一种可能的实现方式,每个数据库访问服务引擎(例如数据库访问服务引擎121或者数据库访问服务引擎122或者数据库访问服务引擎123)会定期将自己的负载信息(例如已部署的连接的条数)和心跳信息在元数据库14中记录。这样,数据库访问发起模块在使用元数据库14确定用于发送该访问请求的数据库访问服务引擎时,可以进一步利用该数据库访问服务引擎的心跳信息确定该数据库访问服务引擎是否可用;如果该数据库访问服务引擎是可用的,则该数据库访问发起模块执行步骤S413来向该数据库访问服务引擎发送该访问请求;如果该数据库访问服务引擎是不可用的,则该数据库访问发起模块重新执行步骤S412来选择新的数据库访问服务引擎。
该数据库访问发起模块确定该数据库访问服务引擎可用的一种可能实现方式,该数据库访问发起模块根据元数据库14中记录的该数据库访问服务引擎的心跳信息,确定数据库访问服务引擎没有宕机,或者确定该数据库访问服务引擎没有失去通信连接。
步骤S414,数据库访问服务引擎向数据库实例发送该访问请求。
一种可能的实施方式,如果该访问请求携带了用于标识连接(connection)的关键字(key),该连接是指该数据库访问服务引擎与该访问请求指定的数据库实例之间的连接,该连接是先前建立的,则该数据库访问服务引擎使用该连接向该数据库实例发送该访问请求。这样,如果在应用发出的多个访问请求中均添加了标识该连接的关键字,则这些访问请求均通过同一连接发送至该数据库实例。如果这多个访问请求是连续发出的,通过同一连接发送至该数据库实例,保证了这多个访问请求所组成事务的事务一致性。
一种可能的实施方式,如果该访问请求未携带用于标识连接的关键字,则该数据库访问服务引擎可以为该访问请求在该数据库访问服务引擎与该访问请求指定的数据库实例之间新建一条连接。举例说明,在数据库访问服务引擎与数据库实例之间建立的连接,可以是通信连接,例如可以是JDBC(Java database connectivity)连接。
对于在数据库访问服务引擎与数据库实例之间新建立的连接,该数据库访问服务引擎记录用于标识该连接的关键字(key)。以图2为例,数据库访问引擎121会记录在数据库访问服务引擎121与数据库实例231之间新建立的连接;数据库访问引擎122会记录在数据库访问服务引擎122与数据库实例232之间新建立的连接;数据库访问引擎122会记录用于标识该连接的关键字,以及记录该关键字与数据库实例231的绑定关系。后续,数据库访问服务引擎122可以通过该绑定关系确定该关键字,以确定该关键字指定的连接。
另外,由于该访问请求没有携带用于标识连接的关键字,即使存在所述数据库访问服务引擎与所述数据库实例之间的已有连接,该数据库访问服务引擎仍需要新建一条连 接,使用新建的连接来在所述数据库访问服务引擎与所述数据库实例之间传输该访问请求相关的数据(例如该访问请求或者该访问请求对应的处理结果)。
可选地,该数据库访问服务引擎还可以将该关键字发送至先前转发该访问请求的该数据库访问发起模块,以便该数据库访问发起模块将该关键字反馈至先前生成该访问请求的应用。后续,该应用可以在新访问请求中添加该关键字,相应地,该数据库访问服务引擎通过数据库访问发起模块接收到该关键字后,会向该关键字关联的数据库实例发送该新访问请求。从而保证该应用发出的带该关键字的新访问请求都发送至数据库实例处理,保证该带该关键字的多个新访问请求所组成的事务的一致性。
举例说明,对于在数据库访问服务引擎121与数据库实例231之间新建立的连接,数据库访问服务引擎121可以将关键字(用于标识新建立的该连接)发送至该数据库访问发起模块111,以便该数据库访问发起模块111将该关键字反馈至先前生成该访问请求的应用。后续,该应用可以在新访问请求中添加该关键字;相应地,该数据库访问服务引擎121通过数据库访问发起模块111接收到该关键字后,会向该关键字关联的数据库实例231发送该新访问请求。
步骤S415,数据库实例向数据库访问服务引擎发送该访问请求对应的处理结果。
具体地,数据库实例收到数据库访问服务引擎发送的访问请求后,会处理该访问请求,并得到处理结果。数据库实例向该数据库访问服务引擎发送该访问请求对应的处理结果。
举例说明,数据库实例231接收访问服务引擎121发送的访问请求,数据库实例231处理该访问请求,例如执行该访问请求携带的SQL格式的语句,例如使用该SQL格式的语句查询数据并得到查询结果。数据库实例231向访问服务引擎121发送该访问请求对应的处理结果(例如该查询结果)。如果在数据库实例231与访问服务引擎121之间建立的是JDBC连接,则使用该JDBC连接完成该访问请求和该处理结果在数据库实例231与访问服务引擎121之间的传输。
步骤S416,数据库访问服务引擎向数据库访问发起模块发送该访问请求对应的处理结果。
具体地,先前转发该访问请求的数据库访问服务引擎,向先前转发该访问请求的数据库访问发起模块发送该访问请求对应的处理结果。举例说明,如果该访问请求是经过数据库访问发起模块111和数据库访问服务引擎121被转发至数据库实例231的,则数据库实例231将该访问请求对应的处理结果发送至数据库访问服务引擎121,以便数据库访问服务引擎121将该处理结果发送至数据库访问发起模块111。
步骤S417,数据库访问发起模块向应用发送该访问请求对应的处理结果。
具体地,先前转发该访问请求的数据库访问发起模块,向生成该访问请求的应用(即该数据库访问发起模块服务的应用)发送该访问请求对应的处理结果。举例说明,数据库访问发起模块111从访问服务引擎121接收到该访问请求对应的处理结果之后,向先前生成该访问请求的应用发送该处理结果。这样,该应用获得该访问请求对应的处理结果,例如获得数据库实例231根据该访问请求包括的SQL格式的语句所查询得到的查询结果。
基于图3所示的架构,本申请提供一种数据库访问方法。结合图3,在图5中示意了该数据库访问方法的一种流程,该流程包括步骤S511到步骤S521。
步骤S511,数据库访问调度模块与数据库访问引擎建立通信连接。
一种可能的实施方式,参见图3,数据库访问调度模块与数据库访问服务引擎部署在同一网络中,数据库访问调度模块与数据库访问服务引擎可以在该网络中建立通信连接。举例说明,数据库访问调度模块333与数据库访问服务引擎122均部署在公有云来提供服务,即数据库访问调度模块333与数据库访问服务引擎122均部署在该公有云所使用的网络中。数据库访问调度模块333使用数据库访问服务引擎122的IP地址与数据库访问服务引擎122建立通信连接,或者数据库访问服务引擎122使用数据库访问调度模块333的IP地址与数据库访问调度模块333建立通信连接。
一种可能的实施方式,参见图3,数据库访问调度模块位于局域网内。数据库访问引擎不是位于该局域网内,即数据库访问引擎不与数据库访问调度模块位于同一局域网内。举例说明,局域网381内的数据库访问调度模块331获得数据库访问服务引擎121的IP地址,例如已预先在数据库访问调度模块331记录数据库访问服务引擎121的IP地址,例如人为在数据库访问调度模块331录入数据库访问服务引擎121的该IP地址。数据库访问调度模块331使用该IP地址主动请求与数据库访问服务引擎121建立通信连接(例如,该通信连接可以是基于TCP的通信连接)。这样,数据库访问调度模块331可以与数据库访问服务引擎121建立通信连接。类似地,数据库访问调度模块332可以使用数据库访问服务引擎122的IP地址主动与数据库访问服务引擎122建立通信连接;数据库访问调度模块333可以使用数据库访问服务引擎122的IP地址主动与数据库访问服务引擎122建立通信连接。可见,每个数据库访问调度模块可以使用数据库访问服务引擎的IP地址主动与该数据库访问服务引擎建立通信连接。
应知,在数据库访问调度模块与数据库访问引擎之间建立的通信连接,可以是基于TCP的通信连接,也可以是基于其它协议建立的通信连接。从而,基于该通信连接,可以在数据库访问调度模块与数据库访问引擎之间传输数据。
在数据库访问调度模块与数据库访问引擎成功建立通信连接(例如,该通信连接可以是基于TCP的通信连接)时,该数据库访问引擎记录该数据库访问调度模块的标识与该通信连接的绑定关系。
举例说明,在数据库访问调度模块331与数据库访问服务引擎121成功建立通信连接时,数据库访问服务引擎121记录数据库访问调度模块331的标识与该通信连接(数据库访问调度模块331与数据库访问服务引擎121的通信连接)的绑定关系。在数据库访问调度模块332与数据库访问服务引擎122成功建立通信连接时,数据库访问服务引擎122记录数据库访问调度模块332的标识与该通信连接(数据库访问调度模块332与数据库访问服务引擎122的通信连接)的绑定关系。在数据库访问调度模块333与数据库访问服务引擎122成功建立通信连接时,数据库访问服务引擎122记录数据库访问调度模块333的标识与该通信连接(数据库访问调度模块333与数据库访问服务引擎122的通信连接)的绑定关系。
步骤S512,数据库访问引擎在元数据库14中记录已建立通信连接的数据库访问服务引擎与数据库访问调度模块之间的绑定关系。
一种可能的实施方式,单个数据库访问调度模块主动请求与单个数据库访问服务引擎建立通信连接,如果该通信连接建立成功,则该个数据库访问引擎在元数据库14中记录该个数据库访问调度模块与该个数据库访问服务引擎的绑定关系。
单个数据库访问调度模块与单个数据库访问服务引擎的绑定关系,具体可以包括该个数据库访问调度模块的标识与该个数据库访问服务引擎的标识。
举例说明,数据库访问调度模块332可以使用数据库访问服务引擎122的IP地址主动与数据库访问服务引擎122建立通信连接,如果该通信连接建立成功,则数据库访问服务引擎122在元数据库14中记录该通信连接对应的绑定关系,该绑定关系包括数据库访问调度模块332的标识(例如数据库访问调度模块332的关键字)和数据库访问服务引擎122的标识(例如数据库访问服务引擎122的IP地址)。类似地,数据库访问调度模块333可以使用数据库访问服务引擎122的IP地址主动与数据库访问服务引擎122建立通信连接,如果该通信连接建立成功,则数据库访问服务引擎122在元数据库14中记录该通信连接对应的绑定关系,该绑定关系包括数据库访问调度模块333的标识(例如数据库访问调度模块333的关键字)和数据库访问服务引擎122的标识(例如数据库访问服务引擎122的IP地址)。
这样,可以根据元数据库14中记录的单个数据库访问服务引擎具有的绑定关系的条数,确定该个数据库访问服务引擎的负载大小。可选地,如图3所示,该绑定关系可以是数据库访问调度模块与数据库访问服务引擎的绑定关系(例如数据库访问调度模块333的标识和数据库访问服务引擎122的标识的绑定关系,例如数据库访问调度模块331的标识和数据库访问服务引擎121的标识的绑定关系),该绑定关系或者是数据库实例的标识与数据库访问服务引擎的绑定关系(例如数据库实例374的标识与数据库访问服务引擎123的绑定关系)。这样,可以综合考虑该个数据库访问服务引擎具有的所有绑定关系来评估该个数据库访问服务引擎的负载大小。
另外,数据库访问发起模块可以根据访问请求携带的数据库访问调度模块的标识,查找元数据库14,查找到该数据库访问调度模块的标识匹配的绑定关系。从而将该访问请求发送至该绑定关系指定的数据库访问服务引擎。
步骤S513,应用向数据库访问发起模块发送访问请求。
具体地,该应用向为该应用提供服务的该数据库访问发起模块发送访问请求。举例说明,数据库访问发起模块111为一个应用提供服务;对于该个应用生成的访问请求,该个应用均将该访问请求向数据库访问发起模块111发送。
该访问请求携带数据库访问调度模块的标识。数据库访问调度模块的标识可以是数据库访问调度模块的IP地址。一种可能的实现方式,数据库访问调度模块的标识可以是数据库访问调度模块的IP地址和端口号。
另外,该访问请求携带数据库实例的标识。这样,通过该数据库实例的标识可以确定用于处理该访问请求的数据库实例。
举例说明,数据库实例的标识为数据库实例的IP地址。举例说明,数据库实例的标识为数据库实例的IP地址和端口号。
举例说明,数据库实例的标识包括数据库实例的名称。这样,可以基于该数据库实例的名称进一步判断数据库实例是否为需要访问的数据库实例。
举例说明,数据库实例的标识可以为下述参数中一种或者多种的组合:数据库实例的IP地址,或者IP地址和端口号,或者数据库实例。
举例说明,该访问请求携带可以包括SQL格式的语句。这样,数据库实例可以执行该访问请求携带的SQL格式的语句。
举例说明,该访问请求携带该应用当前所提供的业务的标识。
步骤S514,数据库访问发起模块确定与该数据库访问调度模块关联的数据库访问服务引擎。
步骤S515,数据库访问发起模块向确定的数据库访问服务引擎发送该访问请求。
具体地,数据库访问发起模块基于该访问请求携带的数据库访问调度模块的标识,查找元数据库14,查找到与该数据库访问调度模块的标识匹配的绑定关系。数据库访问发起模块将该访问请求发送至该绑定关系指定的数据库访问服务引擎。
举例说明,数据库访问发起模块113使用该访问请求携带的数据库访问调度模块333的标识,在元数据库14中查找到与数据库访问调度模块333的标识对应的绑定关系,该绑定关系记录数据库访问服务引擎122的标识,则数据库访问发起模块113向数据库访问服务引擎122发送该访问请求。
举例说明,数据库访问发起模块111使用该访问请求携带的数据库访问调度模块331的标识,在元数据库14中查找到与数据库访问调度模块331的标识对应的绑定关系,该绑定关系记录数据库访问服务引擎121的标识,则数据库访问发起模块111向数据库访问服务引擎121发送该访问请求。
步骤S516,数据库访问服务引擎向数据库访问调度模块发送该访问请求。
具体地,该访问请求携带了该数据库访问调度模块的标识。数据库访问服务引擎根据该数据库访问调度模块的标识,查找该数据库访问调度模块的标识匹配的绑定关系,该绑定关系记录有该数据库访问调度模块的标识和在该数据库访问服务引擎与该数据库访问调度模块之间的通信连接。这样,该数据库访问服务引擎基于该通信连接,向该数据库访问调度模块发送该访问请求。
举例说明,参见图3,数据库访问服务引擎121记录有数据库访问调度模块331的标识与该通信连接(数据库访问调度模块331与数据库访问服务引擎121的通信连接)的绑定关系。数据库访问服务引擎121在接收到访问请求时,如果该访问请求携带有数据库访问调度模块331的标识,则数据库访问服务引擎121根据该绑定关系记录的通信连接,将该访问请求发送至数据库访问调度模块331。
举例说明,参见图3,数据库访问服务引擎122记录数据库访问调度模块332的标识与该通信连接(数据库访问调度模块332与数据库访问服务引擎122的通信连接)的绑定关系。数据库访问服务引擎122在接收到访问请求时,如果该访问请求携带有数据库访问调度模块332的标识,则数据库访问服务引擎122根据该绑定关系记录的通信连接,将该访问请求发送至数据库访问调度模块332。
举例说明,参见图3,数据库访问服务引擎122记录数据库访问调度模块333的标识与该通信连接(数据库访问调度模块333与数据库访问服务引擎122的通信连接)的绑定关系。数据库访问服务引擎122在接收到访问请求时,如果该访问请求携带有数据库访问调度模块333的标识,则数据库访问服务引擎122根据该绑定关系记录的通信连 接,将该访问请求发送至数据库访问调度模块333。
步骤S517,数据库访问调度模块向该访问请求指定的数据库实例发送该访问请求。
具体地,该访问请求携带有数据库实例的标识。数据库访问调度模块向该标识指定的数据库实例发送该访问请求。可选地,数据库访问调度模块和数据库实例位于同一局域网内。
举例说明,在局域网381中,数据库访问调度模块331在接收到访问请求时,如果该访问请求携带数据库实例371的标识,则数据库访问调度模块331将该访问请求发送至数据库实例371;如果该访问请求携带数据库实例372的标识,则数据库访问调度模块331将该访问请求发送至数据库实例372,以便数据库实例372处理该访问请求。
举例说明,数据库访问调度模块333接收到访问请求时,如果该访问请求携带数据库实例373的标识,则数据库访问调度模块333将该访问请求发送至数据库实例373;如果该访问请求携带数据库实例374的标识,则数据库访问调度模块333将该访问请求发送至数据库实例374。
数据库实例处理该访问请求,得到处理结果。例如该访问请求携带包括SQL格式的语句,数据库实例根据该SQL格式的语句进行数据查询,得到查询结果。
步骤S518,数据库实例向数据库访问调度模块发送该访问请求对应的处理结果。
具体地,数据库实例,向先前转发该访问请求至该数据库实例的数据库访问调度模块,发送该访问请求对应的处理结果。
举例说明,如果数据库访问调度模块331先前向数据库实例371发送访问请求,数据库实例371处理该访问请求来得到处理结果,并相应地向该数据库访问调度模块331发送该处理结果。
举例说明,如果数据库访问调度模块333先前向数据库实例373发送访问请求,数据库实例373处理该访问请求来得到处理结果,并相应地向该数据库访问调度模块333发送该处理结果。
步骤S519,数据库访问调度模块向数据库访问服务引擎发送该访问请求对应的处理结果。
具体地,该数据库访问服务引擎为先前向该数据库访问调度模块发送该访问请求的数据库访问服务引擎。在该数据库访问调度模块从数据库实例得到该访问请求对应的处理结果之后,该数据库访问调度模块将该处理结果发送至该数据库访问服务引擎。
举例说明,数据库访问调度模块331在接收到该访问请求对应的处理结果之后,通过数据库访问调度模块331与数据库访问服务引擎121的通信连接,向数据库访问服务引擎121发送该处理结果。
举例说明,数据库访问调度模块333在接收到该访问请求对应的处理结果之后,通过数据库访问调度模块333与数据库访问服务引擎122的通信连接,向数据库访问服务引擎122发送该处理结果。
步骤S520,数据库访问服务引擎向数据库访问发起模块发送该访问请求对应的处理结果。
具体地,先前转发该访问请求的数据库访问服务引擎,向先前转发该访问请求的数据库访问发起模块发送该访问请求对应的处理结果。
举例说明,如果该访问请求是经过数据库访问发起模块111和数据库访问服务引擎121被转发至数据库访问调度模块331的,则数据库访问调度模块331将该访问请求对应的处理结果发送至数据库访问服务引擎121之后,数据库访问服务引擎121将该处理结果发送至数据库访问发起模块111。
举例说明,如果该访问请求是经过数据库访问发起模块112和数据库访问服务引擎122被转发至数据库访问调度模块333的,则数据库访问调度模块333将该访问请求对应的处理结果发送至数据库访问服务引擎122之后,数据库访问服务引擎122将该处理结果发送至数据库访问发起模块112。
步骤S521,数据库访问发起模块向应用发送该访问请求对应的处理结果。
具体地,先前转发该访问请求的数据库访问发起模块,向生成该访问请求的应用(即该数据库访问发起模块服务的应用)发送该访问请求对应的处理结果。举例说明,数据库访问发起模块111从访问服务引擎121接收到该访问请求对应的处理结果之后,向先前生成该访问请求的应用发送该处理结果。这样,该应用获得该访问请求对应的处理结果,例如获得数据库实例231根据该访问请求包括的SQL格式的语句所查询得到的查询结果。
如果数据库实例位于局域网中,通过步骤S511到步骤S521,可以实现应用对局域网中的数据库实例的访问。一种应用场景,应用、数据库访问发起模块111和访问服务引擎121均部署在公有云中,数据库访问调度模块331、数据库实例371和数据库实例372部署在私有云中。该公有云所使用的网络不同于私有云所使用的局域网381。但通过数据库访问调度模块331预先使用访问服务引擎121的IP地址与访问服务引擎121成功建立了通信连接,基于该通信连接,应用可以通过访问服务引擎121实现对局域网381中的数据库访问调度模块331的访问,从而间接实现对局域网381中的数据库实例(例如数据库实例371或数据库实例372)的访问。
如果数据库实例与数据库访问服务引擎位于同一网络(例如公有云所使用的网络)中,通过步骤S511到步骤S521,可以实现应用在该同一网络中对数据库实例的访问。
基于图3所示的架构,本申请提供一种数据库访问方法。结合图3,在图5所示数据库访问方法的流程上,从安全性角度,对该数据库访问方法包括的步骤做进一步优化。
作为步骤S511的一种可能的实现方式,数据库访问调度模块主动与数据库访问引擎建立通信连接时,向该数据库访问引擎发送该数据库访问引擎的公钥,以便该数据库访问引擎根据该公钥进行是否同意建立该通信连接的鉴权。另外,如果该通信连接建立成功,该数据库访问调度模块使用该公钥加密需要向该数据库访问引擎发送的数据。
举例说明,在图3所示架构中,数据库访问引擎122生成供数据库访问引擎122使用的公钥和私钥,并在元数据库14存储该公钥和该私钥。该数据库访问调度模块使用数据库访问引擎122的公钥请求与数据库访问引擎122建立通信连接,数据库访问引擎122使用该公钥查询元数据库14,如果该元数据库14记录该公钥为数据库访问引擎122的公钥,则鉴权成功,数据库访问引擎122成功与该数据库访问调度模块建立通信连接。后续,基于在数据库访问引擎122与该数据库访问调度模块(例如数据库访问调度模块332或者数据库访问调度模块333)之间的通信连接,对于该数据库访问调度模块需要向数据 库访问引擎122发送的数据,该数据库访问调度模块均使用该数据库访问引擎122的公钥进行加密,然后再基于该通信连接向该数据库访问引擎122发送加密的数据。
作为步骤S518的一种可能的实现方式,对于数据库访问调度模块向数据库访问引擎发送的访问请求对应的处理结果,该数据库访问调度模块均使用该数据库访问引擎的公钥加密该处理结果,再向该数据库访问引擎发送加密的该处理结果。
举例说明,在图3所示架构中,在该数据库访问调度模块333从数据库实例373接收访问请求对应的处理结果之后,该数据库访问调度模块333使用该数据库访问引擎122的公钥对该处理结果加密,向该数据库访问引擎122发送加密的该处理结果。
一种可能的实现方式,数据库访问引擎向数据库访问调度模块发送的数据(例如应用生成的访问请求),使用该数据库访问调度模块的公钥进行加密,该数据库访问引擎向该数据库访问调度模块发送加密的数据。相应地,该数据库访问调度模块使用该该数据库访问调度模块的私钥从该加密的数据中解密出该数据。
举例说明,数据库访问调度模块332生成供数据库访问调度模块332使用的公钥和私钥,保存该公钥和该私钥。数据库访问调度模块332将该公钥发送至数据库访问引擎122。后续,数据库访问引擎122使用该公钥加密访问请求,再将加密的访问请求发送至数据库访问调度模块332。相应地,数据库访问调度模块332使用该私钥从该加密的访问请求中解密出该访问请求。
本申请还提供一种数据库访问发起模块(例如数据库访问发起模块111或者数据库访问发起模块112或者数据库访问发起模块113),该数据库访问发起模块部署在本申请的计算设备(例如服务器)上。该数据库访问发起模块包括用于该数据库访问发起模块实现上述数据库访问方法的功能单元;本申请对在该数据库访问发起模块中如何划分功能单元不做限定,下面实例性地提供一种功能单元的划分,如图6所示。
如图6所示的数据库访问发起模块600,数据库访问发起模块600包括:
接收单元602,用于接收所述应用的访问请求,所述访问请求携带数据库实例的标识;
确定单元601,用于确定数据库访问服务引擎,所述数据库访问服务引擎独立于所述应用,所述数据库访问服务引擎用于建立用于访问所述数据库实例的连接;
发送单元603,向确定的数据库访问服务引擎发送所述访问请求,所述数据库访问服务引擎具有向所述数据库实例发送所述访问请求的能力
可选地,确定单元601,用于从多个数据库访问服务引擎中选择一个数据库访问服务引擎。
可选地,确定单元601,用于根据多个数据库访问服务引擎的负载,从所述多个数据库访问服务引擎中选择一个数据库访问服务引擎。
可选地,确定单元601,用于从多个数据库访问服务引擎中选择负载最小的数据库访问服务引擎。
可选地,确定单元601,用于根据所述访问请求携带的所述数据库实例的标识,确定与所述数据库实例的标识绑定的数据库访问服务引擎。
可选地,确定单元601,用于根据所述访问请求携带的数据库访问调度模块的标识,确定与所述数据库访问调度模块绑定的数据库访问服务引擎,所述数据库访问调度模块用于将从所述数据库访问服务引擎接收的所述访问请求发送至所述数据库实例。
可选地,接收单元602,用于接收所述数据库访问服务引擎发送的所述访问请求对应的处理结果;相应地,发送单元603,用于向所述应用发送所述处理结果。
本申请还提供一种数据库访问服务引擎(例如数据库访问服务引擎121或者数据库访问服务引擎122或者数据库访问服务引擎123),该数据库访问服务引擎部署在本申请的计算设备(例如服务器)上。该数据库访问服务引擎包括用于该数据库访问发起模块实现上述数据库访问方法的功能单元;本申请对在该数据库访问服务引擎中如何划分功能单元不做限定,下面实例性地提供一种功能单元的划分,如图7所示。
如图7所示的数据库访问服务引擎700,数据库访问服务引擎700包括:
接收单元701,用于接收数据库访问发起模块发送的访问请求,所述访问请求携带数据库实例的标识;
发送单元702,用于向所述数据库实例发送所述访问请求,或者,向与所述数据库实例关联的数据库访问调度模块发送所述访问请求。
可选地,所述数据库访问服务引擎包括:
连接建立单元703,用于根据所述数据库实例的标识建立所述数据库访问服务引擎与所述数据库实例的连接,所述连接用于在所述数据库访问服务引擎与所述数据库实例之间传输数据。
可选地,发送单元702,用于根据所述访问请求携带的关键字,使用所述关键字标识的在所述数据库访问服务引擎与所述数据库实例之间已建立的连接,向所述数据库实例发送所述访问请求。
可选地,发送单元702,用于根据所述访问请求携带的所述数据库访问调度模块的标识,向所述数据库访问调度模块发送所述访问请求。
可选地,接收单元701,用于接收所述数据库实例发送的所述访问请求对应的处理结果,或者,接收所述数据库访问调度模块发送的所述访问请求对应的处理结果;
相应地,发送单元702,用于向所述数据库访问发起模块发送所述访问请求对应的处理结果。
本申请还提供一种数据库访问调度模块(例如数据库访问调度模块331或者数据库访问调度模块332或者数据库访问调度模块333),该数据库访问调度模块部署在本申请的计算设备(例如服务器)上。该数据库访问调度模块包括用于该数据库访问调度模块实现上述数据库访问方法的功能单元;本申请对在该数据库访问调度模块中如何划分功能单元不做限定,下面实例性地提供一种功能单元的划分,如图8所示。
如图8所示的数据库访问调度模块800,其特征在于,所述数据库访问调度模块800包括:
连接建立单元803,用于使用数据库访问服务引擎的标识与所述数据库访问服务引 擎建立通信连接;
接收单元801,用于接收所述数据库访问服务引擎发送的访问请求,所述访问请求携带有数据库实例的标识;
发送单元802,用于向所述数据库实例发送所述访问请求。
可选地,所述数据库访问服务引擎的标识为数据库访问服务引擎的IP地址。
可选地,连接建立单元803,用于向所述数据库访问服务引擎发送建立所述通信连接的请求,所述请求携带所述数据库访问服务引擎的标识和所述数据库访问服务引擎的公钥,所述数据库访问服务引擎的公钥用于所述数据库访问引擎对建立所述通信连接的鉴权。
可选地,所述数据库访问调度模块800包括:
解密单元804,用于在所述数据库访问调度模块从所述数据库访问服务引擎接收的所述访问请求为基于所述数据库访问调度模块的公钥加密的访问请求时,使用所述数据库访问调度模块的私钥从加密的访问请求中解密出访问请求,以便发送单元802向所述数据库实例发送解密的访问请求。
可选地,接收单元801,用于接收所述数据库实例发送的所述访问请求对应的处理结果;
发送单元802,用于向所述数据库访问服务引擎发送所述处理结果。
可选地,所述数据库访问调度模块800包括:
加密单元805,用于使用所述数据库访问服务引擎的公钥对所述处理结果加密,以便所述发送单元802向所述数据库访问服务引擎发送加密的所述处理结果。
可选地,图9示意性地提供本申请所述计算设备的一种可能的基本硬件架构。
参见图9,计算设备900包括处理器901、存储器902、通信接口903和总线904。
计算设备900中,处理器901的数量可以是一个或多个,图9仅示意了其中一个处理器901。可选地,处理器901,可以是中央处理器(central processing unit,CPU)。如果计算设备900具有多个处理器901,多个处理器901的类型可以不同,或者可以相同。可选地,计算设备900的多个处理器901还可以集成为多核处理器。
存储器902存储计算机指令和数据;存储器902可以存储实现本申请提供的数据库访问方法所需的计算机指令和数据,例如,存储器902存储用于实现在数据库访问方法中由数据库访问发起模块执行步骤的指令,再例如,存储器902存储用于实现在数据库访问方法中由数据库访问服务网引擎执行步骤的指令,再例如,存储器902存储用于实现在数据库访问方法中由数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行步骤的指令。存储器902可以是以下存储介质的任一种或任一种组合:非易失性存储器(例如只读存储器(ROM)、固态硬盘(SSD)、硬盘(HDD)、光盘),易失性存储器。
通信接口903可以是以下器件的任一种或任一种组合:网络接口(例如以太网接口)、无线网卡等具有网络接入功能的器件。
通信接口903用于计算设备900与其它计算设备或者终端进行数据通信。
图9用一条粗线表示总线904。总线904可以将处理器901与存储器902和通信接 口903连接。这样,通过总线904,处理器901可以访问存储器902,还可以利用通信接口903与其它计算设备或者终端进行数据交互。
在本申请中,计算设备900执行存储器902中的计算机指令,使得计算设备900实现本申请提供的数据库访问方法,例如使得所述计算设备执行上述数据库访问方法中由所述数据库访问发起模块执行的步骤,再例如使得所述计算设备执行上述数据库访问方法中由所述数据库访问服务引擎执行的步骤,再例如使得所述计算设备执行上述数据库访问方法中由所述数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤。
本申请提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当计算设备900的处理器901执行该计算机指令时,该计算设备900执行上述数据库访问方法中由数据库访问发起模块执行的步骤,或者计算设备900执行上述数据库访问方法中由所述数据库访问服务引擎执行的步骤,或者计算设备900执行上述数据库访问方法中由所述数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤。
本申请提供一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算设备900的处理器901可以从计算机可读存储介质读取该计算机指令,处理器901执行该计算机指令,使得计算设备900执行上述数据库访问方法中由所述数据库访问发起模块执行的步骤,使得计算设备900执行上述数据库访问方法中由所述数据库访问服务引擎执行的步骤,使得计算设备900执行上述数据库访问方法中由所述数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤。
本申请提供一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算设备900的处理器901可以从计算机可读存储介质读取该计算机指令,处理器901执行该计算机指令,使得计算设备900执行上述数据库访问方法中由所述数据库访问发起模块执行的步骤,使得计算设备900执行上述数据库访问方法中由所述数据库访问服务引擎执行的步骤,使得计算设备900执行上述数据库访问方法中由所述数据库访问实现模块(例如数据库实例,例如数据库访问调度模块)执行的步骤。
以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改;而这些修改,并不使相应技术方案脱离权利要求的保护范围。

Claims (15)

  1. 一种数据库访问方法,其特征在于,所述方法包括:
    数据库访问调度模块使用数据库访问服务引擎的标识与所述数据库访问服务引擎建立通信连接;
    所述数据库访问调度模块接收所述数据库访问服务引擎发送的访问请求,所述访问请求携带有数据库实例的标识;
    所述数据库访问调度模块向所述数据库实例发送所述访问请求。
  2. 根据权利要求1所述的方法,其特征在于,所述数据库访问服务引擎的标识为数据库访问服务引擎的IP地址。
  3. 根据权利要求1或者2所述的方法,其特征在于,所述数据库访问调度模块使用数据库访问服务引擎的标识与所述数据库访问服务引擎建立通信连接,包括:
    所述数据库访问调度模块向所述数据库访问服务引擎发送建立所述通信连接的请求,所述请求携带所述数据库访问服务引擎的标识和所述数据库访问服务引擎的公钥,所述数据库访问服务引擎的公钥用于所述数据库访问引擎对建立所述通信连接的鉴权。
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述方法包括:
    在所述数据库访问调度模块从所述数据库访问服务引擎接收的所述访问请求为基于所述数据库访问调度模块的公钥加密的访问请求时,所述数据库访问调度模块使用所述数据库访问调度模块的私钥从加密的访问请求中解密出访问请求,以便向所述数据库实例发送解密的访问请求。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述方法包括:
    所述数据库访问调度模块接收所述数据库实例发送的所述访问请求对应的处理结果;
    所述数据库访问调度模块向所述数据库访问服务引擎发送所述处理结果。
  6. 根据权利要求5所述的方法,其特征在于,所述方法包括:
    所述数据库访问调度模块使用所述数据库访问服务引擎的公钥对所述处理结果加密,以便所述数据库访问调度模块向所述数据库访问服务引擎发送加密的所述处理结果。
  7. 根据权利要求1至6任一项所述的方法,其特征在于,所述数据库访问服务引擎独立于生成所述访问请求的应用。
  8. 一种数据库访问调度模块,其特征在于,所述数据库访问调度模块包括:
    连接建立单元,用于使用数据库访问服务引擎的标识与所述数据库访问服务引擎建立通信连接;
    接收单元,用于接收所述数据库访问服务引擎发送的访问请求,所述访问请求携带有数据库实例的标识;
    发送单元,用于向所述数据库实例发送所述访问请求。
  9. 根据权利要求8所述的数据库访问调度模块,其特征在于,所述数据库访问服务引擎的标识为数据库访问服务引擎的IP地址。
  10. 根据权利要求8或9所述的数据库访问调度模块,其特征在于,
    所述连接建立单元,用于向所述数据库访问服务引擎发送建立所述通信连接的请 求,所述请求携带所述数据库访问服务引擎的标识和所述数据库访问服务引擎的公钥,所述数据库访问服务引擎的公钥用于所述数据库访问引擎对建立所述通信连接的鉴权。
  11. 根据权利要求8至10任一项所述的数据库访问调度模块,其特征在于,所述数据库访问调度模块包括:
    解密单元,用于在所述数据库访问调度模块从所述数据库访问服务引擎接收的所述访问请求为基于所述数据库访问调度模块的公钥加密的访问请求时,使用所述数据库访问调度模块的私钥从加密的访问请求中解密出访问请求,以便所述发送单元向所述数据库实例发送解密的访问请求。
  12. 根据权利要求8至11任一项所述的数据库访问调度模块,其特征在于,
    所述接收单元,用于接收所述数据库实例发送的所述访问请求对应的处理结果;
    所述发送单元,用于向所述数据库访问服务引擎发送所述处理结果。
  13. 根据权利要求12所述的数据库访问调度模块,其特征在于,
    加密单元,用于使用所述数据库访问服务引擎的公钥对所述处理结果加密,以便所述发送单元向所述数据库访问服务引擎发送加密的所述处理结果。
  14. 一种计算设备,其特征在于,包括处理器和存储器;
    所述存储器,用于存储计算机指令;
    所述处理器,用于执行所述存储器存储的计算机指令,使得所述计算设备执行权利要求1至7任一项所述方法中在所述数据库访问调度模块实现的步骤。
  15. 一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令指示计算设备执行权利要求1至7任一项所述方法中在所述数据库访问调度模块实现的步骤。
PCT/CN2020/084353 2019-06-29 2020-04-11 数据库访问方法和装置、计算设备和计算机程序产品 WO2021000622A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20834288.1A EP3951592B1 (en) 2019-06-29 2020-04-11 Database access method and apparatus, computing device and computer program product
US17/541,242 US20220091902A1 (en) 2019-06-29 2021-12-02 Database access method and apparatus, computing device, and computer program product

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910581051.0A CN112149142A (zh) 2019-06-29 2019-06-29 数据库访问方法和装置、计算设备和计算机程序产品
CN201910581051.0 2019-06-29

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/541,242 Continuation US20220091902A1 (en) 2019-06-29 2021-12-02 Database access method and apparatus, computing device, and computer program product

Publications (1)

Publication Number Publication Date
WO2021000622A1 true WO2021000622A1 (zh) 2021-01-07

Family

ID=73891279

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/084353 WO2021000622A1 (zh) 2019-06-29 2020-04-11 数据库访问方法和装置、计算设备和计算机程序产品

Country Status (4)

Country Link
US (1) US20220091902A1 (zh)
EP (1) EP3951592B1 (zh)
CN (3) CN116011013A (zh)
WO (1) WO2021000622A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7485934B2 (ja) * 2020-06-30 2024-05-17 富士通株式会社 情報処理プログラム、情報処理装置及び情報処理方法
CN113486044A (zh) * 2021-06-07 2021-10-08 广发银行股份有限公司 一种基于效率分析评分的数据查询调度方法及系统
CN113905048A (zh) * 2021-09-30 2022-01-07 北京蓝海医信科技有限公司 集群管理器调度引擎实例的方法、装置及计算机设备
US12026123B2 (en) 2022-01-13 2024-07-02 Cyera, Ltd. System and method for data discovery in cloud environments

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7502776B2 (en) * 2005-12-01 2009-03-10 Oracle International Corporation Dynamic connection establishment using an object link
CN105095317A (zh) * 2014-05-23 2015-11-25 中国银联股份有限公司 分布式数据库服务管理系统
US20170344584A1 (en) * 2016-05-27 2017-11-30 Wal-Mart Stores, Inc. Systems and methods of database instance container deployment
CN108959385A (zh) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 数据库部署方法、装置、计算机设备和存储介质
CN109542611A (zh) * 2017-09-21 2019-03-29 中国移动通信集团重庆有限公司 数据库即服务系统、数据库调度方法、设备及存储介质

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1645971B8 (en) * 2003-07-11 2016-03-30 Nippon Telegraph And Telephone Corporation Database access control method, database access control apparatus, proxy process server apparatus, program for database access control and recording medium recording the program
US9141435B2 (en) * 2007-07-30 2015-09-22 Sybase, Inc. System and methodology providing workload management in database cluster
US9032218B2 (en) * 2010-01-29 2015-05-12 Hewlett-Packard Development Company, L.P. Key rotation for encrypted storage media using a mirrored volume revive operation
US8984170B2 (en) * 2011-09-09 2015-03-17 Oracle International Corporation Idempotence for database transactions
US8977735B2 (en) * 2011-12-12 2015-03-10 Rackspace Us, Inc. Providing a database as a service in a multi-tenant environment
CN103023986B (zh) * 2012-11-27 2016-01-13 中国电信股份有限公司 一种对多用户提供rdbms服务的系统和方法
WO2015005833A1 (en) * 2013-07-08 2015-01-15 Telefonaktiebolaget L M Ericsson (Publ) Control of a distributed data grid layer in a federated database system
US20150310221A1 (en) * 2014-04-28 2015-10-29 Intuit Inc. Method and apparatus to rotate data encryption keys in databases with no down time
CN106599711A (zh) * 2015-10-15 2017-04-26 华为技术有限公司 一种数据库访问控制方法,及装置
GB2553540B (en) * 2016-09-07 2022-04-27 Sage Uk Ltd Cloud system
US10318346B1 (en) * 2016-09-23 2019-06-11 Amazon Technologies, Inc. Prioritized scheduling of data store access requests
CN108093094B (zh) * 2017-12-08 2021-05-28 腾讯科技(深圳)有限公司 数据库实例访问方法、装置、系统、存储介质和设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7502776B2 (en) * 2005-12-01 2009-03-10 Oracle International Corporation Dynamic connection establishment using an object link
CN105095317A (zh) * 2014-05-23 2015-11-25 中国银联股份有限公司 分布式数据库服务管理系统
US20170344584A1 (en) * 2016-05-27 2017-11-30 Wal-Mart Stores, Inc. Systems and methods of database instance container deployment
CN109542611A (zh) * 2017-09-21 2019-03-29 中国移动通信集团重庆有限公司 数据库即服务系统、数据库调度方法、设备及存储介质
CN108959385A (zh) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 数据库部署方法、装置、计算机设备和存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3951592A4 *

Also Published As

Publication number Publication date
EP3951592A1 (en) 2022-02-09
US20220091902A1 (en) 2022-03-24
EP3951592B1 (en) 2024-05-29
CN114880698B (zh) 2022-11-25
CN112149142A (zh) 2020-12-29
EP3951592A4 (en) 2022-06-15
CN114880698A (zh) 2022-08-09
CN116011013A (zh) 2023-04-25

Similar Documents

Publication Publication Date Title
WO2021000622A1 (zh) 数据库访问方法和装置、计算设备和计算机程序产品
WO2019119929A1 (zh) 区块链共识方法、装置和系统、标识信息处理方法和装置
WO2021073151A1 (zh) 基于多网通信的数据传输方法及相关设备
JP2021508877A (ja) 高性能分散型記録システム
EP2609517B1 (en) Constant access gateway and de-duplicated data cache server
JP5526137B2 (ja) 選択的データ転送ストレージ
CN107508795A (zh) 跨容器集群的访问处理装置及方法
US20200162245A1 (en) Method and system for performing ssl handshake
WO2023029655A1 (zh) 数据共享方法、网络侧设备、系统、电子设备和存储介质
CN114501593B (zh) 网络切片接入方法、装置、系统和存储介质
CN112929225B (zh) 会话异常处理方法、装置、计算机设备和存储介质
US20220150323A1 (en) User profile distribution and deployment systems and methods
WO2019196237A1 (zh) 居民户籍信息管理方法、服务器及计算机可读存储介质
WO2020258249A1 (zh) 数据库访问方法和装置、计算设备和计算机程序产品
US20200329012A1 (en) System and method for dedicated storage, through a secure internet connection, in a remote location
CN112235331B (zh) 一种数据传输处理方法及设备
CN112801795A (zh) 区块链多链管理方法、装置、电子设备及可读存储介质
CN108881257B (zh) 分布式搜索集群加密传输方法及加密传输分布式搜索集群
JP2017017587A (ja) ルータ装置、接続確立方法、通信システム、通信端末
CN116010529B (zh) 数据处理方法及系统
US11888829B2 (en) Dynamic routing and encryption using an information gateway
CN112699132B (zh) 安全模块解密的方法以及装置
US20240364667A1 (en) Data sharing method, network side device, system, electronic device, and storage medium
US10122823B2 (en) Transmission of data in a distributed data processing computer system
CN118568755A (zh) 一种可信多方数据传输方法、装置、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20834288

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020834288

Country of ref document: EP

Effective date: 20211029

NENP Non-entry into the national phase

Ref country code: DE