CN111625585A - Access method, device, host and storage medium of hardware acceleration database - Google Patents

Access method, device, host and storage medium of hardware acceleration database Download PDF

Info

Publication number
CN111625585A
CN111625585A CN202010443777.0A CN202010443777A CN111625585A CN 111625585 A CN111625585 A CN 111625585A CN 202010443777 A CN202010443777 A CN 202010443777A CN 111625585 A CN111625585 A CN 111625585A
Authority
CN
China
Prior art keywords
database
rpc
hardware acceleration
message
protocol
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.)
Granted
Application number
CN202010443777.0A
Other languages
Chinese (zh)
Other versions
CN111625585B (en
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.)
Yusur Technology Co ltd
Original Assignee
Yusur Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yusur Technology Co ltd filed Critical Yusur Technology Co ltd
Priority to CN202010443777.0A priority Critical patent/CN111625585B/en
Publication of CN111625585A publication Critical patent/CN111625585A/en
Application granted granted Critical
Publication of CN111625585B publication Critical patent/CN111625585B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

Abstract

The utility model relates to an access method, device, host computer and storage medium of hardware acceleration database, through adopting the JNI technique in the RPC technique to replace the correlation technique, can carry the data in the database operation instruction that user's Java program sent in the RPC message and send to the hardware acceleration database directly, and need not carry out the conversion of programming language, saved the time of JNI conversion programming language, improved the access efficiency of database. And remote communication is supported by the RPC technology, so that a user Java program and a hardware acceleration database can be arranged in different hosts, and the flexibility of hardware acceleration database layout and cross-platform access performance are improved. In addition, the RPC technology has strong compatibility, is easy to migrate to other hosts, and has simple establishing and using process and low maintenance and optimization cost.

Description

Access method, device, host and storage medium of hardware acceleration database
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for accessing a hardware acceleration database, a host, and a storage medium.
Background
In the related art, a hardware acceleration database is a database that can independently complete a database access task by a hardware acceleration system, and does not require excessive participation of a Central Processing Unit (CPU) of a host. When the computer programming language executed by the hardware acceleration system is other programming languages (such as C language and C + +) than Java, the Java program in the host generally needs to call a Java Native Interface (JNI) to perform a programming language conversion operation between the Java program and the hardware acceleration system, so that the Java program can access the hardware acceleration database.
However, in the related art, the problems that the time consumption of the JNI conversion programming language is long, the compatibility is poor, the creation and use process is complex, and the database access efficiency is low exist, the JNI does not support remote communication, and when the JNI technology is used, a Java program, the JNI and a hardware acceleration database are required to be on the same host, which causes limitation to the setting and distribution of the hardware acceleration database.
Disclosure of Invention
To solve the technical problem or at least partially solve the technical problem, the present disclosure provides a method, an apparatus, a host, and a storage medium for accessing a hardware acceleration database.
A first aspect of the present disclosure provides a method for accessing a hardware acceleration database, where the method includes: the method comprises the steps that a first host computer obtains a Database operation instruction sent by a user Java program in the first host computer to an Application Programming Interface (API) of Java Database connection (JDBC for short); calling a Remote Procedure Call (RPC) protocol of a user side, and generating a first RPC message corresponding to a database operation instruction; sending the first RPC message to a hardware acceleration system of a hardware acceleration database, so that the hardware acceleration system analyzes the first RPC message according to an RPC protocol of a server side and executes corresponding database access operation according to an analysis result; wherein the programming language executed by the hardware acceleration system is different from the programming language executed by the user Java program.
A second aspect of the present disclosure provides a database access apparatus, including:
the instruction acquisition module is used for acquiring a database operation instruction sent to the JDBC API by a user Java program in the first host;
the first message generation module is used for calling an RPC protocol of a user side and generating a first RPC message corresponding to the database operation instruction;
the first message sending module is used for sending the first RPC message to a hardware acceleration system of a hardware acceleration database so that the hardware acceleration system can analyze the first RPC message according to an RPC protocol of a server side and execute corresponding database access operation according to an analysis result;
wherein the programming language executed by the hardware acceleration system is different from the programming language executed by the user Java program.
A third aspect of the present disclosure provides a host, comprising:
a processor;
a memory; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method provided by the first aspect of the present disclosure.
A fourth aspect of the disclosure provides a computer readable storage medium having stored thereon a computer program for execution by a processor to perform the method provided by the first aspect of the disclosure.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the method is based on good cross-language row and cross-platform performance of the RPC technology, the JNI technology adopted when the hardware acceleration database is accessed by the related technology is replaced by the RPC technology, when a first host acquires a database operation instruction sent to a JBDC API by a user Java program, a first RPC message corresponding to the database operation instruction is generated by the RPC protocol of a user side, the first RPC message is sent to a hardware acceleration system of the hardware acceleration database, the first RPC message is analyzed by the hardware acceleration system based on the RPC protocol of a server side after the first RPC message is received by the hardware acceleration system, and corresponding database access operation is executed according to an analysis result, so that cross-language access of the hardware acceleration database by the user Java program is achieved. Because the database operation instruction in the disclosure can be transmitted to the hardware acceleration database by the first RPC message without performing programming language conversion processing, time consumption of programming language conversion by using a JNI technology in the related art can be saved, and the access efficiency of the database is improved. Moreover, remote communication is supported by the RPC technology, and after the JNI technology is replaced by the RPC technology, the hardware acceleration database can be distributed, so that a user Java program can access the hardware acceleration database in a cross-platform mode, and the user Java program and the hardware acceleration database are not required to be limited on the same host machine like the related technology, so that the flexibility of layout of the hardware acceleration database can be improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic diagram of a system architecture for accessing a database by a user Java program calling JDBC provided by the related art;
fig. 2 is a schematic diagram of a system architecture for accessing a hardware acceleration database based on JNI provided in the related art;
FIG. 3 is a flowchart of a method for accessing a hardware acceleration database according to an embodiment of the present disclosure;
FIG. 4 is a system framework diagram of cross-language access to a hardware acceleration database based on an RPC protocol according to an embodiment of the present disclosure;
FIG. 5 is a system framework diagram of cross-language access to a hardware acceleration database based on an RPC protocol according to an embodiment of the present disclosure;
FIG. 6 is a flowchart of a method for accessing a hardware acceleration database according to an embodiment of the present disclosure;
FIG. 7 is a flowchart of a method for establishing a connection with a hardware acceleration database according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a database access device provided in an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a host according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
In order to facilitate understanding of the technical solutions of the present disclosure, first, the professional techniques related to the present disclosure are explained:
JDBC technique: JDBC is an application program interface in the Java language that is used to specify how a client program accesses a database, providing methods such as querying and updating data in the database. JDBC drivers are divided into four types, where access is fastest and native protocol drivers are implemented purely in Java. This type of JDBC communicates directly between clients and databases, but at present this type of JDBC driver is almost exclusively available to database vendors and requires the use of different drivers for different databases.
Protocol Buffer technique: protocol Buffer is a Protocol for serializing data structures. It is often applied to the development of communication programs through pipelines (pipelines) or storing data. The Protocol Buffer contains a language for describing interface descriptions for data structures and provides programming tools for generating the data structures or parsing data streams.
gPRC technology: is an open source remote procedure call system initiated by Google. The system is based on HTTP/2 Protocol transmission, and uses Protocol Buffer as interface description language. Under the framework, multiple language services can interact with each other in a cross-platform mode.
JNI technique: JNI is a programming framework that allows Java programs in a Java virtual machine to call native applications or libraries, as well as other programs. Native programs are typically written in C, C + +, or assembly language and compiled into programs based on native hardware and operating systems. JNI allows programmers to solve problems in other programming languages when some work cannot be solved in Java.
Fig. 1 is a schematic diagram of a system architecture for accessing a database by a user Java program calling JDBC provided in the related art. As shown in fig. 1, a database used in the related art may generally execute Java program codes, and an application program interface provided by JDBC may support a Server-Client (C/S) two-layer model. In the C/S two-layer model, a user Java program can directly send a database operation instruction such as inquiring or updating a database and the like to the database by calling the JDBC API, the database performs corresponding operation according to the received database operation instruction, and an access result is returned to the user Java program by the JDBC API. However, in fig. 1, all operations on the database need to be executed by the CPU of the host where the database is located, and a large amount of processing resources of the CPU are occupied.
In order to save processing resources of a host CPU, the related art provides a hardware acceleration database. This database is significantly different from existing databases. The hardware acceleration system of the database in the hardware acceleration database can independently calculate and independently complete all access tasks of the database without excessive participation of a CPU. And in the related art, a hardware driver of the hardware acceleration system is generally written in C language, C + + or Python. In this case, the access of the user Java program to the hardware acceleration database requires the communication between the Java program and the C/C + + hardware driver through the JNI technique. By way of example, fig. 2 is a schematic diagram of a system architecture for accessing a hardware acceleration database based on JNI provided in the related art. As shown in fig. 2, in the system architecture, a user Java program calls a JDBC API to send a database operation instruction to the JDBC API, the JDBC API converts the database operation instruction expressed in the Java language into an instruction expressed in the C + + language through a system-configured JNI, and since the converted instruction is consistent with the language of a hardware driver of the hardware acceleration system, the hardware acceleration system can perform an access operation on the database according to the converted instruction. Similar to initiating access, after the hardware acceleration system completes access to the database, the hardware acceleration system needs to adopt JNI to convert the access result expressed in the C + + language into an access result expressed in the Java language, and return the access result to the user Java program through the JDBC API. However, the access method based on JNI is not perfect, for example, it has at least the following defects:
1. the JNI only supports local communication, a Java program of a user accessing the hardware acceleration database is required to be on the same host with the hardware acceleration database, so that the flexibility of the layout of the hardware acceleration database is poor, the hardware acceleration database cannot be accessed across platforms, and the use value of the hardware acceleration database is reduced.
2. The time consumption of the JNI translation programming language (e.g., translation between Java language and C/C + + language) is long, resulting in inefficient access to the database.
3. The compatibility of the JNI is poor, and when the JNI is migrated to another host, the JNI needs to be reconfigured so that the JNI can support the processor architecture of the host, which is time-consuming, labor-consuming, and high in cost.
4. The JNI creation and use process is complex, files needing to be generated are more, and maintenance and optimization are difficult.
In view of the above problems in the related art, the embodiments of the present disclosure provide an access solution for a hardware acceleration database. According to the scheme, the JNI technology in the related technology is replaced by the RPC technology, data in a database operation instruction sent by a user Java program can be carried in an RPC message and directly sent to the hardware acceleration database, and the conversion of a programming language is not needed. Compared with the related technology, the embodiment of the disclosure can save time for converting the programming language by the JNI and improve the access efficiency of the database. And the RPC technology supports remote communication, so that a user Java program and a hardware acceleration database can be arranged in different hosts, the hardware acceleration database can be distributed in a distributed mode, and the flexibility of the layout of the hardware acceleration database and the cross-platform access performance are improved. In addition, the RPC technology has strong compatibility, is easy to migrate to other hosts, and has simple establishing and using process and low maintenance and optimization cost.
Fig. 3 is a flowchart of an access method of a hardware acceleration database according to an embodiment of the present disclosure. As shown in fig. 3, in the present embodiment, the programming language executed by the hardware acceleration system is different from the programming language executed by the user Java program, where the user Java program executes Java statements, and the hardware acceleration system may be understood as executing one of C language statements or C + + statements by way of example. The method provided by the embodiment comprises the following steps:
step 301, the first host obtains a database operation instruction sent by a user Java program in the first host to a Java database connected to an application program interface API of JDBC.
Step 302, the first host calls a Remote Procedure Call (RPC) protocol of the user side to generate a first RPC message corresponding to the database operation instruction.
And 303, sending the first RPC message to a hardware acceleration system of the hardware acceleration database, so that the hardware acceleration system analyzes the first RPC message according to an RPC protocol of the server and executes corresponding database access operation according to an analysis result.
By way of example, fig. 4 is a system framework diagram for cross-language access to a hardware acceleration database based on an RPC protocol according to an embodiment of the present disclosure. As shown in fig. 4, in the architecture shown in fig. 4, the user Java program and the hardware acceleration database may be on the same host or different hosts, wherein the user Java program is loaded on the first host. The hardware acceleration database comprises a hardware acceleration system and a database, wherein a hardware driver of the hardware acceleration system executes a C + + program. The RPC protocol of the user end and the RPC protocol of the service end are specifically protocols under a gRPC framework and are used for serializing/deserializing structural body type data. The RPC protocol of the user side and the RPC protocol transmission structure of the service side are predefined based on protocol buffers.
In the system shown in fig. 4, the first host is configured to intercept and obtain a database operation instruction sent by a Java program calling JDBC, where the database operation instruction includes at least one of the following: query instructions, insert instructions, delete instructions, data modification instructions, and instructions for setting up a database system.
After intercepting a database operation instruction sent by a user Java program, a first host extracts data used for indicating specific operation contents from the database operation instruction, calls a pre-configured gPC protocol of a user end, serializes the data according to a serialization mode defined by the protocol, and generates a first RPC message. The first RPC message is then sent to a hardware acceleration system of a hardware acceleration database based on HTTP/2 protocol transport. The hardware acceleration system performs deserialization processing on the structural body in the first RPC message by calling a gPC protocol of the server, further drives a hardware driver according to data obtained through deserialization, and executes corresponding database access operation, for example, when the database operation instruction is a query instruction, the hardware acceleration system executes data query processing in the database according to the specific query content data indicated in the query instruction. For another example, when the database operation instruction is a delete instruction, the delete operation may be executed in the database according to the data that is carried in the delete instruction and is used to indicate the specific delete object. Of course, this is by way of example only and not by way of the only limitation of the present disclosure.
Of course, here it should be noted that: although the above description only describes the process of initiating access by the user Java program, it does not prevent those skilled in the art from understanding that the hardware acceleration system feeds back the access result to the user Java program after finishing the database question back by using a process similar to the initiating process.
By way of example, fig. 5 is a system framework diagram for cross-language access to a hardware acceleration database based on an RPC protocol according to an embodiment of the present disclosure. As shown in fig. 5, on the basis of the example in fig. 4, after the hardware acceleration system finishes accessing the database, the gRPC of the calling server performs serialization processing on the result information of the access, generates a second RPC message carrying the result information, and transmits the second RPC message to the first host based on HTTP/2 protocol transmission, the first host calls the gRPC of the user side to perform deserialization processing on data in the second RPC message, and the first host feeds back the result information to the user Java program through the JDBC API after deserializing the result information of the access. The result information fed back by the hardware acceleration system may include a query result or a number of data lines affected by the database access operation. For example, in a possible implementation, when the user Java program sends a query instruction, the hardware acceleration system may feed back the result of the query as result information to the user Java program, and when the user Java program sends an instruction other than the query instruction, such as a delete instruction, a data modification instruction, or an insert instruction, the hardware acceleration system may feed back the number of data lines affected by the access operation as the access result to the user Java program, where the result information is carried by the number of data lines affected by the access operation, for example, the hardware acceleration system performs a modification, deletion, or insert operation on 5 data lines in the data table of the database, and then the number of data lines affected by the access operation of the hardware acceleration system is returned to the user Java program as result information of the access operation. It is understood that this is by way of illustration only and is not meant as an exclusive limitation of the present disclosure.
In the embodiment, the RPC technology is adopted to replace the JNI technology in the related technology, so that data in the database operation instruction sent by the user Java program can be carried in the RPC message and directly sent to the hardware acceleration database without programming conversion. And the RPC technology supports remote communication, so that a user Java program and a hardware acceleration database can be arranged in different hosts, the hardware acceleration database can be distributed in a distributed mode, and the flexibility of the layout of the hardware acceleration database and the cross-platform access performance are improved. In addition, the RPC technology has strong compatibility, is easy to migrate to other hosts, and has simple establishing and using process and low maintenance and optimization cost.
Fig. 6 is a flowchart of an access method of a hardware acceleration database according to an embodiment of the present disclosure, and as shown in fig. 6, the method according to the embodiment includes:
step 601, the first host obtains a database operation instruction sent by a user Java program in the first host to an application program interface API of a Java database connection JDBC.
Step 602, the first host calls an RPC protocol of the user side, and generates a first RPC message of a corresponding type according to the type of the database operation instruction, wherein the RPC protocol of the user side includes an association relationship between an instruction type and an RPC message type.
And 603, the first host sends the first RPC message to a hardware acceleration system of the hardware acceleration database, so that the hardware acceleration system analyzes the first RPC message according to an RPC protocol of the server and executes corresponding database access operation according to an analysis result, wherein a programming language executed by the hardware acceleration system is different from a programming language executed by a Java program of a user.
In this embodiment, the RPC protocol of the user side and the RPC protocol of the service side may be exemplarily understood as a protocol under the gRPC framework for serializing/deserializing the structural body type data. The RPC protocol and the RPC protocol of the server need to define a structure body to be transmitted before use, and the structure body is carried in the RPC message for transmission. The RPC protocol at the user side in this embodiment is mainly used to transmit a database operation instruction sent by a user to the JDBC API.
For example, the embodiment may classify an instruction sent by a user calling JDBC API, and construct a corresponding structure, where different structures define different types of RPC messages for transmission. The various RPC messages and the structures transmitted in the various RPC messages in this embodiment may be defined by proto files of a protocol buffer protocol. The proto file corresponding to the client can be compiled to generate a corresponding Java file for generating an RPC protocol of the client, and the proto file corresponding to the server can be compiled to generate files of h and c types for generating an RPC protocol of the server.
In this embodiment, the association relationship between the instruction type and the RPC message type may be pre-configured in the RPC protocol of the user side and the RPC protocol of the service side, so that the RPC protocol of the user side and the RPC protocol of the service side may perform deserialization according to the structure of the structure to obtain data transmitted in the structure.
The instruction type can be divided into a query instruction and a non-query instruction in the embodiment; the non-query instruction may include a delete instruction, an insert instruction, a data modification instruction, and an instruction for setting the database system. The first RPC messages can be divided into two types according to the instruction types, wherein one type of the first RPC messages is used for transmitting the query instruction, and the other type of the first RPC messages is used for transmitting the non-query instruction.
For example, when a user interacts with a hardware acceleration database through JDBC API, there are mainly two types of Structured Query Language (SQL) instructions, one type is a Query (Select) instruction, and such an instruction starts with "Select" and retrieves a result set from the database; another class is non-Select instructions, such as instructions beginning with "Update", "Insert", "Delete", which return the number of rows of data affected by the instruction. Two types of first RPC messages may be defined for these two types of instructions, respectively. The first RPC message of the first type sends a message containing 'Select' to the hardware acceleration system, and meanwhile, a result set returned by the hardware acceleration system through the second RPC message is waited; the second type of RPC message sends a statement that does not contain "Select" to the hardware acceleration system, and waits for the hardware acceleration system to return the number of data lines affected by the instruction through the second RPC message. In addition, similar to the initiating process, when the hardware acceleration system feeds back the accessed operation result, the hardware acceleration system can return the corresponding operation result by adopting different types of second RPC messages according to different instruction types.
It should be noted that, in this embodiment, the database operation instructions are classified, and the manner of transmitting the corresponding type of instructions by using different types of first RPC messages is only one of many implementation manners of the present disclosure, and is not a complete implementation manner of the present disclosure, for example, in another possible implementation manner, the first RPC message may not be classified, but information such as "Select", "Update", "Insert", and "Delete" is directly carried in the first RPC message to indicate the specific operation indicated by the instruction.
In the embodiment, the database operation instructions sent by the user Java program are classified and transmitted by adopting the first RPC messages of the corresponding types, so that the transmission of the database operation instructions is more standardized and is convenient to maintain and optimize.
Fig. 7 is a flowchart of a method for establishing a connection with a hardware acceleration database according to an embodiment of the present disclosure. As shown in fig. 7, the method includes:
step 701, the first host acquires a database connection request sent by a user Java program to the JDBC API.
Step 702, the first host calls an RPC protocol of the user side to generate a third RPC message corresponding to the database connection request.
And 703, the first host sends the third RPC message to a hardware acceleration system of the hardware acceleration database, so that the hardware acceleration system establishes connection according to the third RPC message.
The implementation manner and the beneficial effects of the present embodiment are similar to those of the embodiment shown in fig. 3 and fig. 4, and are not described herein again.
Fig. 8 is a schematic structural diagram of a database access apparatus provided in an embodiment of the present disclosure, where the apparatus may be understood as the first host or a part of functional modules in the first host in the above-described embodiment. As shown in fig. 8, the database access device 80 includes:
an instruction obtaining module 81, configured to obtain a database operation instruction sent by a user Java program in a first host to a Java database connected to an application program interface API of JDBC;
the first message generation module 82 is used for calling an RPC protocol of a user side and generating a first RPC message corresponding to the database operation instruction;
the first message sending module 83 is configured to send the first RPC message to a hardware acceleration system of the hardware acceleration database, so that the hardware acceleration system analyzes the first RPC message according to an RPC protocol of the server, and executes a corresponding database access operation according to an analysis result; wherein the programming language executed by the hardware acceleration system is different from the programming language executed by the user Java program.
In one embodiment, the first message generation module 82 is configured to:
and calling an RPC protocol of the user side, and generating a first RPC message of a corresponding type according to the type of the database operation instruction, wherein the RPC protocol of the user side comprises an incidence relation between the instruction type and the RPC message type.
In one embodiment, the instruction types include a query instruction and a non-query instruction; the non-query instructions comprise a deletion instruction, an insertion instruction, a data modification instruction and an instruction for setting the database system.
In one embodiment, the apparatus may further comprise:
the receiving module is used for receiving a second RPC message fed back by the hardware acceleration system, wherein the second RPC message comprises result information obtained by the hardware acceleration system executing database access operation according to the first RPC message;
the analysis module is used for analyzing the second RPC message to obtain result information based on the RPC protocol of the user side;
and the access result feedback module is used for sending the result information to the user Java program.
In one embodiment, the result information includes the number of data lines affected by the query result or database access operation.
In one embodiment, the apparatus may further comprise:
the connection request acquisition module is used for acquiring a database connection request sent by a user Java program to an API of JDBC;
the second message generation module is used for calling an RPC protocol of the user side and generating a third RPC message corresponding to the database connection request;
and the second message sending module is used for sending the third RPC message to a hardware acceleration system of the hardware acceleration database so that the hardware acceleration system establishes connection according to the third RPC message.
In one embodiment, the RPC protocol of the user side and the RPC protocol of the server side are both protocols generated based on the gRPC framework.
In one embodiment, the hardware acceleration database is provided in the second host or the first host.
In one embodiment, the programming language executed by the hardware acceleration system includes one of: c language, C + +.
The apparatus provided in this embodiment can execute the method shown in any one of fig. 3, fig. 6, and fig. 7, and its execution manner and beneficial effect are similar, which are not described herein again.
Fig. 9 is a schematic structural diagram of a host according to an embodiment of the present disclosure, and as shown in fig. 9, the host 90 includes: a processor 91;
a memory 92; and
a computer program 921;
wherein the computer program 921 is stored in the memory 92 and configured to be executed by the processor 91 to implement the methods of the above-described embodiments.
The disclosed embodiments also provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method of the above-described embodiments.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (20)

1. A method for accessing a hardware-accelerated database, comprising:
a first host acquires a database operation instruction sent by a user Java program in the first host to a Java database connected with an application program interface API of JDBC;
calling a Remote Procedure Call (RPC) protocol of a user side, and generating a first RPC message corresponding to the database operation instruction;
sending the first RPC message to a hardware acceleration system of a hardware acceleration database, so that the hardware acceleration system analyzes the first RPC message according to an RPC protocol of a server side and executes corresponding database access operation according to an analysis result;
wherein the programming language executed by the hardware acceleration system is different from the programming language executed by the user Java program.
2. The method of claim 1, wherein the Remote Procedure Call (RPC) protocol of the calling user side generates a first RPC message corresponding to the database operation instruction, and comprises:
and calling an RPC protocol of the user side, and generating a first RPC message of a corresponding type according to the type of the database operation instruction, wherein the RPC protocol of the user side comprises an incidence relation between an instruction type and an RPC message type.
3. The method of claim 2, wherein the instruction types include a query instruction and a non-query instruction;
wherein the non-query instruction comprises at least one of the following instructions: delete instructions, insert instructions, data modification instructions, and instructions for setting up a database system.
4. The method of claim 1, wherein after the first host sends the first RPC message to a hardware acceleration system of a hardware acceleration database, the method further comprises:
receiving a second RPC message fed back by the hardware acceleration system, wherein the second RPC message comprises result information obtained by the hardware acceleration system executing database access operation according to the first RPC message;
analyzing the second RPC message to obtain the result information based on the RPC protocol of the user side;
and sending the result information to the user Java program.
5. The method of claim 4, wherein the result information comprises a query result or a number of data lines affected by the database access operation.
6. The method of claim 1, wherein before the first host obtains the database operation instruction sent by the user Java program in the first host to the application program interface API of Java database connectivity JDBC, the method further comprises:
acquiring a database connection request sent by a user Java program to a JDBC API;
calling an RPC protocol of a user side, and generating a third RPC message corresponding to the database connection request;
and sending the third RPC message to a hardware acceleration system of the hardware acceleration database so that the hardware acceleration system establishes connection according to the third RPC message.
7. The method of any of claims 1-6, wherein the RPC protocol at the user end and the RPC protocol at the service end are both gRPC framework generation based protocols.
8. The method according to any of claims 1-6, wherein the hardware acceleration database is provided in a second host or the first host.
9. The method of any of claims 1-6, wherein the programming language executed by the hardware acceleration system comprises one of: c language, C + +.
10. A database access apparatus, comprising:
the instruction acquisition module is used for acquiring a database operation instruction sent by a user Java program in the first host to a Java database connected with an application program interface API of JDBC;
the first message generation module is used for calling an RPC protocol of a user side and generating a first RPC message corresponding to the database operation instruction;
the first message sending module is used for sending the first RPC message to a hardware acceleration system of a hardware acceleration database so that the hardware acceleration system can analyze the first RPC message according to an RPC protocol of a server and execute corresponding database access operation according to an analysis result;
wherein the programming language executed by the hardware acceleration system is different from the programming language executed by the user Java program.
11. The apparatus of claim 10, wherein the first message generating module is configured to:
and calling an RPC protocol of the user side, and generating a first RPC message of a corresponding type according to the type of the database operation instruction, wherein the RPC protocol of the user side comprises an incidence relation between an instruction type and an RPC message type.
12. The apparatus of claim 11, wherein the instruction types comprise a query instruction and a non-query instruction;
wherein the non-query instruction comprises at least one of the following instructions: delete instructions, insert instructions, data modification instructions, and instructions for setting up a database system.
13. The apparatus of claim 10, further comprising:
the receiving module is used for receiving a second RPC message fed back by the hardware acceleration system, wherein the second RPC message comprises result information obtained by the hardware acceleration system executing database access operation according to the first RPC message;
the analysis module is used for analyzing the second RPC message to obtain the result information based on the RPC protocol of the user side;
and the access result feedback module is used for sending the result information to the user Java program.
14. The apparatus of claim 13, wherein the result information comprises a query result or a number of data lines affected by the database access operation.
15. The apparatus of claim 10, further comprising:
the connection request acquisition module is used for acquiring a database connection request sent by a user Java program to the JDBC API;
the second message generation module is used for calling an RPC protocol of the user side and generating a third RPC message corresponding to the database connection request;
and the second message sending module is used for sending the third RPC message to a hardware acceleration system of the hardware acceleration database so that the hardware acceleration system establishes connection according to the third RPC message.
16. The apparatus of any one of claims 10-15, wherein the RPC protocol at the user side and the RPC protocol at the service side are both gRPC framework generation based protocols.
17. The apparatus of any of claims 10-15, wherein the hardware acceleration database is disposed in a second host or the first host.
18. The apparatus according to any of claims 10-15, wherein the programming language executed by the hardware acceleration system comprises one of: c language, C + +.
19. A host, comprising:
a processor;
a memory; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-9.
20. A computer-readable storage medium, on which a computer program is stored, which computer program is executable by a processor to implement the method according to any one of claims 1-9.
CN202010443777.0A 2020-05-22 2020-05-22 Access method, device, host and storage medium of hardware acceleration database Active CN111625585B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010443777.0A CN111625585B (en) 2020-05-22 2020-05-22 Access method, device, host and storage medium of hardware acceleration database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010443777.0A CN111625585B (en) 2020-05-22 2020-05-22 Access method, device, host and storage medium of hardware acceleration database

Publications (2)

Publication Number Publication Date
CN111625585A true CN111625585A (en) 2020-09-04
CN111625585B CN111625585B (en) 2021-08-31

Family

ID=72271085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010443777.0A Active CN111625585B (en) 2020-05-22 2020-05-22 Access method, device, host and storage medium of hardware acceleration database

Country Status (1)

Country Link
CN (1) CN111625585B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633783A (en) * 2021-03-10 2021-04-09 成都卓杭网络科技股份有限公司 Machine room operation and maintenance control system
CN113326033A (en) * 2021-06-09 2021-08-31 北京八分量信息科技有限公司 Key-value storage system with multi-language API
CN113448967A (en) * 2021-07-20 2021-09-28 威讯柏睿数据科技(北京)有限公司 Method and device for accelerating database operation
CN113886481A (en) * 2021-12-06 2022-01-04 北京宇信科技集团股份有限公司 Database access method and system

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1746844A (en) * 2005-09-29 2006-03-15 浪潮电子信息产业股份有限公司 Method for monitoring and managing machine group system of cross-operation platform
CN102227718A (en) * 2008-11-26 2011-10-26 微软公司 Hardware acceleration for remote desktop protocol
CN102331928A (en) * 2011-06-24 2012-01-25 浙大网新科技股份有限公司 Method of source code level compatible hybrid API (application programming interface)
US8458654B2 (en) * 2008-10-22 2013-06-04 International Business Machines Corporation Identifying impact of database changes on an application
CN105357258A (en) * 2015-09-28 2016-02-24 华为技术有限公司 Acceleration management node, acceleration node, client and method
CN106648934A (en) * 2016-12-27 2017-05-10 中科天玑数据科技股份有限公司 Method and system for high-efficiency data transmission between Impala and HBase
CN106897322A (en) * 2015-12-21 2017-06-27 中国移动通信集团山西有限公司 The access method and device of a kind of database and file system
US20180309819A1 (en) * 2015-04-08 2018-10-25 Amazon Technologies, Inc. Endpoint management system providing an application programming interface proxy service
CN108762947A (en) * 2018-05-16 2018-11-06 武汉微创光电股份有限公司 A kind of distributed system remote invocation method, apparatus and system
CN110300082A (en) * 2018-03-21 2019-10-01 腾讯科技(深圳)有限公司 A kind of interface creation method, device and storage medium
CN110515948A (en) * 2019-08-23 2019-11-29 苏州浪潮智能科技有限公司 A kind of data query method, system, electronic equipment and storage medium
CN110990402A (en) * 2019-11-26 2020-04-10 中科驭数(北京)科技有限公司 Format conversion method from row storage to column storage, query method and device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1746844A (en) * 2005-09-29 2006-03-15 浪潮电子信息产业股份有限公司 Method for monitoring and managing machine group system of cross-operation platform
US8458654B2 (en) * 2008-10-22 2013-06-04 International Business Machines Corporation Identifying impact of database changes on an application
CN102227718A (en) * 2008-11-26 2011-10-26 微软公司 Hardware acceleration for remote desktop protocol
CN102331928A (en) * 2011-06-24 2012-01-25 浙大网新科技股份有限公司 Method of source code level compatible hybrid API (application programming interface)
US20180309819A1 (en) * 2015-04-08 2018-10-25 Amazon Technologies, Inc. Endpoint management system providing an application programming interface proxy service
CN105357258A (en) * 2015-09-28 2016-02-24 华为技术有限公司 Acceleration management node, acceleration node, client and method
CN106897322A (en) * 2015-12-21 2017-06-27 中国移动通信集团山西有限公司 The access method and device of a kind of database and file system
CN106648934A (en) * 2016-12-27 2017-05-10 中科天玑数据科技股份有限公司 Method and system for high-efficiency data transmission between Impala and HBase
CN110300082A (en) * 2018-03-21 2019-10-01 腾讯科技(深圳)有限公司 A kind of interface creation method, device and storage medium
CN108762947A (en) * 2018-05-16 2018-11-06 武汉微创光电股份有限公司 A kind of distributed system remote invocation method, apparatus and system
CN110515948A (en) * 2019-08-23 2019-11-29 苏州浪潮智能科技有限公司 A kind of data query method, system, electronic equipment and storage medium
CN110990402A (en) * 2019-11-26 2020-04-10 中科驭数(北京)科技有限公司 Format conversion method from row storage to column storage, query method and device

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CXQ8989: ""OmniSci GPU 数据库提升了庞大的数据集"", 《HTTPS://BLOG.CSDN.NET/CXQ8989/ARTICLE/DETAILS/106195288》 *
JIANWEI TU等: ""Replication for Predictability in a Java RPC Framework"", 《2015 IEEE INTERNATIONAL CONFERENCE ON AUTONOMIC COMPUTING》 *
何嘉俊: ""基于机器视觉的运动员长时跟踪系统研究"", 《中国优秀硕士学位论文全文数据库 社会科学II辑》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633783A (en) * 2021-03-10 2021-04-09 成都卓杭网络科技股份有限公司 Machine room operation and maintenance control system
CN113326033A (en) * 2021-06-09 2021-08-31 北京八分量信息科技有限公司 Key-value storage system with multi-language API
CN113326033B (en) * 2021-06-09 2023-08-11 北京八分量信息科技有限公司 Key-value storage system with multi-language API
CN113448967A (en) * 2021-07-20 2021-09-28 威讯柏睿数据科技(北京)有限公司 Method and device for accelerating database operation
CN113448967B (en) * 2021-07-20 2022-02-08 威讯柏睿数据科技(北京)有限公司 Method and device for accelerating database operation
CN113886481A (en) * 2021-12-06 2022-01-04 北京宇信科技集团股份有限公司 Database access method and system

Also Published As

Publication number Publication date
CN111625585B (en) 2021-08-31

Similar Documents

Publication Publication Date Title
CN111625585B (en) Access method, device, host and storage medium of hardware acceleration database
JP3546394B2 (en) Method and system for transferring remote procedure calls and responses over a network
US5327559A (en) Remote and batch processing in an object oriented programming system
US5953514A (en) Method and apparatus for transparent remote execution of commands
CN101436148B (en) Integrated client end and method for performing interaction of desktop application and network WEB application
US8407237B1 (en) System and method of connecting legacy database applications and new database systems
CN111897638B (en) Distributed task scheduling method and system
US20030016237A1 (en) System for and method of emulating a database system
CN110502212B (en) Multi-language-oriented high concurrency online development supporting method
JPH07281974A (en) Communication system for exchange of data between computers in network
US20030226110A1 (en) Method for dynamically generating structured documents
US20030055862A1 (en) Methods, systems, and articles of manufacture for managing systems using operation objects
WO2018035799A1 (en) Data query method, application and database servers, middleware, and system
CN110955674B (en) Asynchronous exporting method and component based on java service
CN111107022B (en) Data transmission optimization method, device and readable storage medium
CN111984679B (en) Access method, device, host, system and medium of hardware acceleration database
US9690577B1 (en) Legacy applications as web services
CN113391791A (en) Data processing method, device and storage medium
CN113094429B (en) Data processing method, data query method, computer device and storage medium
WO2021259290A1 (en) Stored procedure conversion method and apparatus, and device and storage medium
CN111752916B (en) Data acquisition method and device, computer readable storage medium and electronic equipment
WO2021243665A1 (en) Compilation method, compilation apparatus, compilation system, storage medium, and electronic device
CN113032468A (en) Data writing method, device and computer readable storage medium
CN112433709A (en) JSON-based data processing method, device, equipment and medium
Chen et al. HaoCL: Harnessing large-scale heterogeneous processors made easy

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
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 100094 room 801, 8 / F, building 3, yard 1, 81 Beiqing Road, Haidian District, Beijing

Patentee after: YUSUR TECHNOLOGY Co.,Ltd.

Address before: Room 715, Institute of computing, Chinese Academy of Sciences, Haidian District, Beijing 100086

Patentee before: YUSUR TECHNOLOGY Co.,Ltd.