CN115460201A - Database access method, device, equipment and medium - Google Patents

Database access method, device, equipment and medium Download PDF

Info

Publication number
CN115460201A
CN115460201A CN202211062499.XA CN202211062499A CN115460201A CN 115460201 A CN115460201 A CN 115460201A CN 202211062499 A CN202211062499 A CN 202211062499A CN 115460201 A CN115460201 A CN 115460201A
Authority
CN
China
Prior art keywords
database
routing middleware
middleware
access
access request
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
CN202211062499.XA
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211062499.XA priority Critical patent/CN115460201A/en
Publication of CN115460201A publication Critical patent/CN115460201A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a database access method, a database access device, a database access equipment and a database access medium. The method comprises the following steps: responding to an access operation on the database, and generating an access request; and sending an access request to target routing middleware deployed in the node cluster of the database so that the target routing middleware selects a target node from the node cluster to process the access request. By adopting the technical scheme, the target routing middleware is migrated to the node cluster of the database from the terminal side bearing the database access application, so that the communication link between the target routing middleware and the database is shortened, and the access efficiency of the database is improved.

Description

Database access method, device, equipment and medium
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a database access method, a database access device, a database access equipment and a database access medium.
Background
The MySQL (My Structured Query Language) database is one of the most popular databases at present. When using the MySQL database, the application program obtains the data in the database node through the routing middleware.
Currently, the routing middleware is usually configured on one side of an application, and different applications correspond to different routing middleware. When the application program accesses the database, the application program sends the access request to the corresponding routing middleware, and the routing middleware forwards the received access request to the database node for processing, so that the access efficiency of the database is low.
Disclosure of Invention
The application provides a database access method, a database access device, a database access equipment and a database access medium, so as to improve the database access efficiency.
In a first aspect, an embodiment of the present application provides a database access method, which is applied to a terminal device, and includes:
responding to an access operation on the database, and generating an access request;
and sending an access request to target routing middleware deployed in the node cluster of the database so that the target routing middleware selects a target node from the node cluster to process the access request.
In a second aspect, an embodiment of the present application further provides a database access method, which is applied to a request distribution device, and includes:
receiving an access request to a database sent by terminal equipment;
selecting a target routing middleware from all routing middleware deployed in a node cluster of a database;
and sending an access request to the target routing middleware so that the target routing middleware selects a target node from the node cluster of the database to process the access request.
In a third aspect, an embodiment of the present application further provides a database access apparatus, which is applied to a terminal device, and includes:
the access request generation module is used for responding to the access operation on the database and generating an access request;
and the access request sending module is used for sending an access request to the target routing middleware deployed in the node cluster of the database so that the target routing middleware selects a target node from the node cluster to process the access request.
In a fourth aspect, an embodiment of the present application further provides a database access apparatus, which is applied to a request distribution device, and includes:
the access request receiving module is used for receiving an access request to the database sent by the terminal equipment;
the target routing middleware selecting module is used for selecting target routing middleware from all routing middleware deployed in the node cluster of the database;
and the access request sending module is used for sending an access request to the target routing middleware so that the target routing middleware selects a target node from the node cluster of the database to process the access request.
In a fifth aspect, an embodiment of the present application further provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
when executed by one or more processors, the one or more programs cause the one or more processors to implement a database access method as provided in an embodiment of the first aspect and/or the second aspect.
In a sixth aspect, this application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a database access method as provided in the first and/or second aspect.
The embodiment of the application generates an access request by responding to the access operation on the database; and sending an access request to target routing middleware deployed in the node cluster of the database so that the target routing middleware selects a target node from the node cluster to process the access request. By adopting the technical scheme, the target routing middleware is migrated to the node cluster of the database from the terminal side bearing the database access application, so that the communication link between the target routing middleware and the database is shortened, and the access efficiency of the database is improved.
Drawings
FIG. 1 is a flowchart of a database access method according to a first embodiment of the present application;
FIG. 2 is a flowchart of a database access method according to a second embodiment of the present application;
fig. 3 is a flowchart of a database access method in the third embodiment of the present application;
fig. 4A is a flowchart of a database access method according to a fourth embodiment of the present application;
FIG. 4B is a diagram illustrating a database access according to a fifth embodiment of the present application;
fig. 5 is a block diagram of a database access device in the fifth embodiment of the present application;
fig. 6 is a block diagram of a database access device according to a sixth embodiment of the present application;
fig. 7 is a block diagram of an electronic device in a seventh embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a database access method in a first embodiment of the present application, where the present application is applicable to a case of accessing data in a database, and the method may be executed by a database access apparatus, where the apparatus is implemented by software and/or hardware, and is specifically configured in an electronic device. Specifically, the electronic device may be a terminal device.
The database access method shown in fig. 1, executed by a terminal device, includes:
s101, responding to the access operation on the database, and generating an access request.
The database may be a data warehouse formed by at least one database node and communicatively connected to the terminal device. The database nodes are nodes used for storing data and responding to access requests in the node cluster corresponding to the database. It should be noted that the database may be any database in the prior art, and the present application is not limited to this. For example, the DataBase may be a MySQL DataBase or an infilxdbb (Influx DataBase) DataBase, or the like.
Wherein the access request may be used to indicate that the corresponding data is accessed in the database. And generating an access request corresponding to the access operation in response to each database access operation.
Optionally, the access request may include an access field for locating data to be accessed in the database. Wherein, the number of the access field is at least one, and the type of the access field can comprise at least one. The number of access fields and/or the specific number of field types are not limited in this application. Optionally, the field type may correspond to each attribute of the data.
For example, if the data stored in the database is the examination score of a student, the field type may include at least one of the number of the student, the name of the student, the class and the subject of the examination.
S102, sending an access request to a target routing middleware deployed in a node cluster of the database, so that the target routing middleware selects a target node from the node cluster to process the access request.
The database node cluster may be a cluster formed by database nodes, where the number of the database nodes is at least one, and usually is multiple. The data stored in each database node in a single database cluster is the same.
The routing middleware may be software that transfers data between the end devices and the database nodes. The destination routing middleware may be understood as a routing middleware that receives and distributes a corresponding access request to a destination node. The target node may be a database node that processes the access request.
Optionally, the target node may be determined according to a corresponding node selection algorithm, which is not limited in the present application, for example, the node selection algorithm may be a load balancing algorithm or a random algorithm.
In an optional embodiment, the target routing middleware may determine, according to a load balancing algorithm, a database node with a smaller load among the database nodes, and after establishing a connection with the database node, send the access request to the corresponding database node.
In another alternative embodiment, the target routing middleware may determine a database node according to a random algorithm, and after establishing a connection with the database node, send an access request to the corresponding database node.
Optionally, the access request is sent to the request distribution device, so that the request distribution device selects a target routing middleware from the routing middleware deployed in the node cluster of the database, and sends the access request to the target routing middleware.
The request distribution device may be a device communicatively connected to the terminal device and the routing middleware, and includes identification information of each routing middleware, so as to select a target routing middleware for forwarding the access request from each routing middleware. The selection of the target routing middleware can be determined according to the load condition of each routing middleware.
According to the technical scheme, the target routing middleware with lower load can be selected from the routing middleware, so that the efficiency of processing the access request by the target routing middleware is improved, and the efficiency of accessing the database data is improved.
The embodiment of the application generates an access request by responding to the access operation on the database; and sending an access request to target routing middleware deployed in the node cluster of the database so that the target routing middleware selects a target node from the node cluster to process the access request. By adopting the technical scheme, the target routing middleware is migrated to the node cluster of the database from the terminal side bearing the database access application, so that the communication link between the target routing middleware and the database is shortened, and the access efficiency of the database is improved.
Example two
Fig. 2 is a flowchart of a database access method in a second embodiment of the present application, where this embodiment is applicable to a case of accessing a database, and the method may be executed by a database access apparatus, where the apparatus is implemented by software and/or hardware and is specifically configured in a request distribution device.
In the embodiments of the present application, detailed descriptions thereof are omitted, and reference may be made to the description of the foregoing embodiments.
The database access method shown in fig. 2, executed by a request distribution device, includes:
s201, receiving an access request to the database sent by the terminal equipment.
The database may be a data warehouse formed by at least one database node and connected with the terminal device in a communication mode. The database nodes are nodes used for storing data and responding to access requests in the node cluster corresponding to the database. It should be noted that the database may be any database in the prior art, and the present application is not limited to this. For example, the database may be a MySQL database or an InfluxDB database, or the like.
Wherein the access request may be used to indicate that the corresponding data is accessed in the database. And generating an access request corresponding to the access operation in response to each database access operation.
Optionally, the access request may include an access field for locating the data to be accessed in the database. Wherein, the number of the access field is at least one, and the type of the access field can include at least one. The number of access fields and/or the specific number of field types are not limited in this application. Optionally, the field type may correspond to each attribute of the data.
For example, if the data stored in the database is the examination score of a student, the field type may include at least one of the number of the student, the name of the student, the class and the subject of the examination.
S202, selecting target routing middleware from all routing middleware deployed in the node cluster of the database.
The database node cluster may be a cluster formed by database nodes, where the number of the database nodes is at least one, and usually is multiple. The data stored in each database node in a single database cluster is the same.
The routing middleware may be a software that mediates data transfer between the terminal device and the database node. The target routing middleware may be understood as routing middleware that receives and distributes a corresponding access request to a target node. The target node may be a database node that processes the access request.
The target routing middleware can be determined according to the load condition of each routing middleware.
S203, sending an access request to the target routing middleware to enable the target routing middleware to select a target node from the node cluster of the database to process the access request.
Optionally, the target node may be determined according to a corresponding node selection algorithm, which is not limited in the present application, for example, the node selection algorithm may be a load balancing algorithm or a random algorithm.
In an optional embodiment, the target routing middleware may determine, according to a load balancing algorithm, a database node with a smaller load among the database nodes, and send the access request to the corresponding database node after establishing connection with the database node.
In another alternative embodiment, the target routing middleware may determine a database node according to a random algorithm, and after establishing a connection with the database node, send the access request to the corresponding database node.
The method comprises the steps that an access request for a database sent by a terminal device is received; selecting a target routing middleware from all routing middleware deployed in a node cluster of a database; and sending an access request to the target routing middleware so that the target routing middleware selects a target node from the node cluster of the database to process the access request. By adopting the technical scheme, the target routing middleware is migrated to the node cluster of the database from the terminal side bearing the database access application, so that the communication link between the target routing middleware and the database is shortened, and the efficiency of accessing the database is improved.
EXAMPLE III
Fig. 3 is a flowchart of a database access method in a third embodiment of the present application, and this embodiment optimizes and improves the selection operation of the target routing middleware on the basis of the foregoing embodiments.
In the embodiments of the present application, detailed descriptions thereof are omitted, and reference may be made to the description of the foregoing embodiments.
Further, the step of selecting the target routing middleware from the routing middleware deployed in the node cluster of the database is refined into the step of selecting the available routing middleware from the routing middleware deployed in the node cluster of the database; and selecting target routing middleware from the available routing middleware to complete the selection mechanism of the target routing middleware.
The database access method shown in fig. 3 includes:
s301, receiving an access request for the database sent by the terminal equipment.
S302, selecting available routing middleware from the routing middleware deployed in the node cluster of the database.
The available routing middleware can be understood as routing middleware which can respond to an external access request and forward the access request. Some routing middleware may have a condition that an access request cannot be responded due to excessive load or failure, and the like, and if an access request is still sent to the routing middleware, the access time of the terminal device is too long or the database data cannot be accessed, so that the database access efficiency is affected. Thus, a probe request may be sent to each routing middleware deployed in a cluster of nodes in the database. The alive probing request is used for requesting the routing middleware to feed back information of whether the routing middleware is alive or not to the request distribution equipment so as to verify whether each routing middleware has the capability of responding to the request or not.
For example, if the request distribution device receives feedback information of a routing middleware, the routing middleware is considered to be capable of responding to the activation request and has the capability of responding to the request. At this time, the request distribution device may treat the routing middleware as available routing middleware.
For example, if the request distribution device does not receive the feedback information of a certain routing middleware, the routing middleware is considered to be unavailable, and at this time, the routing middleware is taken as the abnormal routing middleware. The abnormal routing middleware can be marked, and an abnormal prompt is generated based on the abnormal routing middleware and used for indicating related technical personnel to troubleshoot faults in time and overcome the abnormality.
Optionally, the activity detection request may be sent to each routing middleware once at a certain interval, so as to determine whether the routing middleware can respond to the activity detection request in real time, and avoid that the available routing middleware cannot continue to respond to the access request in a subsequent process. The interval time may be set by a corresponding technician according to experience or actual requirements, which is not limited in this application.
By adopting the method, the activity detection request is sent to each routing middleware, the routing middleware which can not carry out data transmission can be eliminated, the available routing middleware can be determined, and the efficiency of selecting the target routing middleware is improved.
S303, selecting target routing middleware from the available routing middleware.
In an alternative embodiment, if there is one available routing middleware, the available routing middleware is taken as the target routing middleware.
In another alternative embodiment, if the number of the available routing middleware is at least two, the distribution priority of the corresponding available routing middleware can be determined according to the request distribution condition of each available routing middleware. And selecting the target routing middleware from the available routing middleware according to the distribution priority.
Alternatively, the request distribution condition may be determined according to the request load amount of the corresponding available routing middleware. The amount of request load may be the number of requests that can be handled by the routing middleware. The distribution priority may be used to characterize the level at which each routing middleware processes the corresponding access request.
For example, the request distribution condition may be determined according to the current request load amount of the corresponding available routing middleware. Determining the current request load capacity of each available routing middleware, determining the distribution priority of the available routing middleware with lower current load capacity as high priority, and taking the high-priority available routing middleware as target routing middleware.
For example, the request distribution condition may be determined according to the historical request load of the corresponding available routing middleware. Determining the historical request load capacity of each available routing middleware, determining the distribution priority of the available routing middleware with lower historical load capacity as high priority, and taking the available routing middleware with high priority as target routing middleware.
By adopting the method, the target routing middleware with lower request load can be selected from the available routing middleware, the waiting processing time of the access request in the routing middleware is shortened, and the efficiency of accessing the database is further improved.
S304, sending an access request to the target routing middleware to enable the target routing middleware to select a target node from the node cluster of the database to process the access request.
According to the method and the device, the available routing middleware is selected from the routing middleware deployed in the node cluster of the database, and the target routing middleware is selected from the available routing middleware, so that the selected target routing middleware has access request response capability, the access request can be processed as soon as possible, and the efficiency of accessing the database is improved.
Example four
Fig. 4A is a flowchart of a database access method provided in the fourth embodiment of the present application, and the embodiment of the present application provides a preferred implementation manner in terms of technical solutions in the foregoing implementations.
The embodiment of the present application will describe a database access method in detail with reference to a database access system framework diagram shown in fig. 4B.
A database access method as shown in fig. 4A, comprising:
s401, the terminal equipment responds to the access operation on the database and generates an access request.
Referring to fig. 4B, an installation device of APP (Application program) is a terminal device.
S402, the terminal device sends an access request to the request distribution device.
And S403, requesting the distribution equipment to generate the activity detection request in real time or at regular time.
Referring to fig. 4B, an intelligent DNS (Domain Name System) is a request distribution device in the present application.
S404, the request distribution equipment sends a alive detection request to each routing middleware in the node cluster of the database.
Referring to FIG. 4B, wherein MySQL MGR (My Structured Query language group replication) cluster is a database node cluster, DB
The (DataBase) node is a node in the DataBase cluster for responding to the access request, and the router is the routing middleware.
S405, responding to the activity detection request by the available routing middleware in the database, and generating feedback information.
S406, the available routing middleware sends the feedback information to the request distribution equipment.
S407, the request distribution device selects the routing middleware from the available routing middleware.
S408, the request distribution equipment sends the access request to the target routing middleware.
S409, the target routing middleware in the database selects a target node from the node cluster of the database and processes the access request.
According to the technical scheme, the routing middleware without response is eliminated, the target routing middleware is selected from the available routing middleware, the waiting processing time of the access request in the routing middleware is shortened, and the efficiency of selecting the target routing middleware is improved; the communication link between the target routing middleware and the database is shortened, and the efficiency of accessing the database is improved.
EXAMPLE five
Fig. 5 is a structural diagram of a database access device in a fifth embodiment of the present application, where this embodiment is applicable to a case of accessing a database, and the device is implemented by software and/or hardware and is specifically configured in an electronic device. Specifically, the electronic device may be a terminal device.
A database access apparatus as shown in fig. 5, comprising: an access request creation module 501 and an access request sending module 502. Wherein the content of the first and second substances,
an access request generating module 501, configured to generate an access request in response to an access operation on a database;
an access request sending module 502, configured to send an access request to a target routing middleware deployed in a node cluster of a database, so that the target routing middleware selects a target node from the node cluster to process the access request.
The embodiment of the application responds to the access operation on the database through the access request generating module to generate the access request; and sending an access request to a target routing middleware deployed in a node cluster of the database through an access request sending module so that the target routing middleware selects a target node from the node cluster to process the access request. By adopting the technical scheme, the target routing middleware is migrated to the node cluster of the database from the terminal side bearing the database access application, so that the communication link between the target routing middleware and the database is shortened, and the efficiency of accessing the database is improved.
In an optional embodiment, the access request sending module 501 includes:
and the access request sending unit is used for sending an access request to the request distribution equipment so that the request distribution equipment selects a target routing middleware from the routing middleware deployed in the node cluster of the database and sends the access request to the target routing middleware.
The database access device can execute the database access method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of executing each database access method.
Example six
Fig. 6 is a structural diagram of a database access device according to a sixth embodiment of the present application. The embodiment is suitable for the case of accessing the database, and the apparatus is implemented by software and/or hardware and is specifically configured in the request distribution device.
A database access apparatus as shown in fig. 6, comprising: an access request receiving module 601, a target routing middleware selecting module 602 and an access request sending module 603. Wherein the content of the first and second substances,
an access request receiving module 601, configured to receive an access request for a database sent by a terminal device;
a target routing middleware selecting module 602, configured to select a target routing middleware from the routing middleware deployed in the node cluster of the database;
an access request sending module 603, configured to send an access request to the target routing middleware, so that the target routing middleware selects a target node from a node cluster of the database to process the access request.
The method comprises the steps that an access request receiving module receives an access request for a database, which is sent by a terminal device; and selecting the target routing middleware from the routing middleware deployed in the node cluster of the database through a target routing middleware selection module. And sending an access request to the target routing middleware through an access request sending module so that the target routing middleware selects a target node from the node cluster of the database to process the access request. By adopting the technical scheme, the target routing middleware is migrated to the node cluster of the database from the terminal side bearing the database access application, so that the communication link between the target routing middleware and the database can be shortened, and the database access efficiency is improved.
In an alternative embodiment, the target routing middleware selecting module 603 includes:
the available routing middleware selecting unit is used for selecting the available routing middleware from all routing middleware deployed in the node cluster of the database;
and the target routing middleware selecting unit is used for selecting the target routing middleware from the available routing middleware.
In an alternative embodiment, the available routing middleware selects the unit, including:
the activity detection request sending subunit is used for sending activity detection requests to each routing middleware deployed in the node cluster of the database;
and the available routing middleware determining subunit is used for taking the routing middleware which receives the feedback information of the activation probing request as the available routing middleware.
In an alternative embodiment, if the number of available routing middleware is at least two, the target routing middleware selecting unit includes:
a distribution priority determining subunit, configured to determine, according to a request distribution condition of each available routing middleware, a distribution priority of a corresponding available routing middleware;
and the target routing middleware selecting subunit is used for selecting the target routing middleware from all the available routing middleware according to the distribution priority.
The database access device can execute the database access method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of executing each database access method.
EXAMPLE seven
Fig. 7 is a block diagram of an electronic device in a fifth embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 comprises a computing unit 701, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 701 performs the methods and processes described above, such as database access methods. For example, in some embodiments, the database access method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM702 and/or communications unit 709. When the computer program is loaded into RAM703 and executed by the computing unit 701, one or more steps of the database access methods described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the database access method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is 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 of a machine-readable storage medium would include an electrical connection based on 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome. The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in this disclosure may be performed in parallel or sequentially or in a different order, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and are not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (10)

1. A database access method is applied to terminal equipment and comprises the following steps:
responding to an access operation on the database, and generating an access request;
and sending the access request to target routing middleware deployed in the node cluster of the database, so that the target routing middleware selects a target node from the node cluster to process the access request.
2. The method of claim 1, wherein sending the access request to a target routing middleware deployed in a cluster of nodes in the database comprises:
and sending the access request to a request distribution device, so that the request distribution device selects a target routing middleware from various routing middleware deployed in the node cluster of the database, and sends the access request to the target routing middleware.
3. A database access method applied to a request distribution device includes:
receiving an access request to a database sent by terminal equipment;
selecting a target routing middleware from all routing middleware deployed in the node cluster of the database;
and sending the access request to the target routing middleware so that the target routing middleware selects a target node from the node cluster of the database to process the access request.
4. The method of claim 3, wherein the selecting the target routing middleware from the routing middleware deployed in the node cluster of the database comprises:
selecting available routing middleware from the routing middleware deployed in the node cluster of the database;
selecting the target routing middleware from the available routing middleware.
5. The method of claim 4, wherein the selecting available routing middleware from routing middleware deployed in a node cluster of the database comprises:
sending a liveness detection request to each routing middleware deployed in the node cluster of the database;
and taking the routing middleware which receives the feedback information of the activity probing request as the available routing middleware.
6. The method according to claim 4, wherein if the number of the available routing middleware is at least two, the selecting the target routing middleware from the available routing middleware comprises:
determining the distribution priority of the corresponding available routing middleware according to the request distribution condition of each available routing middleware;
and selecting the target routing middleware from all the available routing middleware according to the distribution priority.
7. A database access device applied to a terminal device includes:
the access request generation module is used for responding to the access operation on the database and generating an access request;
and the access request sending module is used for sending the access request to a target routing middleware deployed in the node cluster of the database so that the target routing middleware selects a target node from the node cluster to process the access request.
8. A database access apparatus applied to a request distribution device, comprising:
the access request receiving module is used for receiving an access request to the database sent by the terminal equipment;
the target routing middleware selecting module is used for selecting target routing middleware from all routing middleware deployed in the node cluster of the database;
and the access request sending module is used for sending the access request to the target routing middleware so that the target routing middleware selects a target node from the node cluster of the database to process the access request.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the database access method of any of claims 1-2, and/or implement the database access method of any of claims 3-7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out a database access method according to any one of claims 1-2 and/or carries out a database access method according to any one of claims 3-7.
CN202211062499.XA 2022-09-01 2022-09-01 Database access method, device, equipment and medium Pending CN115460201A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211062499.XA CN115460201A (en) 2022-09-01 2022-09-01 Database access method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211062499.XA CN115460201A (en) 2022-09-01 2022-09-01 Database access method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115460201A true CN115460201A (en) 2022-12-09

Family

ID=84299868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211062499.XA Pending CN115460201A (en) 2022-09-01 2022-09-01 Database access method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115460201A (en)

Similar Documents

Publication Publication Date Title
US11429449B2 (en) Method for fast scheduling for balanced resource allocation in distributed and collaborative container platform environment
CN107729559B (en) Method, system, equipment and storage medium for database read-write asynchronous access
CN103607424B (en) Server connection method and server system
CN112866391A (en) Message pushing method and device, electronic equipment and storage medium
CN113220420A (en) Service monitoring method, device, equipment, storage medium and computer program product
CN112615795A (en) Flow control method and device, electronic equipment, storage medium and product
CN113986135B (en) Method, device, equipment and storage medium for processing request
US20220407771A1 (en) Method and apparatus for updating instance configuration, device, storage medium, and program product
CN114579311B (en) Method, device, equipment and storage medium for executing distributed computing task
CN115460201A (en) Database access method, device, equipment and medium
CN115484233A (en) Method, device, equipment and medium for forwarding link aggregation message in digital communication chip
CN114612212A (en) Business processing method, device and system based on risk control
CN113641688A (en) Node updating method, related device and computer program product
CN113595870B (en) Push message processing method and device, electronic equipment and storage medium
CN115277652B (en) Streaming media processing method and device based on reasoning service and electronic equipment
CN116306407B (en) Verification method, device, equipment and storage medium of Network On Chip (NOC)
CN115334040B (en) Method and device for determining Internet Protocol (IP) address of domain name
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN112989250A (en) Web service response method and device and electronic equipment
CN117081939A (en) Traffic data processing method, device, equipment and storage medium
CN113934581A (en) Method and device for acquiring disk fault information of storage system, electronic equipment and medium
CN117675822A (en) Load balancing method, device, equipment and medium of storage cluster
CN116915868A (en) Network monitoring task issuing method, device, equipment and storage medium
CN115587119A (en) Database query method and device, electronic equipment and storage medium
CN116382852A (en) Micro-service deployment method and device, electronic equipment and 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