CN117560248A - Database access method, database gateway device, electronic device, and storage medium - Google Patents

Database access method, database gateway device, electronic device, and storage medium Download PDF

Info

Publication number
CN117560248A
CN117560248A CN202311540928.4A CN202311540928A CN117560248A CN 117560248 A CN117560248 A CN 117560248A CN 202311540928 A CN202311540928 A CN 202311540928A CN 117560248 A CN117560248 A CN 117560248A
Authority
CN
China
Prior art keywords
database
database access
access request
communication protocol
request message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311540928.4A
Other languages
Chinese (zh)
Inventor
李杨
戴琳琳
阎志远
单杏花
刘相坤
单新茹
李晓楠
段应杰
李雁明
苗凡
王智为
吕占民
刘典
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Academy of Railway Sciences Corp Ltd CARS
China State Railway Group Co Ltd
Beijing Jingwei Information Technology Co Ltd
Original Assignee
China Academy of Railway Sciences Corp Ltd CARS
China State Railway Group Co Ltd
Beijing Jingwei Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Academy of Railway Sciences Corp Ltd CARS, China State Railway Group Co Ltd, Beijing Jingwei Information Technology Co Ltd filed Critical China Academy of Railway Sciences Corp Ltd CARS
Priority to CN202311540928.4A priority Critical patent/CN117560248A/en
Publication of CN117560248A publication Critical patent/CN117560248A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the application provides a database access method, a database gateway device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: receiving a database access request message sent by a client based on a first communication protocol; determining one or more target databases in the database set and a second communication protocol supported by the one or more target databases according to the database access request message; transmitting a database access request message to one or more target databases based on a second communication protocol; receiving a first database access response message sent by one or more target databases based on a second communication protocol; a first database access response message is sent to the client based on the first communication protocol. The specific communication protocol used by the client is converted into the communication protocol supported by the database through the database gateway device, so that a developer does not need to learn different communication protocols when developing or maintaining the client program, and the learning cost is saved.

Description

Database access method, database gateway device, electronic device, and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a database access method, a database gateway device, an electronic device, and a computer readable storage medium.
Background
The database is a warehouse for organizing, storing and managing data according to a data structure, and the client can perform operations such as adding, intercepting, updating and deleting the data in the database by accessing the database.
The connection and operation of a client program to a database in the related art generally requires the client program to convert a specific communication protocol used by the client into a communication protocol supported by the database.
The railway ticket system generally uses a plurality of databases of different types at the same time, and because the communication protocols supported by the databases of different types are different, when the client communicates with the databases of different types, a client program is required to convert a specific communication protocol used by the client into the communication protocol supported by the databases of different types, so that when a developer develops or maintains the program, the developer is required to learn the communication protocol supported by the databases of different types, and the workload of the developer is increased.
It should be noted that the information disclosed in the background section of the present application is only intended to enhance understanding of the general background of the present application and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art that is already known to a person skilled in the art.
Disclosure of Invention
In view of this, the present application provides a database access method, a database gateway device, an electronic device, and a storage medium, so as to solve the problem in the prior art that when a client communicates with a different type of database, a client program is required to convert a specific communication protocol used by the client into a communication protocol supported by the different type of database, so that the workload of a developer is large.
In a first aspect, an embodiment of the present application provides a database access method, where the method includes:
receiving a database access request message sent by a client based on a first communication protocol;
determining one or more target databases in a database set and one or more second communication protocols supported by the target databases according to the database access request message;
transmitting the database access request message to one or more of the target databases based on the second communication protocol;
receiving a first database access response message sent by one or more target databases based on the second communication protocol;
the first database access response message is sent to the client based on the first communication protocol.
In one possible implementation of the present invention,
after the receiving client side sends the database access request message based on the first communication protocol, the method further comprises the following steps: judging whether the client has the access right of the database in the database set or not;
the determining, according to the database access request message, one or more target databases in the database set and one or more second communication protocols supported by the target databases includes: and if the client side is judged to have the access authority of the databases in the database set, determining one or more target databases in the database set and one or more second communication protocols supported by the target databases according to the database access request message.
In one possible implementation manner, the determining one or more target databases in the database set according to the database access request message includes:
and determining one or more target databases in the database collection according to the database access request message and the load condition of each database.
In one possible implementation manner, the determining one or more target databases in the database set according to the database access request message includes:
determining a database access request abstract according to the database access request message, wherein the database access request abstract is used for determining one or more target tables in the target database;
and determining target tables in one or more target databases in the database set according to the database access request abstract.
In one possible implementation, the method further includes:
storing specified data in the database set;
and sending a second database access response message to the client based on the first communication protocol, wherein the second database access response message comprises at least part of the specified data.
In one possible implementation, before the sending the database access request message to one or more of the target databases based on the second communication protocol, the method further includes:
a connection is created with one or more of the target databases.
In one possible implementation manner, after the receiving the first database access response message sent by the one or more target databases based on the second communication protocol, the method further includes:
releasing the connection with one or more of the target databases.
In one possible implementation, the databases in the set of databases support at least two communication protocols.
In a second aspect, an embodiment of the present application provides a database gateway apparatus, including:
the database access request information receiving module is used for receiving a database access request message sent by the client based on a first communication protocol;
a target database determining module, configured to determine, according to the database access request message, one or more target databases in a database set, and one or more second communication protocols supported by the target databases;
a database access request information sending module, configured to send the database access request message to one or more of the target databases based on the second communication protocol;
a database access response information receiving module, configured to receive a first database access response message sent by one or more of the target databases based on the second communication protocol;
and the database access corresponding information sending module is used for sending the first database access response message to the client based on the first communication protocol.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a processor;
a memory;
and a computer program, wherein the computer program is stored in the memory, the computer program comprising instructions that, when executed by the processor, cause the electronic device to perform the method of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium includes a stored program, where when the program runs, the program controls a device where the computer readable storage medium is located to execute the method described in the first aspect.
By adopting the scheme provided by the embodiment of the application, the specific communication protocol used by the client is converted into the communication protocol supported by the databases of different types through the database gateway device, so that a developer does not need to learn the communication protocol supported by the databases of different types when developing or maintaining the client program, the workload of the developer is reduced, and the learning cost is saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of database access according to an embodiment of the present application;
fig. 2 is a flowchart of a method for accessing a database according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another method for accessing a database according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating another database access method according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a database gateway device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For a better understanding of the technical solutions of the present application, embodiments of the present application are described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are merely some, but not all, of the embodiments of the present application. All other embodiments, based on the embodiments herein, which would be apparent to one of ordinary skill in the art without making any inventive effort, are intended to be within the scope of the present application.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one way of describing an association of associated objects, meaning that there may be three relationships, e.g., a and/or b, which may represent: the first and second cases exist separately, and the first and second cases exist separately. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
The database is a warehouse for organizing, storing and managing data according to a data structure, and the client can perform operations such as adding, intercepting, updating and deleting the data in the database by accessing the database. The connection and operation of a client program to a database in the related art generally requires the client program to convert a specific communication protocol used by the client into a communication protocol supported by the database.
The railway ticket system generally uses a plurality of databases of different types at the same time, and because the communication protocols supported by the databases of different types are different, when the client communicates with the databases of different types, a client program is required to convert a specific communication protocol used by the client into the communication protocol supported by the databases of different types, so that when a developer develops or maintains the program, the developer is required to learn the communication protocol supported by the databases of different types, and the workload of the developer is increased.
In view of the above problems, embodiments of the present application provide a database access method.
Referring to fig. 1, a schematic diagram of database access is provided in an embodiment of the present application. As shown in fig. 1, the client is connected to the database gateway device via a wired or wireless communication network, and the database gateway device is connected to the database via a wired or wireless communication network. The communication network may be a local area network or a wide area network that is switched through a relay (relay) device. When the communication network is a local area network, the communication network may be a wifi hotspot network, a wifi P2P network, a bluetooth network, a zigbee network, or a near field communication (near field communication, NFC) network, for example. When the communication network is a wide area network, the communication network may be, for example, a third generation mobile communication technology (3 rd-generation wireless telephone technology, 3G) network, a fourth generation mobile communication technology (the 4th generation mobile communication technology,4G) network, a fifth generation mobile communication technology (5 th-generation mobile communication technology, 5G) network, a future evolution public land mobile network (public land mobile network, PLMN), the internet, or the like.
When the client needs to access the database, the specific communication protocol used by the client can be converted into the communication protocol supported by the database through the database gateway device, a developer does not need to learn the communication protocols supported by different types of databases when developing or maintaining the client program, and the database gateway device adopts a unified interface, so that the developer can use the same code and query language to operate different databases, the workload of the developer is reduced, and the learning cost is saved.
The following is a detailed description.
Referring to fig. 2, a flowchart of a database access method according to an embodiment of the present application is shown. As shown in fig. 2, it mainly includes the following steps.
Step S201: the client transmits a database access request message to the database gateway apparatus based on the first communication protocol.
Specifically, the user may download corresponding application software or access corresponding web pages through a device such as a mobile phone, and trigger related operations in the corresponding application software or the corresponding web pages, so that the client sends a database access request message to the database gateway device based on the first communication protocol. The client not only comprises corresponding application software and corresponding webpages, but also comprises corresponding application software or a background server corresponding to the corresponding webpages.
Illustratively, the user a wants to query ticket information from beijing to shanghai, searches for ticket information from beijing to shanghai through ticket purchasing software on a mobile phone, generates a database access request message about querying ticket information from beijing to shanghai in response to an operation of the user a, and transmits the database access request message to the database gateway apparatus based on the first communication protocol.
Step S202: the database gateway device determines one or more target databases in the database set and a second communication protocol supported by the one or more target databases according to the database access request message.
Specifically, the database set includes a plurality of databases, each database has different data contents, and the database gateway device needs to determine one or more target databases in the database set according to the database access request message sent by the client. Because the communication protocols supported by the database may be different from the particular communication protocols used by the client, the database gateway device, after determining the one or more target databases, also determines a second communication protocol supported by the one or more target databases.
It is appreciated that the first communication protocol used by the client is different from the second communication protocol supported by the target database. In addition, the communication protocols supported by multiple databases in the database set may also be different, with at least two communication protocols supported by the databases in the database set.
In one possible implementation, one or more databases in the database collection are determined based on the database access request message and the load condition of each database. Specifically, the database set includes a plurality of databases, and each database has different current load conditions, if a plurality of clients access the same database at the same time, the database may be overloaded, so that in order to prevent the overload condition of the databases, the database gateway device may determine one or more target databases in the database set according to the load condition of each database in the database set.
For example, when the database 1 and the database 2 have data about the ticket information from beijing to shanghai, and the plurality of users inquire the ticket information from beijing to shanghai through the client in the same time period, the database gateway device may disperse the database access request messages of the plurality of users into the database 1 and the database 2 according to the load conditions of the database 1 and the database 2, so that the overload condition of the database is not caused, and the access speed of the users is also accelerated. That is, the access experience of the user can be improved under the condition that the overload of the database is not ensured.
In one possible implementation, a database access request digest is generated from the database access request message, and a target table in one or more target databases in the database collection is determined from the database access request digest. Wherein the database access summary is used to determine target tables in one or more target databases. Since the database access request message is of an arbitrary length, it is difficult for the database gateway apparatus to accurately determine the target table in the target database based on the database access request message. Therefore, the database gateway device hashes the database access message to obtain a database access request abstract, and the database access request abstract is of a fixed length, so that the database gateway device is facilitated to determine target tables in one or more target databases, the search time is saved, and the working efficiency is improved.
In one possible implementation, after receiving a database access request message sent by a client based on a first communication protocol, determining whether the client has access rights to a database in the database set, and if so, determining one or more target databases in the database set and a second communication protocol supported by the one or more target databases according to the database access request message. Specifically, different users may have different access rights to the database, for example, a common user may only have access to a portion of the contents in a portion of the database and an administrator may have access to all of the contents in all of the databases. Therefore, when searching the target database, the database gateway device needs to judge whether the client has the access right of the database in the database set in advance, and if the client has the access right of the database in the database set, one or more target databases in the database set and a second communication protocol supported by the one or more target databases are determined according to the database access request message; and if the client does not have the access authority of the database in the database set, rejecting the database access request. In addition, the database gateway device may also implement a fine-grained access control policy, that is, a detailed division of access rights of clients. For example, a common user may only have access to a certain column in a certain table in the database, but the administrator may have access to all the data in the entire database, with different access rights to the same database from the common user.
Step S203: the database gateway device sends a database access request message to one or more target databases based on the second communication protocol.
Specifically, the database gateway device sends the database access request message to one or more target databases based on the second communication protocol, thereby realizing the conversion of the first communication protocol used by the client into the second communication protocol supported by the databases.
In one possible implementation, after the database gateway device determines that the client has access rights to one or more target databases, the database gateway device sends a database access request message sent by the client to the one or more target databases. The security of the data in the database is also protected while the first communication protocol used by the client is converted into the second communication protocol supported by the database.
Step S204: the target database sends a first database access response message to the database gateway device based on the second communication protocol.
Specifically, after receiving the database access request message sent by the database gateway device, the target database executes a query or operation specified in the database access request message, for example, executes a structured query language (Structured Query Language, SQL) or updates a database record, generates a first database access response message according to the execution result, and sends the first database access response message to the database gateway device based on the second communication protocol.
Illustratively, the user queries ticket information from Beijing to Shanghai through the client, the target database receives a database access request message about querying ticket information from Beijing to Shanghai, performs a query operation, generates a first database access response message according to a query result, and finally transmits the first database access response message to the database gateway device based on the second communication protocol.
Step S205: the database gateway device sends a first database access response message to the client based on the first communication protocol.
Specifically, after receiving a first database access response message sent by the target database based on the second communication protocol, the database gateway device converts the second communication protocol into the first communication protocol, and sends the first database access response message to the client based on the first communication protocol.
As described above, when the client needs to access the database, the specific communication protocol used by the client can be converted into the communication protocol supported by the database through the database gateway device, so that a developer does not need to learn the communication protocols supported by different types of databases when developing or maintaining the client program, thereby reducing the workload of the developer and saving the learning cost.
In practical application, if the database gateway device is required to search one or more target databases every time the user accesses the databases, the algorithm and the program of the database gateway device are complicated; and if the database gateway device transmits the received database access request message to the target database every time, the target database needs to respond to all the database access request messages, and the response speed of the database access request messages transmitted by part of clients is slower due to the limited number of databases in the database set. Therefore, the database gateway device can store the designated data in the database set, and can directly search the corresponding data from the stored data after receiving the database access request message sent by the client, and send the corresponding data as a second database access message to the client.
Specifically, the following is a detailed description in connection with specific embodiments.
Referring to fig. 3, a flowchart of another database access method according to an embodiment of the present application is shown. As shown in fig. 3, the method further comprises the following steps on the basis of the embodiment shown in fig. 2.
Step S301: the database gateway device stores the specified data in the database collection.
Specifically, the database gateway device stores information such as the historical ticket information of the user or the ticket information searched by the user in the database collection into the database gateway device, so that when the user wants to check the historical ticket information or check the searched ticket information, the database gateway device can send the ticket information to the client relatively quickly.
Illustratively, the database gateway device stores the historical ticket information of the user as the specified data in advance, and when the user queries the historical ticket information through the client, the client sends the database access request message of the user to the database gateway device based on the first communication protocol, and the database gateway device can directly search the historical ticket information of the user from the stored data.
Step S302: a second database access response message is sent to the client based on the first communication protocol.
Specifically, the database gateway device searches the specified data for target data corresponding to the database access request message sent by the client, converts the target data into a second database access response message, and finally sends the second database access response message to the client based on the first communication protocol.
For example, if the user has queried ticket information from beijing to shanghai through the client, when the user again queries ticket information from beijing to shanghai through the client, the client transmits a database access request message of the user to the database gateway device based on the first communication protocol, the database gateway device searches the stored specified data for ticket information from beijing to shanghai (i.e., the second database access response message), and transmits history ticket information to the client based on the first communication protocol.
The database gateway device can directly search corresponding data from the stored data after receiving the database access request message sent by the client by storing the designated data in the database set, and can send the corresponding data as a second database access message to the client. The flow of accessing the database by the client is simplified, and the response speed of the database is also improved.
In practical applications, if a new connection needs to be established every time the database gateway device sends a database access request message to one or more target databases based on the second communication protocol, the algorithm and the program of the database gateway device may be complex, the calculation cost may be wasted, and the error rate of the connection between the database gateway device and the target databases may be high. Thus, the database gateway device establishes a connection with one or more target databases before sending the database access request message to the target databases, and does not disconnect the database gateway device from the one or more target databases after the one or more target databases send the first database access response message to the database gateway device, so as to facilitate use when the client sends the same database access request message.
Specifically, the following is a detailed description in connection with specific embodiments.
Referring to fig. 4, a flowchart of another database access method according to an embodiment of the present application is shown. As shown in fig. 4, the method further comprises the following steps on the basis of the embodiment shown in fig. 2.
Step S401: a connection is created with one or more target databases.
Specifically, after determining one or more target databases in the database collection and a second communication protocol supported by the one or more target databases, the database gateway device creates a connection with the one or more target databases so that the database gateway device sends a database access request message to the one or more target databases based on the second communication protocol.
Step S402: the connection with the one or more target databases is released.
Specifically, the database gateway device releases the connection with the one or more target databases after receiving the first inter-database response message sent by the one or more target databases based on the second communication protocol. It should be noted that releasing the connection with the one or more target databases does not mean disconnecting the connection with the one or more target databases. After the database gateway device receives the first database query response message sent by the one or more target databases based on the second communication protocol, it means that the data transmission between the database gateway device and the target databases has ended, at which point the database gateway device releases the connection, and when the database gateway device receives a new database access request message, the connection may be re-enabled.
The database gateway device can efficiently manage the connection between the database gateway and the target database by controlling the creation, release and re-starting of the connection between the database gateway and the target database, thereby improving the resource utilization rate and reducing the cost of database connection.
Corresponding to the above embodiment, the present application further provides a database gateway device.
Referring to fig. 5, a schematic structural diagram of a database gateway device according to an embodiment of the present application is provided. As shown in fig. 5, the database gateway apparatus may include: a database access request information receiving module 501, a target database determining module 502, a database access request information transmitting module 503, a database access response information receiving module 504, and a database access corresponding information transmitting module 505. The components may communicate via one or more buses, and it will be appreciated by those skilled in the art that the configuration of the control device as shown in the drawings is not limiting of the embodiments of the invention, and that it may be a bus-like structure, a star-like structure, or may include more or less components than those shown, or may be a combination of certain components, or a different arrangement of components.
The database access request information receiving module 501 is configured to receive a database access request message sent by a client based on a first communication protocol.
The target database determining module 502 is configured to determine, according to the database access request message, one or more target databases in the database set, and one or more second communication protocols supported by the target databases.
The database access request information sending module 503 is configured to send the database access request message to one or more of the target databases based on the second communication protocol.
The database access response information receiving module 504 is configured to receive a first database access response message sent by one or more of the target databases based on the second communication protocol.
The database access corresponding information sending module 505 is configured to send the first database access response message to the client based on the first communication protocol.
Corresponding to the above embodiment, the present application also provides an electronic device.
Referring to fig. 6, a schematic structural diagram of an electronic device according to an embodiment of the present application is provided. As shown in fig. 6, the electronic device 600 may include: processor 601, memory 602, and communication unit 603. The components may communicate via one or more buses, and it will be appreciated by those skilled in the art that the configuration of the electronic device shown in the drawings is not limiting of the embodiments of the invention, as it may be a bus-like structure, a star-like structure, or include more or fewer components than shown, or may be a combination of certain components or a different arrangement of components.
Wherein, the communication unit 603 is configured to establish a communication channel, so that the electronic device may communicate with other devices. Receiving user data sent by other devices or sending user data to other devices.
The processor 601 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and/or processes data by running or executing software programs, instructions, and/or modules stored in the memory 602, and invoking data stored in the memory. The processor may be comprised of integrated circuits (integrated circuit, ICs), such as a single packaged IC, or may be comprised of packaged ICs that connect multiple identical or different functions. For example, the processor 801 may include only a central processing unit (central processing unit, CPU). In the embodiment of the invention, the CPU can be a single operation core or can comprise multiple operation cores.
The memory 602, for storing instructions for execution by the processor 601, the memory 602 may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
The execution of the instructions in memory 602, when executed by processor 601, enables electronic device 600 to perform some or all of the steps of the embodiment shown in fig. 1.
In a specific implementation, an embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a program, where the program may include some or all of the steps in each embodiment of the method for generating a simulation scene provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random-access memory (random access memory, RAM), or the like.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relation of association objects, and indicates that there may be three kinds of relations, for example, a and/or B, and may indicate that a alone exists, a and B together, and B alone exists. Wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of the following" and the like means any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in the embodiments disclosed herein can be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In several embodiments provided herein, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The same or similar parts between the various embodiments in this specification are referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and reference should be made to the description in the method embodiment for relevant points.

Claims (11)

1. A method of database access, the method comprising:
receiving a database access request message sent by a client based on a first communication protocol;
determining one or more target databases in a database set and one or more second communication protocols supported by the target databases according to the database access request message;
transmitting the database access request message to one or more of the target databases based on the second communication protocol;
receiving a first database access response message sent by one or more target databases based on the second communication protocol;
the first database access response message is sent to the client based on the first communication protocol.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
after the receiving client side sends the database access request message based on the first communication protocol, the method further comprises the following steps: judging whether the client has the access right of the database in the database set or not;
the determining, according to the database access request message, one or more target databases in the database set and one or more second communication protocols supported by the target databases includes: and if the client side is judged to have the access authority of the databases in the database set, determining one or more target databases in the database set and one or more second communication protocols supported by the target databases according to the database access request message.
3. The method of claim 1, wherein determining one or more target databases in a database collection from the database access request message comprises:
and determining one or more target databases in the database collection according to the database access request message and the load condition of each database.
4. The method of claim 1, wherein determining one or more target databases in a database collection from the database access request message comprises:
determining a database access request abstract according to the database access request message, wherein the database access request abstract is used for determining one or more target tables in the target database;
and determining target tables in one or more target databases in the database set according to the database access request abstract.
5. The method according to claim 1, wherein the method further comprises:
storing specified data in the database set;
and sending a second database access response message to the client based on the first communication protocol, wherein the second database access response message comprises at least part of the specified data.
6. The method of claim 1, further comprising, prior to said sending said database access request message to one or more of said target databases based on said second communication protocol:
a connection is created with one or more of the target databases.
7. The method of claim 1, further comprising, after said receiving a first database access response message sent by one or more of said target databases based on said second communication protocol:
releasing the connection with one or more of the target databases.
8. The method of claim 1, wherein the databases in the set of databases support at least two communication protocols.
9. A database gateway apparatus, comprising:
the database access request information receiving module is used for receiving a database access request message sent by the client based on a first communication protocol;
a target database determining module, configured to determine, according to the database access request message, one or more target databases in a database set, and one or more second communication protocols supported by the target databases;
a database access request information sending module, configured to send the database access request message to one or more of the target databases based on the second communication protocol;
a database access response information receiving module, configured to receive a first database access response message sent by one or more of the target databases based on the second communication protocol;
and the database access corresponding information sending module is used for sending the first database access response message to the client based on the first communication protocol.
10. An electronic device, comprising:
a processor;
a memory;
and a computer program, wherein the computer program is stored in the memory, the computer program comprising instructions that, when executed by the processor, cause the electronic device to perform the method of any one of claims 1 to 8.
11. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run controls a device in which the computer readable storage medium is located to perform the method according to any one of claims 1 to 8.
CN202311540928.4A 2023-11-17 2023-11-17 Database access method, database gateway device, electronic device, and storage medium Pending CN117560248A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311540928.4A CN117560248A (en) 2023-11-17 2023-11-17 Database access method, database gateway device, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311540928.4A CN117560248A (en) 2023-11-17 2023-11-17 Database access method, database gateway device, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN117560248A true CN117560248A (en) 2024-02-13

Family

ID=89820092

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311540928.4A Pending CN117560248A (en) 2023-11-17 2023-11-17 Database access method, database gateway device, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN117560248A (en)

Similar Documents

Publication Publication Date Title
CN110489417B (en) Data processing method and related equipment
US8965958B2 (en) File fetch from a remote client device
CN107809383B (en) MVC-based path mapping method and device
CN108377247B (en) Message pushing method and device
CN103167031A (en) Communication between Web applications
US20060168079A1 (en) System and method for automatically connecting a client computer to a server
CN104834534A (en) Application program function extension method, device and system
CN111352716B (en) Task request method, device and system based on big data and storage medium
CN110351107B (en) Configuration management method and device
FI120286B (en) A method and device arrangement for managing a server-client environment
CN105897865B (en) A kind of network file service management system and method that agreement is unrelated
CN110661851A (en) Data exchange method and device
CN103186536A (en) Method and system for scheduling data shearing devices
CN107105004B (en) Cross-platform service calling method and device
CN101753561B (en) Business cluster processing method and cluster system
CN110071952B (en) Service call quantity control method and device
CN117560248A (en) Database access method, database gateway device, electronic device, and storage medium
CN112685613B (en) Resource package query method and device and information processing system
CN111970358B (en) Decentralized cloud computing platform, service deployment method and service access method and service deployment and service access assembly
CN105025042A (en) Method of determining data information, system and proxy servers
CN109600452B (en) Server cluster, message pushing method and related server
CN110941412B (en) Method, system and terminal for realizing multi-terminal animation collaborative browsing based on pictures
CN113746909A (en) Network connection method, device, electronic equipment and computer readable storage medium
KR100904362B1 (en) Calm capable of searching agent service through web, agent system using the same and operation method of agent system
EP1941356B1 (en) Electronic apparatus with server device for managing setting data

Legal Events

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