CN114706837A - Database access method and device - Google Patents
Database access method and device Download PDFInfo
- Publication number
- CN114706837A CN114706837A CN202210333713.4A CN202210333713A CN114706837A CN 114706837 A CN114706837 A CN 114706837A CN 202210333713 A CN202210333713 A CN 202210333713A CN 114706837 A CN114706837 A CN 114706837A
- Authority
- CN
- China
- Prior art keywords
- target
- database object
- node
- access
- target database
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/217—Database tuning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机技术领域,尤其涉及一种数据库访问方法及装置。The present invention relates to the field of computer technology, and in particular, to a database access method and device.
背景技术Background technique
在使用Oracle RAC(real application clusters,实时应用集群)环境时,不同的客户端应用同时通过不同的RAC节点访问数据库中的同一数据库对象的情况常常发生,由此使得RAC节点之间进行大量私网间通讯,造成私网流量的升高。When using Oracle RAC (real application clusters, real-time application clusters) environment, it often happens that different client applications access the same database object in the database through different RAC nodes at the same time, which makes a large number of private networks between RAC nodes. inter-communication, resulting in an increase in private network traffic.
发明内容SUMMARY OF THE INVENTION
本发明提供一种数据库访问方法及装置,用以解决现有技术中不同应用节点同时通过RAC节点访问同一张数据库对象时会产生大量私网流量的缺陷,在一定程度上降低私网流量。The present invention provides a database access method and device, which are used to solve the defect in the prior art that a large amount of private network traffic will be generated when different application nodes simultaneously access the same database object through the RAC node, and reduce the private network traffic to a certain extent.
本发明提供一种数据库访问方法,包括:在目标应用节点需要对目标数据库对象进行访问的情况下,获取所述目标数据库对象关联的配置化参数;根据所述配置化参数,确定所述目标应用节点对应连接的RAC节点和访问参数;通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作。The present invention provides a database access method, comprising: when a target application node needs to access a target database object, acquiring a configuration parameter associated with the target database object; and determining the target application according to the configuration parameter A node corresponds to a connected RAC node and an access parameter; the target database object is accessed through the RAC node and according to the access parameter, and a target operation is performed on the data corresponding to the target database object.
根据本发明提供的一种数据库访问方法,所述配置化参数包括:所述目标数据库对象对应的应用节点的个数,所述目标数据库对象连接的RAC节点的个数,以及所述目标数据库对象对应的节点配置规则;其中,所述节点配置规则用于反映应用节点访问所述目标数据库对象时与RAC节点之间的连接配置关系。According to a database access method provided by the present invention, the configuration parameters include: the number of application nodes corresponding to the target database object, the number of RAC nodes connected to the target database object, and the target database object Corresponding node configuration rules; wherein, the node configuration rules are used to reflect the connection configuration relationship between the application node and the RAC node when accessing the target database object.
根据本发明提供的一种数据库访问方法,所述根据所述配置化参数,确定所述目标应用节点对应连接的RAC节点和访问参数,包括:根据所述目标数据库对象对应的应用节点的个数,所述目标数据库对象连接的RAC节点的个数,以及所述节点配置规则,确定所述目标应用节点对应连接的RAC节点;基于所述目标数据库对象对应的应用节点的个数以及所述目标数据库对象是否可被分区,确定所述目标应用节点对应的访问参数。According to a database access method provided by the present invention, the determining the RAC node and the access parameter corresponding to the target application node connection according to the configuration parameter includes: according to the number of application nodes corresponding to the target database object , the number of RAC nodes connected to the target database object, and the node configuration rules, determine the RAC nodes connected to the target application node; based on the number of application nodes corresponding to the target database object and the target Whether the database object can be partitioned determines the access parameter corresponding to the target application node.
根据本发明提供的一种数据库访问方法,所述基于所述目标数据库对象对应的应用节点的个数以及所述目标数据库对象是否可被分区,确定所述目标应用节点对应的访问参数,包括:在所述目标数据库对象可被分区的情况下,从至少一个数据区域中确定所述目标应用节点对应的可访问的数据区域,得到所述目标应用节点对应的访问参数;其中,所述至少一个数据区域是基于所述目标数据库对象对应的应用节点的个数,对所述目标数据库对象执行分区处理操作得到的。According to a database access method provided by the present invention, determining the access parameter corresponding to the target application node based on the number of application nodes corresponding to the target database object and whether the target database object can be partitioned, including: In the case that the target database object can be partitioned, the accessible data area corresponding to the target application node is determined from at least one data area, and the access parameter corresponding to the target application node is obtained; wherein, the at least one data area corresponding to the target application node is obtained. The data area is obtained by performing a partition processing operation on the target database object based on the number of application nodes corresponding to the target database object.
根据本发明提供的一种数据库访问方法,所述基于所述目标数据库对象对应的应用节点的个数以及所述目标数据库对象是否可被分区,确定所述目标应用节点对应的访问参数,包括:在所述目标数据库对象不可被分区的情况下,从至少两个数据库对象中确定所述目标应用节点对应的可访问的数据库对象,得到所述目标应用节点对应的访问参数;其中,所述至少两个数据库对象是基于所述目标数据库对象对应的应用节点的个数,对所述目标数据库对象执行复制处理操作得到的。According to a database access method provided by the present invention, determining the access parameter corresponding to the target application node based on the number of application nodes corresponding to the target database object and whether the target database object can be partitioned, including: In the case that the target database object cannot be partitioned, the accessible database objects corresponding to the target application node are determined from at least two database objects, and the access parameters corresponding to the target application node are obtained; wherein the at least The two database objects are obtained by performing a copy processing operation on the target database object based on the number of application nodes corresponding to the target database object.
根据本发明提供的一种数据库访问方法,所述通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作,包括:通过所述RAC节点,访问所述目标数据库对象中所述目标应用节点对应的可访问的数据区域,对所述数据区域中的数据执行目标操作。According to a database access method provided by the present invention, the accessing the target database object through the RAC node and according to the access parameter, and performing a target operation on the data corresponding to the target database object includes: accessing the target database object through the RAC node, accessing the accessible data area corresponding to the target application node in the target database object, and performing the target operation on the data in the data area.
根据本发明提供的一种数据库访问方法,所述通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作,包括:通过所述RAC节点,访问所述目标应用节点对应的可访问的数据库对象,对所述可访问的数据库对象的数据执行目标操作。According to a database access method provided by the present invention, the accessing the target database object through the RAC node and according to the access parameter, and performing a target operation on the data corresponding to the target database object includes: accessing the target database object through the RAC The node accesses the accessible database object corresponding to the target application node, and executes the target operation on the data of the accessible database object.
根据本发明提供的一种数据库访问方法,所述通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作之前,还包括:将所述目标数据库对象对应的数据库的与负载均衡相关的参数置为不生效状态。According to a database access method provided by the present invention, before performing the target operation on the data corresponding to the target database object by accessing the target database object through the RAC node and according to the access parameter, the method further includes: The parameters related to load balancing of the database corresponding to the target database object are set to ineffective state.
本发明还提供一种数据库访问装置,包括:The present invention also provides a database access device, comprising:
参数获取模块,用于在目标应用节点需要对目标数据库对象进行访问的情况下,获取所述目标数据库对象关联的配置化参数;a parameter obtaining module, configured to obtain the configuration parameters associated with the target database object when the target application node needs to access the target database object;
节点确定模块,用于根据所述配置化参数,确定所述目标应用节点对应连接的RAC节点和访问参数;a node determination module, configured to determine, according to the configuration parameters, the RAC node and access parameters corresponding to the connection of the target application node;
操作模块,用于通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作。An operation module, configured to access the target database object through the RAC node and according to the access parameter, and perform a target operation on the data corresponding to the target database object.
本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述数据库访问方法。The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implements any one of the database access methods described above when the processor executes the program .
本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述数据库访问方法。The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements any one of the above-mentioned database access methods.
本发明提供的数据库访问方法及装置,通过获取目标数据库对象关联的配置化参数,确定目标应用节点对应连接的RAC节点和访问参数,进而通过对应的RAC节点并根据访问参数访问目标数据库对象,并对其中的数据执行目标操作,使得每个应用节点通过固定的RAC节点访问目标数据库对象,由于访问参数的确定,不同应用节点同时访问目标数据库对象时,RAC节点之间不会进行大量私网间通讯,在保证高可用、负载均衡的基础上最大程度的降低私网流量,从而极大提高了数据库负荷上限,减轻了数据库整体压力。The database access method and device provided by the present invention determine the RAC node and access parameters connected to the target application node by acquiring the configuration parameters associated with the target database object, and then access the target database object through the corresponding RAC node and according to the access parameters, and Perform the target operation on the data in it, so that each application node accesses the target database object through a fixed RAC node. Due to the determination of the access parameters, when different application nodes access the target database object at the same time, there will not be a large number of private networks between the RAC nodes. Communication, on the basis of ensuring high availability and load balancing, reduces private network traffic to the greatest extent, thereby greatly increasing the upper limit of database load and reducing the overall pressure on the database.
附图说明Description of drawings
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are the For some embodiments of the invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是本发明提供的数据库访问方法的流程示意图;1 is a schematic flowchart of a database access method provided by the present invention;
图2是本发明提供的目标应用节点访问目标数据库对象的流程示意图;2 is a schematic flowchart of the target application node accessing target database objects provided by the present invention;
图3是本发明提供的数据库访问装置的结构示意图;3 is a schematic structural diagram of a database access device provided by the present invention;
图4是本发明提供的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的节点,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的节点通常为一类,并不限定节点的个数,例如第一节点可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接节点的至少其中之一,字符“/”,一般表示前后关联节点是一种“或”的关系。The terms "first", "second" and the like in the description and claims of the present invention are used to distinguish similar nodes, and are not used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that embodiments of the invention can be practiced in sequences other than those illustrated or described herein, and distinguish between "first", "second", etc. The nodes are usually of one type, and the number of nodes is not limited. For example, the first node may be one or more than one. In addition, "and/or" in the description and claims indicates at least one of the connected nodes, and the character "/" generally indicates that the associated nodes are in an "or" relationship.
应理解,说明书中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。It is to be understood that reference in the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
不同的客户端应用同时通过不同的RAC节点访问数据库中的同一数据块时会产生大量的私网流量,通常解决该问题的方法有两种:一种是通过不同的模式对数据库对象进行拆分,但是这种方法会导致数据库中一些公共类的汇总数据无法更好地进行统一使用;另一种方式是拆分数据库,但是这种方法要求应用添加分库分表路由中间件,会提高开发成本。为了解决上述问题,本申请提供了一种数据库访问方法。When different client applications access the same data block in the database through different RAC nodes at the same time, a large amount of private network traffic will be generated. Usually, there are two ways to solve this problem: one is to split the database objects through different modes. , but this method will result in that the summary data of some public classes in the database cannot be used in a better unified manner; another method is to split the database, but this method requires the application to add routing middleware for sub-database and sub-table, which will improve development cost. In order to solve the above problems, the present application provides a database access method.
下面结合图1-图2描述本发明的数据库访问方法。The database access method of the present invention will be described below with reference to FIGS. 1-2 .
图1是本发明提供的数据库访问方法的流程示意图。如图1所示,所述方法包括:FIG. 1 is a schematic flowchart of a database access method provided by the present invention. As shown in Figure 1, the method includes:
步骤101,在目标应用节点需要对目标数据库对象进行访问的情况下,获取所述目标数据库对象关联的配置化参数。
需要说明的是,应用节点可以理解为能够对目标数据库对象同时进行访问的客户端应用程序所在的设备。It should be noted that the application node can be understood as the device where the client application program that can simultaneously access the target database object is located.
需要说明的是,Oracle对数据的访问控制看起来是发生在行(Row)级别和对象(Object)级别,但是实际操作时的对象是数据块(Block),传递的对象也是数据块,在一个数据块中包含着多个数据,所以应用程序访问数据库实际上访问的是数据库内的一个数据块;当多个应用程序同时访问数据块时,实际只能有一个应用程序操作该数据块,其它应用程序需要进行等待。It should be noted that Oracle's data access control seems to occur at the row (Row) level and the object (Object) level, but the actual operation object is a data block (Block), and the passed object is also a data block. The data block contains multiple data, so the application program accessing the database actually accesses a data block in the database; when multiple applications access the data block at the same time, only one application program can actually operate the data block, and the other The application needs to wait.
需要理解的是,目标数据库对象可以理解为数据库中一张数据表内的某一个数据块,这个数据块会被不同的应用节点同时通过RAC节点进行访问。It should be understood that the target database object can be understood as a certain data block in a data table in the database, and this data block will be accessed by different application nodes through the RAC node at the same time.
可以理解,在目标应用节点需要对目标数据库对象进行访问的情况下,目标应用节点获取目标数据库对象关联的配置化参数。It can be understood that when the target application node needs to access the target database object, the target application node obtains the configuration parameters associated with the target database object.
可选地,所述配置化参数包括:Optionally, the configuration parameters include:
所述目标数据库对象对应的应用节点的个数,所述目标数据库对象连接的RAC节点的个数,以及所述目标数据库对象对应的节点配置规则;The number of application nodes corresponding to the target database object, the number of RAC nodes connected to the target database object, and the node configuration rules corresponding to the target database object;
其中,所述节点配置规则用于反映应用节点访问所述目标数据库对象时与RAC节点之间的连接配置关系。The node configuration rule is used to reflect the connection configuration relationship between the application node and the RAC node when accessing the target database object.
需要说明的是,目标数据库对象对应的应用节点的个数即同时访问目标数据库对象的不同应用节点的总数;It should be noted that the number of application nodes corresponding to the target database object is the total number of different application nodes accessing the target database object at the same time;
需要说明的是,RAC(real application clusters,实时应用集群)是Oracle新版数据库中采用的一项新技术,具有高可用性。对于RAC来说,Oracle是通过各个RAC节点之间的私网通讯进行内存融合(cache fushion)来保证各节点数据访问一致性的。It should be noted that RAC (real application clusters, real-time application clusters) is a new technology adopted in the new version of Oracle database, which has high availability. For RAC, Oracle uses the private network communication between each RAC node to perform memory fusion (cache fushion) to ensure the consistency of data access of each node.
例如,RAC节点1修改了一个数据块A但还没有提交或回滚此次操作,当RAC节点2此时需要访问数据块A时,查询到数据块A在RAC节点1处,那么RAC节点2就会向RAC节点1发送信息,让RAC节点1通过私网将修改后的数据块A传送给RAC节点2。当出现大量内存融合的情况时,私网流量就会升高,进而影响到数据库性能。For example, RAC node 1 has modified a data block A but has not committed or rolled back the operation. When RAC node 2 needs to access data block A at this time, it is queried that data block A is at RAC node 1, then RAC node 2 It will send information to RAC node 1, and let RAC node 1 transmit the modified data block A to RAC node 2 through the private network. When there is a large amount of memory fusion, the private network traffic will increase, which will affect the database performance.
需要理解的是,节点配置规则能够帮助目标应用节点确定对应连接的RAC节点,该节点配置规则是事先已经确定好的一套规则,在实际使用时可以自行确定。It should be understood that the node configuration rule can help the target application node to determine the corresponding connected RAC node. The node configuration rule is a set of rules that have been determined in advance, and can be determined by itself in actual use.
在节点配置规则不变的情况下,确定了目标应用节点对应连接的RAC节点后,每次目标应用节点访问目标数据库对象时,都会通过固定的RAC节点访问目标数据库对象。例如,当确定目标应用节点A连接RAC节点1后,每次应用节点A访问目标数据库时,都通过RAC节点1访问目标数据库。Under the condition that the node configuration rules remain unchanged, after the RAC node corresponding to the target application node is determined, each time the target application node accesses the target database object, the target database object will be accessed through the fixed RAC node. For example, after it is determined that the target application node A is connected to the RAC node 1, each time the application node A accesses the target database, the target database is accessed through the RAC node 1.
步骤102,根据所述配置化参数,确定所述目标应用节点对应连接的RAC节点和访问参数。Step 102: Determine, according to the configured parameters, a RAC node and access parameters to which the target application node is correspondingly connected.
需要说明的是,访问参数是应用节点访问目标数据库对象时需要携带的参数,根据该参数,可以帮助目标应用节点确定目标数据库对象中数据的位置。It should be noted that the access parameter is a parameter that the application node needs to carry when accessing the target database object, and according to the parameter, the target application node can determine the location of the data in the target database object.
可以理解,根据获取的配置化参数,目标应用节点确定对应连接的RAC节点以及访问目标数据库对象时需要携带的访问参数。It can be understood that, according to the obtained configuration parameters, the target application node determines the corresponding connected RAC node and the access parameters that need to be carried when accessing the target database object.
步骤103,通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作。Step 103: Access the target database object through the RAC node and according to the access parameter, and perform a target operation on the data corresponding to the target database object.
可以理解的是,对数据执行目标操作是对数据执行增加、删除、修改中的一种或多种操作。It can be understood that, performing the target operation on the data is performing one or more operations of adding, deleting, and modifying the data.
可以理解,目标应用节点通过已确定的RAC节点和访问参数访问目标数据库,并且对目标数据库对象对应的数据进行增加、删除和/或修改操作。It can be understood that the target application node accesses the target database through the determined RAC node and access parameters, and performs addition, deletion and/or modification operations on data corresponding to the target database object.
本发明提供的数据库访问方法,通过获取目标数据库对象关联的配置化参数,确定目标应用节点对应连接的RAC节点和访问参数,进而通过对应的RAC节点并根据访问参数访问目标数据库对象,并对其中的数据执行目标操作,使得每个应用节点通过固定的RAC节点访问目标数据库对象,由于访问参数的确定,不同应用节点同时访问目标数据库对象时,RAC节点之间不会进行大量私网间通讯,在保证高可用、负载均衡的基础上最大程度的降低私网流量,从而极大提高了数据库负荷上限,减轻了数据库整体压力。The database access method provided by the present invention determines the RAC node and access parameters connected to the target application node by acquiring the configuration parameters associated with the target database object, and then accesses the target database object through the corresponding RAC node and according to the access parameters, and compares the The data performs the target operation, so that each application node accesses the target database object through a fixed RAC node. Due to the determination of the access parameters, when different application nodes access the target database object at the same time, there will be no large amount of private network communication between the RAC nodes. On the basis of ensuring high availability and load balancing, the private network traffic is reduced to the greatest extent, thereby greatly increasing the upper limit of the database load and reducing the overall pressure on the database.
可选地,所述根据所述配置化参数,确定所述目标应用节点对应连接的RAC节点和访问参数,包括:Optionally, determining the RAC node and access parameters corresponding to the target application node connection according to the configuration parameter, including:
根据所述目标数据库对象对应的应用节点的个数,所述目标数据库对象连接的RAC节点的个数,以及所述节点配置规则,确定所述目标应用节点对应连接的RAC节点;According to the number of application nodes corresponding to the target database object, the number of RAC nodes connected to the target database object, and the node configuration rule, determine the RAC node to which the target application node is connected;
基于所述目标数据库对象对应的应用节点的个数以及所述目标数据库对象是否可被分区,确定所述目标应用节点对应的访问参数。Based on the number of application nodes corresponding to the target database object and whether the target database object can be partitioned, an access parameter corresponding to the target application node is determined.
可以理解的是,通过节点配置规则能够为每一个应用节点确定一个编码,该编码用于标识应用节点并帮助应用节点确定对应连接的RAC节点。例如,Oracle RAC共有两个节点,分别是RAC节点1和RAC节点2,目标数据库对象对应的应用节点有16个,对每个应用节点按照预设顺序(例如递增、递减)分配一个编号,节点配置规则可以是偶数编号的应用节点通过RAC节点1访问目标数据库,奇数编号的应用节点通过RAC节点2访问目标数据库;或者,节点配置规则可以是编号1~8的应用节点访问RAC节点1,编号8~16的应用节点访问RAC节点2。It can be understood that a code can be determined for each application node through the node configuration rule, where the code is used to identify the application node and help the application node to determine the corresponding connected RAC node. For example, Oracle RAC has two nodes, namely RAC node 1 and RAC node 2. There are 16 application nodes corresponding to the target database object. Each application node is assigned a number in a preset order (such as increasing, decreasing), and the node The configuration rule can be that even-numbered application nodes access the target database through RAC node 1, and odd-numbered application nodes access the target database through RAC node 2; or, the node configuration rule can be that application nodes numbered 1 to 8 access RAC node 1, and the number of Application nodes 8 to 16 access RAC node 2.
需要说明的是,上述举例的节点配置规则不构成对本发明节点配置规则的限定。节点配置规则可以根据实际需要自行确定,实现灵活配置,以适用于不同个数的应用节点。It should be noted that the node configuration rules in the above examples do not constitute limitations on the node configuration rules of the present invention. Node configuration rules can be determined according to actual needs, and flexible configuration can be achieved to apply to different numbers of application nodes.
对目标数据库对象进行分区是将目标数据库对象划分为至少一个数据区域,但并不是每一个数据库对象都是可以进行划分的。Partitioning the target database object is to divide the target database object into at least one data area, but not every database object can be divided.
在目标数据库对象可以进行划分的情况下,所划分的数据区域的个数需与同时访问目标数据库对象的应用节点的个数保持一致。In the case that the target database object can be divided, the number of the divided data areas must be consistent with the number of application nodes accessing the target database object at the same time.
需要理解的是,在目标数据库对象可被分区的情况下能够得到一种访问参数,在目标数据库对象不可被分区的情况下能够得到另一种访问参数,但这两种访问参数都能够确定目标数据库对象中数据的位置,以便应用节点对数据执行操作。It should be understood that one access parameter can be obtained when the target database object can be partitioned, and another access parameter can be obtained when the target database object cannot be partitioned, but both access parameters can determine the target. The location of the data in the database object for application nodes to perform operations on the data.
在本发明实施例中,根据应用节点的个数、RAC节点个数以及节点配置规则确定目标应用节点对应连接的RAC节点,使得每个应用节点都通过对应的RAC节点访问目标数据库对象,根据目标数据库对象对应的应用节点的个数以及目标数据库对象是否可被分区,确定所述目标应用节点对应的访问参数,以便目标应用节点对目标数据库对象中的数据执行操作。In the embodiment of the present invention, the RAC node to which the target application node is connected is determined according to the number of application nodes, the number of RAC nodes, and the node configuration rule, so that each application node accesses the target database object through the corresponding RAC node. The number of application nodes corresponding to the database object and whether the target database object can be partitioned, and the access parameters corresponding to the target application node are determined, so that the target application node can perform operations on the data in the target database object.
可选地,所述基于所述目标数据库对象对应的应用节点的个数以及所述目标数据库对象是否可被分区,确定所述目标应用节点对应的访问参数,包括:Optionally, determining the access parameter corresponding to the target application node based on the number of application nodes corresponding to the target database object and whether the target database object can be partitioned, including:
在所述目标数据库对象可被分区的情况下,从至少一个数据区域中确定所述目标应用节点对应的可访问的数据区域,得到所述目标应用节点对应的访问参数;In the case that the target database object can be partitioned, determining an accessible data area corresponding to the target application node from at least one data area, and obtaining access parameters corresponding to the target application node;
其中,所述至少一个数据区域是基于所述目标数据库对象对应的应用节点的个数,对所述目标数据库对象执行分区处理操作得到的。The at least one data area is obtained by performing a partition processing operation on the target database object based on the number of application nodes corresponding to the target database object.
需要说明的是,多个应用节点同时访问同一个数据库对象时,只能有一个应用节点操作数据对象,其他应用节点需要等待,当应用节点操作结束后又需要将操作后的数据库对象发送给下一个应用节点,如果不同的应用节点对应的RAC节点是不同的,那么发送数据库对象时就需要通过私网进行发送,这使得私网流量升高。It should be noted that when multiple application nodes access the same database object at the same time, only one application node can operate the data object, and other application nodes need to wait. For an application node, if the RAC nodes corresponding to different application nodes are different, the database objects need to be sent through the private network when sending database objects, which increases the private network traffic.
虽然不同应用节点访问同一目标数据库对象,但是每个应用节点实际要操作的数据是不相同的,那么在目标数据库对象可以被分区的情况下,将目标数据库对象划分为至少一个数据区域,使得每一个应用节点要操作的数据分别在一个数据区域中,这样多个应用节点同时访问目标数据库对象时,能够操作各自对应的数据区域,使得多个应用节点操作同一目标数据库对象,降低了RAC节点之间的私网通讯。Although different application nodes access the same target database object, the actual data to be manipulated by each application node is different. In the case that the target database object can be partitioned, the target database object is divided into at least one data area, so that each The data to be operated by an application node is in one data area, so that when multiple application nodes access the target database object at the same time, they can operate their corresponding data areas, so that multiple application nodes can operate the same target database object, reducing the time between RAC nodes. private network communication.
例如,已部署16个应用节点读取一个消息队列的消息,每个应用节点读取的消息不相同,每个应用节点只需要根据逐条消息触发后续数据加工操作即可,那么这个队列的所有消息对应的数据存储在数据库中得到的数据块,实际上是可以按照应用节点进行分区的数据库对象。For example, 16 application nodes have been deployed to read the messages of a message queue. The messages read by each application node are different. Each application node only needs to trigger subsequent data processing operations according to each message, then all the messages in this queue The data blocks obtained by storing the corresponding data in the database are actually database objects that can be partitioned according to application nodes.
需要理解的是,在所述目标数据库对象可被分区的情况下,根据目标数据库对应的应用节点的个数确定目标数据库对象的数据区域个数,使得每个应用节点独立访问一个数据区域。It should be understood that, when the target database object can be partitioned, the number of data areas of the target database object is determined according to the number of application nodes corresponding to the target database, so that each application node independently accesses a data area.
每个应用节点与分区后的数据区域存在一一对应的关系,分区结束后会为每一个数据区域生成一个分区键;此时,目标应用节点的访问参数包括目标应用节点的编码以及对应的数据区域的分区键。There is a one-to-one correspondence between each application node and the partitioned data area. After the partition ends, a partition key will be generated for each data area; at this time, the access parameters of the target application node include the code of the target application node and the corresponding data The partition key for the region.
在本发明实施例中,通过对目标数据库对象进行分区处理,使得每个应用节点都对应一个数据区域,进而确定应用节点的访问参数,使得不同应用节点同时访问目标数据库对象时,通过访问参数同时对目标数据库对象中的数据进行操作而不会相互影响,进而减少RAC节点之间的私网通讯,在一定程度上降低私网流量。In the embodiment of the present invention, by performing partition processing on the target database object, each application node corresponds to a data area, and then the access parameters of the application nodes are determined, so that when different application nodes access the target database object at the same time, through the access parameters simultaneously Operate the data in the target database object without affecting each other, thereby reducing the private network communication between the RAC nodes and reducing the private network traffic to a certain extent.
可选地,所述通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作,包括:Optionally, performing a target operation on data corresponding to the target database object by accessing the target database object through the RAC node and according to the access parameter, including:
通过所述RAC节点,访问所述目标数据库对象中所述目标应用节点对应的可访问的数据区域,对所述数据区域中的数据执行目标操作。Through the RAC node, the accessible data area corresponding to the target application node in the target database object is accessed, and the target operation is performed on the data in the data area.
可以理解的是,每个应用节点分别访问对应的数据区域,并操作数据区域中的数据,应用节点之间互不影响。It can be understood that each application node accesses the corresponding data area respectively, and operates the data in the data area, and the application nodes do not affect each other.
在本发明实施例中,每个应用节点访问连接确定的RAC节访问对应的数据区域,并对数据区域中的数据进行操作,以实现多个应用节点同时操作目标数据库对象的目的,使得每个应用节点操作数据互不影响,在一定程度上降低了私网流量,进而提高了数据库负荷上限,减轻了数据库整体压力。In the embodiment of the present invention, each application node accesses the RAC section determined by the connection to access the corresponding data area, and operates the data in the data area, so as to achieve the purpose of simultaneously operating the target database object by multiple application nodes, so that each The operation data of the application nodes does not affect each other, which reduces the private network traffic to a certain extent, thereby increasing the upper limit of the database load and reducing the overall pressure on the database.
可选地,所述基于所述目标数据库对象对应的应用节点的个数以及所述目标数据库对象是否可被分区,确定所述目标应用节点对应的访问参数,包括:Optionally, determining the access parameter corresponding to the target application node based on the number of application nodes corresponding to the target database object and whether the target database object can be partitioned, including:
在所述目标数据库对象不可被分区的情况下,从至少两个数据库对象中确定所述目标应用节点对应的可访问的数据库对象,得到所述目标应用节点对应的访问参数;In the case that the target database object cannot be partitioned, determining an accessible database object corresponding to the target application node from at least two database objects, and obtaining an access parameter corresponding to the target application node;
其中,所述至少两个数据库对象是基于所述目标数据库对象对应的应用节点的个数,对所述目标数据库对象执行复制处理操作得到的。The at least two database objects are obtained by performing a copy processing operation on the target database object based on the number of application nodes corresponding to the target database object.
需要说明的是,虽然不同应用节点访问同一目标数据库对象,但是每个应用节点实际要操作的数据是不相同的,那么在目标数据库对象不可被分区的情况下,根据目标数据库对象对应的应用节点的个数确定目标数据库对象复制的个数,对目标数据库对象进行复制,使得每一个应用节点都能操作一个数据库对象,这样多个应用节点同时访问目标数据库对象时,能够操作各自对应的数据库对象,进而降低了RAC节点之间的私网通讯。It should be noted that although different application nodes access the same target database object, the actual data to be manipulated by each application node is different, then in the case that the target database object cannot be partitioned, the application node corresponding to the target database object will be The number of target database objects determines the number of target database objects to be replicated, and the target database objects are replicated so that each application node can operate a database object, so that when multiple application nodes access the target database object at the same time, they can operate their corresponding database objects. , thereby reducing the private network communication between RAC nodes.
例如,已部署16个应用节点读取第一消息队列的消息,甲应用节点读取的消息A在处理过程中需要用到其它消息(比如消息B)进行拼接,而消息B属于第二消息队列,那么甲节点读取消息A后触发信息加工操作时需要用到消息B对应的数据,此时需要将消息A和消息B进行条件关联,而这个条件关联是通过一个类似于业务的标识号来关联的,它与应用节点无关。此时如果需要对消息B涉及的数据进行存储,那么它作为一个数据库对象,是一个不建议按照应用读取节点进行分区的数据库对象。For example, 16 application nodes have been deployed to read the messages of the first message queue. The message A read by application node A needs to be spliced with other messages (such as message B) in the processing process, and message B belongs to the second message queue. , then node A needs to use the data corresponding to message B when triggering the information processing operation after reading message A. At this time, message A and message B need to be conditionally associated, and this conditional association is determined by a service-like identification number. Associative, it has nothing to do with the application node. At this time, if the data involved in message B needs to be stored, it is a database object, and it is not recommended to partition according to the application read node.
需要理解的是,复制后的数据库对象的个数与应用节点的总数保持一致,每个应用节点都与复制后的数据库对象存在一一对应关系,在目标数据库对象复制结束后为复制后的每一个数据库对象生成一个数据库对象编号;此时,目标应用节点的访问参数包括目标应用节点的编号以及对应的数据库对象编号。It should be understood that the number of replicated database objects is consistent with the total number of application nodes, and each application node has a one-to-one correspondence with the replicated database objects. A database object generates a database object number; at this time, the access parameters of the target application node include the number of the target application node and the corresponding database object number.
可以理解的是,复制后的数据库对象内的数据是相同的,对数据库对象进行复制是一种用存储空间换取操作效率的方式。It can be understood that the data in the replicated database objects are the same, and the replication of the database objects is a way of exchanging storage space for operational efficiency.
在本发明实施例中,通过对目标数据库对象进行复制,使得每个应用节点都对应一个数据库对象,进而确定应用节点的访问参数,使得不同应用节点同时访问目标数据库对象时,通过访问参数确定对应操作的数据库对象,同时操作数据库对象中的数据而不会相互影响,进而减少RAC节点之间的私网通讯,在一定程度上降低私网流量。In the embodiment of the present invention, by duplicating the target database object, each application node corresponds to a database object, and then the access parameters of the application nodes are determined, so that when different application nodes access the target database object at the same time, the corresponding access parameters are used to determine the corresponding database object. The data in the database objects can be operated without affecting each other, thereby reducing the private network communication between the RAC nodes and reducing the private network traffic to a certain extent.
可选地,所述通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作,包括:Optionally, performing a target operation on data corresponding to the target database object by accessing the target database object through the RAC node and according to the access parameter, including:
通过所述RAC节点,访问所述目标应用节点对应的可访问的数据库对象,对所述可访问的数据库对象的数据执行目标操作。Through the RAC node, an accessible database object corresponding to the target application node is accessed, and a target operation is performed on the data of the accessible database object.
可以理解的是,每个应用节点分别访问对应的数据库对象,并操作数据库对象中的数据,应用节点之间互不影响。It is understandable that each application node accesses the corresponding database object respectively, and operates the data in the database object, and the application nodes do not affect each other.
在本发明实施例中,每个应用节点访问连接确定的RAC节访问对应的数据库对象,并对数据库对象中的数据进行操作,以实现多个应用节点同时操作目标数据库对象的目的,使得每个应用节点操作数据互不影响,在一定程度上降低了私网流量,进而提高了数据库负荷上限,减轻了数据库整体压力。In the embodiment of the present invention, each application node accesses the RAC section determined by the connection to access the corresponding database object, and operates the data in the database object, so as to realize the purpose of simultaneously operating the target database object by multiple application nodes, so that each The operation data of the application nodes does not affect each other, which reduces the private network traffic to a certain extent, thereby increasing the upper limit of the database load and reducing the overall pressure on the database.
可选地,所述通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作之前,还包括:Optionally, before performing the target operation on the data corresponding to the target database object by accessing the target database object through the RAC node and according to the access parameter, the method further includes:
将所述目标数据库对象对应的数据库的与负载均衡相关的参数置为不生效状态。The load balancing-related parameters of the database corresponding to the target database object are set to an ineffective state.
一种实施方式中,关闭jdbc中的load_balance以及将数据库参数中的remote_listener设置为空值。In one implementation, turn off load_balance in jdbc and set remote_listener in database parameters to a null value.
需要说明的是,将目标数据库对象对应的数据库的与负载均衡相关的参数置为不生效状态的目的是关闭数据库的自动负载均衡功能,使得应用节点对目标数据库对象对应的数据库的连接均建立在单节点上。It should be noted that the purpose of setting the load balancing-related parameters of the database corresponding to the target database object to the ineffective state is to disable the automatic load balancing function of the database, so that the connection of the application node to the database corresponding to the target database object is established in the on a single node.
在本发明实施例中,通过将目标数据库对象对应的数据库的与负载均衡相关的参数置为不生效状态,保证每个应用节点每次访问目标数据库对象时都是通过固定的RAC节点,使得应用节点对目标数据库对象对应的数据库的连接均建立在单节点上,从而降低私网流量。In the embodiment of the present invention, by setting the load balancing-related parameters of the database corresponding to the target database object to an ineffective state, it is ensured that each application node accesses the target database object through a fixed RAC node every time, so that the application The connection between the node and the database corresponding to the target database object is established on a single node, thereby reducing private network traffic.
图2是本发明提供的目标应用节点访问目标数据库对象的流程示意图。如图2所示,该流程包括:FIG. 2 is a schematic flowchart of a target application node accessing a target database object provided by the present invention. As shown in Figure 2, the process includes:
步骤201,目标应用节点获取配置化参数;
步骤202,根据配置化参数确定目标数据库对象对应的应用节点的个数,RAC节点的个数以及节点配置规则;Step 202, determining the number of application nodes corresponding to the target database object, the number of RAC nodes and the node configuration rule according to the configuration parameters;
步骤203,确定目标应用节点连接的RAC节点;
步骤204,确定目标数据库对象是否可被分区,在目标数据库对象可被分区的情况下进入步骤205,在目标数据库对象不可被分区的情况下进入步骤206;
步骤205,确定访问参数为目标应用节点的编号和对应的数据区域的分区键,进入步骤207;
步骤206,确定访问参数为目标应用节点的编号和对应的数据库对象编号,进入步骤207;
步骤207,根据目标应用节点连接的RAC节点以及访问参数,对目标数据库对象的数据执行目标操作。Step 207: Execute the target operation on the data of the target database object according to the RAC node connected to the target application node and the access parameter.
下面对本发明提供的数据库访问装置进行描述,下文描述的数据库访问装置与上文描述的数据库访问方法可相互对应参照。The database access device provided by the present invention will be described below, and the database access device described below and the database access method described above may refer to each other correspondingly.
图3为本发明实施例提供的数据库访问装置的结构示意图,如图3所示,本发明实施例提供了一种基于深度强化学习的路径规划系统,包括参数获取模块301、节点确定模块302和操作模块303,其中:FIG. 3 is a schematic structural diagram of a database access device provided by an embodiment of the present invention. As shown in FIG. 3, an embodiment of the present invention provides a path planning system based on deep reinforcement learning, including a
参数获取模块301,用于在目标应用节点需要对目标数据库对象进行访问的情况下,获取所述目标数据库对象关联的配置化参数;A
节点确定模块302,用于根据所述配置化参数,确定所述目标应用节点对应连接的RAC节点和访问参数;A
操作模块303,用于通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作。The
本发明提供的数据库访问装置,通过获取目标数据库对象关联的配置化参数,确定目标应用节点对应连接的RAC节点和访问参数,进而通过对应的RAC节点并根据访问参数访问目标数据库对象,并对其中的数据执行目标操作,使得每个应用节点通过固定的RAC节点访问目标数据库对象,由于访问参数的确定,不同应用节点同时访问目标数据库对象时,RAC节点之间不会进行大量私网间通讯,在保证高可用、负载均衡的基础上最大程度的降低私网流量,从而极大提高了数据库负荷上限,减轻了数据库整体压力。The database access device provided by the present invention determines the RAC node and access parameters connected to the target application node by acquiring the configuration parameters associated with the target database object, and then accesses the target database object through the corresponding RAC node and according to the access parameters, and compares the The data performs the target operation, so that each application node accesses the target database object through a fixed RAC node. Due to the determination of the access parameters, when different application nodes access the target database object at the same time, there will be no large amount of private network communication between the RAC nodes. On the basis of ensuring high availability and load balance, the private network traffic is reduced to the greatest extent, thereby greatly increasing the upper limit of the database load and reducing the overall pressure on the database.
可选地,所述配置化参数包括:Optionally, the configuration parameters include:
所述目标数据库对象对应的应用节点的个数,所述目标数据库对象连接的RAC节点的个数,以及所述目标数据库对象对应的节点配置规则;The number of application nodes corresponding to the target database object, the number of RAC nodes connected to the target database object, and the node configuration rules corresponding to the target database object;
其中,所述节点配置规则用于反映应用节点访问所述目标数据库对象时与RAC节点之间的连接配置关系。The node configuration rule is used to reflect the connection configuration relationship between the application node and the RAC node when accessing the target database object.
可选地,节点确定模块302,包括:Optionally, the
RAC节点确定单元,用于根据所述目标数据库对象对应的应用节点的个数,所述目标数据库对象连接的RAC节点的个数,以及所述节点配置规则,确定所述目标应用节点对应连接的RAC节点;The RAC node determination unit is configured to determine the corresponding connection of the target application node according to the number of application nodes corresponding to the target database object, the number of RAC nodes connected to the target database object, and the node configuration rule. RAC node;
访问参数确定单元,用于基于所述目标数据库对象对应的应用节点的个数以及所述目标数据库对象是否可被分区,确定所述目标应用节点对应的访问参数。An access parameter determination unit, configured to determine an access parameter corresponding to the target application node based on the number of application nodes corresponding to the target database object and whether the target database object can be partitioned.
可选地,所述访问参数确定单元,用于:Optionally, the access parameter determination unit is used for:
在所述目标数据库对象可被分区的情况下,从至少一个数据区域中确定所述目标应用节点对应的可访问的数据区域,得到所述目标应用节点对应的访问参数;In the case that the target database object can be partitioned, determining an accessible data area corresponding to the target application node from at least one data area, and obtaining an access parameter corresponding to the target application node;
其中,所述至少一个数据区域是基于所述目标数据库对象对应的应用节点的个数,对所述目标数据库对象执行分区处理操作得到的。The at least one data area is obtained by performing a partition processing operation on the target database object based on the number of application nodes corresponding to the target database object.
可选地,所述访问参数确定单元,用于:Optionally, the access parameter determination unit is used for:
在所述目标数据库对象不可被分区的情况下,从至少两个数据库对象中确定所述目标应用节点对应的可访问的数据库对象,得到所述目标应用节点对应的访问参数;In the case that the target database object cannot be partitioned, determine an accessible database object corresponding to the target application node from at least two database objects, and obtain an access parameter corresponding to the target application node;
其中,所述至少两个数据库对象是基于所述目标数据库对象对应的应用节点的个数,对所述目标数据库对象执行复制处理操作得到的。The at least two database objects are obtained by performing a copy processing operation on the target database object based on the number of application nodes corresponding to the target database object.
可选地,操作模块303,具体用于:Optionally, the
通过所述RAC节点,访问所述目标数据库对象中所述目标应用节点对应的可访问的数据区域,对所述数据区域中的数据执行目标操作。Through the RAC node, the accessible data area corresponding to the target application node in the target database object is accessed, and the target operation is performed on the data in the data area.
可选地,操作模块303,具体用于:Optionally, the
通过所述RAC节点,访问所述目标应用节点对应的可访问的数据库对象,对所述可访问的数据库对象的数据执行目标操作。Through the RAC node, an accessible database object corresponding to the target application node is accessed, and a target operation is performed on the data of the accessible database object.
可选地,所述通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作之前,还包括:Optionally, before performing the target operation on the data corresponding to the target database object by accessing the target database object through the RAC node and according to the access parameter, the method further includes:
将所述目标数据库对象对应的数据库的与负载均衡相关的参数置为不生效状态。The load balancing-related parameters of the database corresponding to the target database object are set to an ineffective state.
在此需要说明的是,本发明实施例提供的上述数据库访问装置,能够实现上述数据库访问方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted here that the above-mentioned database access apparatus provided by the embodiments of the present invention can implement all the method steps implemented by the above-mentioned database access method embodiments, and can achieve the same technical effect, and the related The same parts and beneficial effects of the method embodiments will be described in detail.
图4示例了一种电子设备的实体结构示意图,如图4所示,该电子设备可以包括:处理器(processor)410、通信接口(Communications Interface)420、存储器(memory)430和通信总线440,其中,处理器410,通信接口420,存储器430通过通信总线440完成相互间的通信。处理器410可以调用存储器430中的逻辑指令,以执行数据库访问方法,该方法包括:在目标应用节点需要对目标数据库对象进行访问的情况下,获取所述目标数据库对象关联的配置化参数;根据所述配置化参数,确定所述目标应用节点对应连接的RAC节点和访问参数;通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作。FIG. 4 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 4 , the electronic device may include: a processor (processor) 410, a communication interface (Communications Interface) 420, a memory (memory) 430 and a
此外,上述的存储器430中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the
另一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的数据库访问方法,该方法包括:在目标应用节点需要对目标数据库对象进行访问的情况下,获取所述目标数据库对象关联的配置化参数;根据所述配置化参数,确定所述目标应用节点对应连接的RAC节点和访问参数;通过所述RAC节点并根据所述访问参数访问所述目标数据库对象,对所述目标数据库对象对应的数据执行目标操作。On the other hand, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the database access method provided by the above methods, and the method includes: In the case that the target application node needs to access the target database object, obtain the configuration parameters associated with the target database object; according to the configuration parameters, determine the RAC node and access parameters corresponding to the connection of the target application node; The RAC node accesses the target database object according to the access parameter, and performs a target operation on the data corresponding to the target database object.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on this understanding, the above-mentioned technical solutions can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic A disc, an optical disc, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210333713.4A CN114706837A (en) | 2022-03-30 | 2022-03-30 | Database access method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210333713.4A CN114706837A (en) | 2022-03-30 | 2022-03-30 | Database access method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114706837A true CN114706837A (en) | 2022-07-05 |
Family
ID=82170800
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210333713.4A Pending CN114706837A (en) | 2022-03-30 | 2022-03-30 | Database access method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114706837A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160366220A1 (en) * | 2015-06-15 | 2016-12-15 | Yossi Gottlieb | Methods, systems, and media for providing distributed database access during a network split |
CN109413069A (en) * | 2018-10-29 | 2019-03-01 | 北京百悟科技有限公司 | The application method and device of virtual site firewall based on block chain |
CN111581234A (en) * | 2020-05-09 | 2020-08-25 | 中国银行股份有限公司 | RAC multi-node database query method, device and system |
CN113254519A (en) * | 2021-05-28 | 2021-08-13 | 北京奇岱松科技有限公司 | Access method, device, equipment and storage medium of multi-source heterogeneous database |
-
2022
- 2022-03-30 CN CN202210333713.4A patent/CN114706837A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160366220A1 (en) * | 2015-06-15 | 2016-12-15 | Yossi Gottlieb | Methods, systems, and media for providing distributed database access during a network split |
CN109413069A (en) * | 2018-10-29 | 2019-03-01 | 北京百悟科技有限公司 | The application method and device of virtual site firewall based on block chain |
CN111581234A (en) * | 2020-05-09 | 2020-08-25 | 中国银行股份有限公司 | RAC multi-node database query method, device and system |
CN113254519A (en) * | 2021-05-28 | 2021-08-13 | 北京奇岱松科技有限公司 | Access method, device, equipment and storage medium of multi-source heterogeneous database |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190294602A1 (en) | Data scrubbing method and apparatus, and computer readable storage medium | |
US7783763B2 (en) | Managing stateful data in a partitioned application server environment | |
CN111083179B (en) | Internet of Things cloud platform, device interaction method and device based on Internet of Things cloud platform | |
US20240248810A1 (en) | Systems and methods for cross-regional back up of distributed databases on a cloud service | |
US8954478B2 (en) | Systems, methods, and media for managing RAM resources for in-memory NoSQL databases | |
WO2016169237A1 (en) | Data processing method and device | |
JP2022500724A (en) | Replacing the tenant identifier | |
EP3633519A1 (en) | Method for storing objects, and object store gateway | |
CN108875035B (en) | Data storage method of distributed file system and related equipment | |
CN113886350A (en) | Data processing method and system | |
CN113301084B (en) | Data processing method and device | |
CN112988874A (en) | Data processing method, system, computing device and readable storage medium | |
CN112468317A (en) | Cluster topology updating method, system, equipment and computer storage medium | |
CN115840639A (en) | Service access method, device, equipment and medium based on Hash algorithm | |
CN105760391A (en) | Data dynamic redistribution method and system, data node and name node | |
CN111752892A (en) | Distributed file system, method for implementing the same, management system, device, and medium | |
CN114706837A (en) | Database access method and device | |
JP7305898B2 (en) | Operation response method, operation response device, electronic device and storage medium | |
CN116800671A (en) | Data transmission method, apparatus, computer device, storage medium, and program product | |
CN117076470A (en) | Capacity expansion method, device, equipment, medium and program product for financial database | |
CN111741038A (en) | Data transmission method and data transmission device | |
CN116340262A (en) | Data processing method, system, equipment and medium | |
CN116225816A (en) | Middleware monitoring system, middleware monitoring method, equipment and medium | |
CN113867626A (en) | Method, system, equipment and storage medium for optimizing performance of storage system | |
CN111400404A (en) | Node initialization method, device, 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220705 |
|
RJ01 | Rejection of invention patent application after publication |