CN112527817A - Information processing method, information processing apparatus, storage medium, and electronic device - Google Patents

Information processing method, information processing apparatus, storage medium, and electronic device Download PDF

Info

Publication number
CN112527817A
CN112527817A CN202011444379.7A CN202011444379A CN112527817A CN 112527817 A CN112527817 A CN 112527817A CN 202011444379 A CN202011444379 A CN 202011444379A CN 112527817 A CN112527817 A CN 112527817A
Authority
CN
China
Prior art keywords
structured query
database
query statement
target
type
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
CN202011444379.7A
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.)
Beijing Dami Technology Co Ltd
Original Assignee
Beijing Dami Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dami Technology Co Ltd filed Critical Beijing Dami Technology Co Ltd
Priority to CN202011444379.7A priority Critical patent/CN112527817A/en
Publication of CN112527817A publication Critical patent/CN112527817A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24558Binary matching operations
    • G06F16/2456Join operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses an information processing method, an information processing device, a storage medium and electronic equipment. After receiving the structured query statement sent by the preset terminal, the embodiment of the invention determines the type of the structured query statement, and distributes the structured query statement to the database cluster corresponding to the type, thereby receiving the query result of the structured query statement and returning the query result to the preset terminal. The embodiment of the invention can effectively reduce the maintenance cost of database cluster connection and provide a more stable database access mode for users.

Description

Information processing method, information processing apparatus, storage medium, and electronic device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an information processing method, an information processing apparatus, a storage medium, and an electronic device.
Background
With the rapid development of computer technology, the size of data and the access amount of data are continuously increasing. To accommodate the increasing volume of data access, more and more technicians choose to share the access pressure of a single database by deploying a cluster of databases. However, the conventional database cluster access method has low fault tolerance rate and cannot better satisfy a read-write separation scene, so that the stability of accessing the database cluster is low and the maintenance cost is high.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide an information processing method, an information processing apparatus, a storage medium, and an electronic device, which are used to reduce maintenance cost of database cluster connection and provide a relatively stable database access manner for a user.
According to a first aspect of embodiments of the present invention, there is provided an information processing method adapted to a server that manages a plurality of database clusters, the method including:
receiving a structured query statement sent by a preset terminal;
determining a type of the structured query statement;
determining a target database cluster corresponding to the structured query statement;
distributing the structured query statement to a target database, wherein the target database is a database corresponding to the type in the target database cluster;
and receiving the query result of the structured query statement, and sending the query result to the preset terminal.
Preferably, the determining the type of the structured query statement comprises:
performing word segmentation on the structured query statement to obtain a predetermined field in the structured query statement;
determining the type according to the predetermined field.
Preferably, the determining a target database cluster corresponding to the structured query statement includes:
and determining a target database cluster corresponding to the structured query statement from the plurality of database clusters based on a target connection pool, wherein the target connection pool is a connection pool of the plurality of database clusters, and the target connection pool is determined according to a preset rule.
Preferably, the structured query statement is an SQL statement, and the types include a read type and a write type.
Preferably, the distributing the structured query statement to the target database specifically includes:
in response to the type being a write type, distributing the structured query statement to a master database in the target database cluster based on a target connection pool, the target connection pool being a connection pool of the plurality of database clusters, the target connection pool determined according to a predetermined rule;
in response to the type being a read type, distributing the structured query statement to a slave database in the target database cluster based on the target connection pool.
According to a second aspect of an embodiment of the present invention, there is provided an information processing apparatus adapted to manage servers of a plurality of database clusters, the apparatus including:
the sentence receiving unit is used for receiving a structured query sentence sent by a preset terminal;
a type determining unit, configured to determine a type of the structured query statement;
the cluster determining unit is used for determining a target database cluster corresponding to the structured query statement;
a statement distribution unit, configured to distribute the structured query statement to a target database, where the target database is a database corresponding to the type in the target database cluster;
and the result receiving unit is used for receiving the query result of the structured query statement and sending the query result to the preset terminal.
According to a third aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored thereon computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method of any of the first aspects.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of the first aspect.
After receiving the structured query statement sent by the preset terminal, the embodiment of the invention determines the type of the structured query statement, and distributes the structured query statement to the database cluster corresponding to the type, thereby receiving the query result of the structured query statement and returning the query result to the preset terminal. The embodiment of the invention can effectively reduce the maintenance cost of database cluster connection and provide a more stable database access mode for users.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
fig. 1 is a flowchart of an information processing method of a first embodiment of the present invention;
FIG. 2 is a schematic diagram of an information processing method of an embodiment of the present invention;
fig. 3 is a schematic diagram of an information processing apparatus of a second embodiment of the present invention;
fig. 4 is a schematic diagram of an electronic device according to a third embodiment of the invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth. It will be apparent to one skilled in the art that the present invention may be practiced without these specific details. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present invention.
Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including, but not limited to".
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
In order to meet the increasing database access requirements and adapt to the increasing variety of client services, the internet industry increasingly chooses to store service data through multiple database clusters, and different database clusters can store different data and provide access for users. However, the connection pool of the existing database cluster only supports access of a single database cluster, and no standby connection exists, so that the fault tolerance rate of the access mode of the existing database cluster is low, and a certain database in the database cluster is failed, which may cause at least one service to be unavailable. And the existing access mode of the database cluster cannot better meet the read-write separation scene, so that the stability of the database cluster is low, and the maintenance cost is high.
Fig. 1 is a flowchart of an information processing method of a first embodiment of the present invention. As shown in fig. 1, the method of the present embodiment includes the following steps:
step S100, receiving a structured query statement sent by a preset terminal.
When a user carries out operations such as information query, adding new data, deleting existing data and the like through a preset terminal, the preset terminal sends a structured query statement to a server. For example, when a user performs online learning through online teaching software (i.e., a client), the user may query an existing course, and when the user queries the existing course, the predetermined terminal may send a structured query statement corresponding to the course query to the server through the client; after any course is played, the learning progress of the user is updated, and the predetermined terminal can send the structured query sentence corresponding to the learning progress update to the server.
The structured query statement is a statement written in a structured query language. In this embodiment, the Structured Query Language may be SQL (Structured Query Language, which may be specifically Structured Query Language), DQL (Data Query Language), DML (Data Manipulation Language), DDL (Data Definition Language), and the like.
Step S200, determining the type of the structured query statement.
After receiving the structured query statement sent by the predetermined terminal, the server in this embodiment may determine the type of the structured query statement in order to implement read-write separation of the structured query statement. Taking the SQL statement as an example, the SQL statement mainly includes four types of add (insert), delete (delete), modify (update), and query (select), wherein the add, delete, and modify belong to a write type, and the query belongs to a read type.
Optionally, in order to reduce the cost of read-write separation, this step determines the type of the structured query statement through a word segmentation technique. Specifically, the server may perform word segmentation on the structured query statement, obtain a predetermined field in the structured query statement, and then determine the type of the structured query statement according to the predetermined field. The structured query sentence is written according to the natural language rule, so that the server can divide the structured query sentence by the existing natural language word division technology, for example, by the ending word division, or can use continuous non-empty characters as a field to achieve the purpose of word division. After the word segmentation is performed to obtain a plurality of fields corresponding to the structured query statement, the server may determine the type of the structured query statement according to predetermined fields therein.
For example, the structured query statement L1 is select from table _1where user name is 'user 1', and the server may use continuous non-empty characters in the structured query statement L1 as a field to obtain multiple fields corresponding to the structured query statement L1, that is, select, from, table _1, where user and user name are 'user 1', where "select" is a predetermined field. After obtaining the predetermined field, the server may determine that the type of the structured query statement L1 is a read type.
Optionally, an SQL Parser (structured query language Parser) may be deployed in the server in advance, and the structured query statement received by the server is parsed by the SQL Parser, so as to determine the type of the structured query statement.
And step S300, determining a target database cluster corresponding to the structured query statement.
In the prior art, a server may implement access to a single Database cluster based on JDBC (Java Database Connectivity). JDBC is an application program interface in Java language used to specify how a client program accesses a database, and can provide methods for querying and updating database data. JDBC does not support access to multiple database clusters. Therefore, in this embodiment, the server may call the SQL Parser based on JDBC to parse the structured query statement, determine a database variable in the structured query statement, and determine the database cluster corresponding to the database variable as the target database cluster corresponding to the structured query statement.
The database variable is also a predetermined field in the structured query statement, and is used for characterizing the identifier of the database cluster to be accessed by the structured query statement, namely the storage location of the data. After determining the database variables, the server may determine the database cluster corresponding to the database variables as a target database cluster corresponding to the structured query statement.
It is easy to understand that step S200 and step S300 may be executed simultaneously or sequentially, and this embodiment is not particularly limited.
Step S400, distributing the structured query statement to a target database.
In this step, after receiving the structured query statement, the server may distribute the structured query statement to a corresponding database (i.e., a target database) in the target database cluster through a pre-deployed SQL Router. The SQL Router is a lightweight agent program between a client service and a database, can detect and analyze a structured query statement, forwards the structured query statement to a connection pool, and can return an obtained query result to a predetermined terminal.
In this embodiment, the client service and the database cluster are connected through a target connection pool, and the target connection pool is divided into two levels, one level is a level of the database cluster, and the other level is a level of the database, that is, the target connection pool stores connections of nodes (i.e., databases, including a master database and a slave database) in a plurality of database clusters. The connection in the connection pool is reusable, that is, after the server returns the query result of the structured query statement to the predetermined terminal, the connection of the database cluster and the connection of the database corresponding to the structured query statement are both returned to the target connection pool. The overhead of creating connections can be reduced and the time consumption of repeatedly creating physical connections is significantly reduced.
The target connection pool is determined based on predetermined rules. Different data are stored in different database clusters, so that the preset rule can be used for representing the corresponding relation between the type and the database and also representing the corresponding relation between the data and the storage position, the target connection pool of the embodiment can support read-write separation, a technician does not need to additionally set read-write separation logic, and the maintenance cost of database cluster access is reduced.
The server can distribute the structured query statement to a master database corresponding to the target database cluster through the SQL Router based on the target connection pool, or distribute the structured query statement to a slave database corresponding to the target database cluster. Specifically, the server can acquire the connection between the client service and the target database cluster from the target connection pool through the SQL Router, and if the type of the structured query statement is the read type, the server can acquire the connection between the client service and the slave database in the target database cluster from the target connection pool through the SQL Router and distribute the structured query statement to the slave database of the target database cluster; if the type of the structured query statement is a write type, the server can acquire the connection between the client service and the main database in the target database cluster from the target connection pool through SQL Router, and distribute the structured query statement to the main database of the target database cluster.
For example, the structured query statement L2 is select from table _510where user name is 'Jimmy', the type of the structured query statement L2 is read type, and the SQL Router may obtain the connection of the database cluster corresponding to the structured query statement L2 from the target connection pool according to the field "table _ 510" in the structured query statement L2, then obtain the connection of the database cluster from the database from the target connection pool, and distribute the structured query statement L2 to the slave database of the corresponding database cluster.
It is easily understood that a plurality of slave databases may be included in the database cluster, so that when the SQL Router distributes the structured query statement to the slave databases, it may select one slave database connection that is accessible and has a low access amount (for example, the lowest ranked first order) from the target connection pool, and distribute the structured query statement to the slave databases, so as to avoid a situation that a large number of structured query statements are concentrated in the same slave database, and thus, the stability of database cluster access may be further improved.
Step S500, receiving the query result of the structured query statement, and sending the query result to a predetermined terminal.
In this step, the server may also receive, through the pre-deployed SQL Router, the query result of the structured query statement returned by the database, and return the query result to the predetermined terminal.
Fig. 2 is a schematic diagram of an information processing method according to an embodiment of the present invention. As shown in fig. 2, after the user sends the SQL statement to the server (not shown in the figure) through the terminal 21, the server may call the SQL Parser through the JDBC deployed in the internal portion 22 to parse the SQL statement sent by the terminal 21, and determine the target data cluster corresponding to the SQL statement. Meanwhile, the server may also analyze the SQL statement through the SQL Parser deployed in the internal 22, and determine the type corresponding to the SQL statement, that is, the write type. Further, the server can obtain the connection of the target database cluster and the connection of the target database from the connection pool 23 (i.e., the target connection pool) according to the SQL statement through the SQL Router deployed in the internal 22. The connection of the target database cluster as the database cluster 24m will be described as an example. The connection pool 23 stores connections of client services to the database cluster 24m, including a connection Lm1 of client services to a plurality of slave databases in the database cluster 24m and a connection Lm2 of client services to a master database. After determining that the database cluster corresponding to the SQL statement is the database cluster 24m, the SQL Router may obtain the connection between the client service and the database cluster 24m and the connection between the client service and the database (i.e., master database) of the write type in the database cluster 24m, i.e., the connection Lm2, then distribute the SQL statement to the master database of the database cluster 24m, obtain the query result returned by the master database of the database cluster 24m, then return the query result to the terminal 21, and return the connection between the client service and the database cluster 24m and the connection between the client service and the master database in the database cluster 24m to the connection pool 23.
In this embodiment, after receiving a structured query statement sent by a predetermined terminal, the type of the structured query statement is determined, and the structured query statement is distributed to a database cluster corresponding to the type, so as to receive a query result of the structured query statement and return the query result to the predetermined terminal. The embodiment can effectively reduce the maintenance cost of database cluster connection and provide a stable database access mode for users.
Fig. 3 is a schematic diagram of an information processing apparatus of a second embodiment of the present invention, which is adapted to a server that manages a plurality of database clusters. As shown in fig. 3, the apparatus of the present embodiment includes a sentence receiving unit 31, a type determining unit 32, a cluster determining unit 33, a sentence distributing unit 34, and a result receiving unit 35.
The sentence receiving unit 31 is configured to receive a structured query sentence sent by a predetermined terminal. The type determination unit 32 is configured to determine the type of the structured query statement. The cluster determining unit 33 is configured to determine a target database cluster corresponding to the structured query statement. The statement distribution unit 34 is configured to distribute the structured query statement to a target database, where the target database is a database corresponding to the type in the target database cluster. The result receiving unit 35 is configured to receive a query result of the structured query statement, and send the query result to the predetermined terminal.
Further, the type determining unit 32 includes a field acquiring subunit and a type determining subunit.
The field obtaining subunit is configured to perform word segmentation on the structured query statement, and obtain a predetermined field in the structured query statement. The type determining subunit is used for determining the type according to the predetermined field.
Further, the cluster determining unit 33 includes a variable determining subunit and a cluster determining subunit.
The variable determination subunit is used for determining the database variables in the structured query statement. The cluster determining subunit is configured to determine a database cluster corresponding to the database variable as the target data cluster.
Further, the structured query statement is an SQL statement, and the types include a read type and a write type.
Further, the sentence distribution unit 34 includes a first connection acquisition subunit, a second connection acquisition subunit, and a third connection acquisition subunit.
The first connection obtaining subunit is configured to obtain, based on a target connection pool, a cluster connection corresponding to the target database cluster, where the target connection pool is a connection pool of the plurality of database clusters, and the target connection pool is determined according to a predetermined rule. The second connection obtaining subunit is configured to, in response to the type being a write type, obtain a master database connection based on a target connection pool to distribute the structured query statement to a master database in the target database cluster. The third connection obtaining subunit is configured to, in response to the type being a read type, obtain a slave database connection based on the target connection pool to distribute the structured query statement to a slave database in the target database cluster.
In this embodiment, after receiving a structured query statement sent by a predetermined terminal, the type of the structured query statement is determined, and the structured query statement is distributed to a database cluster corresponding to the type, so as to receive a query result of the structured query statement and return the query result to the predetermined terminal. The embodiment can effectively reduce the maintenance cost of database cluster connection and provide a stable database access mode for users.
Fig. 4 is a schematic diagram of an electronic device according to a third embodiment of the invention. The electronic device shown in fig. 4 is a general-purpose data processing apparatus, and may be specifically a first terminal, a second terminal or a server according to an embodiment of the present invention, and includes a general-purpose computer hardware structure, which includes at least a processor 41 and a memory 42. The processor 41 and the memory 42 are connected by a bus 43. The memory 42 is adapted to store instructions or programs executable by the processor 41. Processor 41 may be a stand-alone microprocessor or may be a collection of one or more microprocessors. Thus, processor 41 implements the processing of data and the control of other devices by executing commands stored in memory 42 to thereby execute the method flows of embodiments of the present invention as described above. The bus 43 connects the above components together, and also connects the above components to a display controller 44 and a display device and an input/output (I/O) device 45. Input/output (I/O) devices 45 may be a mouse, keyboard, modem, network interface, touch input device, motion sensing input device, printer, and other devices known in the art. Typically, an input/output (I/O) device 45 is connected to the system through an input/output (I/O) controller 46.
The memory 42 may store, among other things, software components such as an operating system, communication modules, interaction modules, and application programs. Each of the modules and applications described above corresponds to a set of executable program instructions that perform one or more functions and methods described in embodiments of the invention.
The flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention described above illustrate various aspects of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Also, as will be appreciated by one skilled in the art, aspects of embodiments of the present invention may be embodied as a system, method or computer program product. Accordingly, various aspects of embodiments of the invention may take the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "circuit," module "or" system. Further, aspects of the invention may take the form of: a computer program product embodied in one or more computer readable media having computer readable program code embodied thereon.
Any combination of one or more computer-readable media may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of embodiments of the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to: electromagnetic, optical, or any suitable combination thereof. The computer readable signal medium may be any of the following computer readable media: is not a computer readable storage medium and may communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including: object oriented programming languages such as Java, Smalltalk, C + +, PHP, Python, and the like; and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package; executing in part on a user computer and in part on a remote computer; or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. An information processing method adapted to a server managing a plurality of database clusters, the method comprising:
receiving a structured query statement sent by a preset terminal;
determining a type of the structured query statement;
determining a target database cluster corresponding to the structured query statement;
distributing the structured query statement to a target database, wherein the target database is a database corresponding to the type in the target database cluster;
and receiving the query result of the structured query statement, and sending the query result to the preset terminal.
2. The method of claim 1, wherein the determining the type of the structured query statement comprises:
performing word segmentation on the structured query statement to obtain a predetermined field in the structured query statement;
determining the type according to the predetermined field.
3. The method of claim 1, wherein the determining a target database cluster to which the structured query statement corresponds comprises:
determining a database variable in the structured query statement;
and determining the database cluster corresponding to the database variable as the target data cluster.
4. The method of claim 1, wherein the structured query statement is an SQL statement, and wherein the types include a read type and a write type.
5. The method of claim 4, wherein the distributing the structured query statement to a target database is specifically:
acquiring cluster connection corresponding to the target database cluster based on a target connection pool, wherein the target connection pool is a connection pool of the plurality of database clusters, and the target connection pool is determined according to a preset rule;
in response to the type being a write type, obtaining a master database connection based on a target connection pool to distribute the structured query statement to a master database in the target database cluster;
in response to the type being a read type, obtaining a slave database connection based on the target connection pool to distribute the structured query statement to a slave database in the target database cluster.
6. An information processing apparatus adapted to manage servers of a plurality of database clusters, the apparatus comprising:
the sentence receiving unit is used for receiving a structured query sentence sent by a preset terminal;
a type determining unit, configured to determine a type of the structured query statement;
the cluster determining unit is used for determining a target database cluster corresponding to the structured query statement;
a statement distribution unit, configured to distribute the structured query statement to a target database, where the target database is a database corresponding to the type in the target database cluster;
and the result receiving unit is used for receiving the query result of the structured query statement and sending the query result to the preset terminal.
7. A computer-readable storage medium on which computer program instructions are stored, which, when executed by a processor, implement the method of any one of claims 1-5.
8. An electronic device comprising a memory and a processor, wherein the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of any of claims 1-5.
CN202011444379.7A 2020-12-08 2020-12-08 Information processing method, information processing apparatus, storage medium, and electronic device Pending CN112527817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011444379.7A CN112527817A (en) 2020-12-08 2020-12-08 Information processing method, information processing apparatus, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011444379.7A CN112527817A (en) 2020-12-08 2020-12-08 Information processing method, information processing apparatus, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
CN112527817A true CN112527817A (en) 2021-03-19

Family

ID=75000342

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011444379.7A Pending CN112527817A (en) 2020-12-08 2020-12-08 Information processing method, information processing apparatus, storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN112527817A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076343A (en) * 2021-04-30 2021-07-06 北京京东振世信息技术有限公司 Data query method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090144696A1 (en) * 2007-11-29 2009-06-04 Max Rydahl Andersen Code completion for object relational mapping query language (oql) queries
CN102591964A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Implementation method and device for data reading-writing splitting system
CN107665210A (en) * 2016-07-28 2018-02-06 南京中兴新软件有限责任公司 Data processing method and device
CN111339131A (en) * 2020-02-26 2020-06-26 深圳壹账通智能科技有限公司 Data reading and writing method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090144696A1 (en) * 2007-11-29 2009-06-04 Max Rydahl Andersen Code completion for object relational mapping query language (oql) queries
CN102591964A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Implementation method and device for data reading-writing splitting system
CN107665210A (en) * 2016-07-28 2018-02-06 南京中兴新软件有限责任公司 Data processing method and device
CN111339131A (en) * 2020-02-26 2020-06-26 深圳壹账通智能科技有限公司 Data reading and writing method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076343A (en) * 2021-04-30 2021-07-06 北京京东振世信息技术有限公司 Data query method, device, equipment and storage medium
CN113076343B (en) * 2021-04-30 2024-04-05 北京京东振世信息技术有限公司 Data query method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109144994B (en) Index updating method, system and related device
CN110990420B (en) Data query method and device
US10565200B2 (en) Conversion of model views into relational models
US20170344605A1 (en) Optimizing write operations in object schema-based application programming interfaces (apis)
CN111581234B (en) RAC multi-node database query method, device and system
CN110908997A (en) Data blood margin construction method and device, server and readable storage medium
CN109614413B (en) Memory flow type computing platform system
AU2017269108A1 (en) Optimizing read and write operations in object schema-based application programming interfaces (APIS)
CN108073696B (en) GIS application method based on distributed memory database
CN109902126B (en) Loading system supporting HIVE automatic partition and implementation method thereof
CN108509453B (en) Information processing method and device
CN109885585A (en) Support the distributed data base system and method for storing process, trigger and view
CN103034650A (en) System and method for processing data
US10997170B2 (en) Local database cache
CN114443615A (en) Database management system, related apparatus, method and medium
CN114443680A (en) Database management system, related apparatus, method and medium
CN112527817A (en) Information processing method, information processing apparatus, storage medium, and electronic device
KR20100132752A (en) Distributed data processing system
US20200257989A1 (en) Method and apparatus for managing knowledge base, device and medium
CN107506369A (en) A kind of data access method and equipment
KR20180077830A (en) Processing method for a relational query in distributed stream processing engine based on shared-nothing architecture, recording medium and device for performing the method
WO2023164294A1 (en) Query splitter for an inverted index datastore
CN107894942B (en) Method and device for monitoring data table access amount
WO2022077916A1 (en) Data processing system, data processing method based on blockchain, and device
CN109460416A (en) A kind of data processing method, device, electronic equipment and storage medium

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