CN-116303530-B - Heterogeneous database storage process access method, device, equipment and storage medium
Abstract
The invention discloses a method, a device, equipment and a storage medium for accessing a storage process of a heterogeneous database, wherein the method comprises the steps of judging whether a storage process needs to be created or replaced if a received SQL statement belongs to the storage process; if the storage process needs to be created or replaced, each step of the storage process is sequentially analyzed to obtain an analysis result, the analysis result is converted into a Java class program, the Java class program is loaded into an existing container, and an execution result is returned. According to the invention, when the SQL belongs to the storage process, whether the storage process needs to be created or replaced is judged, if the storage process needs to be created or replaced, each step of the storage process is analyzed, the analysis result is converted into the Java class program, the Java class program is loaded into the existing container, and the execution result is returned.
Inventors
- MA CHENGCHEN
- CHEN YANGCUN
- LIU CUN
- LAI PENG
Assignees
- 北京景尧科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230110
Claims (7)
- 1. A method for accessing a heterogeneous database storage process, the method comprising: Receiving Oracle SQL sentences through a data bus, and intercepting and analyzing in real time; Judging whether the Oracle SQL statement belongs to a storage process or not; if the received Oracle SQL statement belongs to a storage process, judging whether the storage process needs to be created or replaced; If the storage process needs to be created or replaced, sequentially analyzing each step of the storage process to obtain an analysis result; Converting the analysis result into a Java class program; Loading the Java class program to an existing container, and returning an execution result; after the step of judging whether the Oracle SQL statement belongs to the stored procedure, the method further comprises the following steps: if the Oracle SQL statement belongs to a storage process, judging whether the storage process needs to be deleted or not; If the storage process needs to be deleted, judging whether the storage process exists or not; if yes, deleting the corresponding storage process, and synchronously sending a deleting instruction to a container containing the SQL converter; The step of converting the analysis result into a Java class program specifically includes: Converting the analysis result into a Java class program through an SQL converter; and synchronously transmitting the Java class program to a container containing an SQL converter, and converting the similar steps of the analysis result into the corresponding Java class program.
- 2. The method of claim 1, wherein after the step of determining whether the stored procedure needs to be created or replaced if the received Oracle SQL statement belongs to the stored procedure, further comprising: If the storage process does not need to be created or replaced, judging whether the storage process exists or not; if so, an error is prompted to exist.
- 3. The method of claim 2, wherein after the step of determining whether the stored procedure exists if the stored procedure does not need to be created or replaced, further comprising: If not, sequentially analyzing each step of the storage process to obtain an analysis result; converting the analysis result into a Java class program, and converting the similar steps of the analysis result into corresponding Java class programs; And synchronously sending the Java class program to a container containing the SQL converter, loading the Java class program to an existing container, and returning an execution result.
- 4. The method of claim 1, wherein after the step of determining whether the Oracle SQL statement belongs to a stored procedure, further comprising: And if the Oracle SQL statement does not belong to the stored process, executing the Oracle SQL statement according to the conventional logic of the database.
- 5. A heterogeneous database storage process access device, the device comprising: the judging module is used for judging whether the storage process needs to be created or replaced if the received Oracle SQL statement belongs to the storage process; the analysis module is used for sequentially analyzing each step of the storage process if the storage process needs to be created or replaced, so as to obtain an analysis result; the conversion module is used for converting the analysis result into a Java class program; the output module is used for loading the Java class program to an existing container and returning an execution result; The judging module is also used for receiving the Oracle SQL statement through the data bus, and intercepting and analyzing the Oracle SQL statement in real time; The judging module is further used for judging whether the storage process needs to be deleted if the Oracle SQL statement belongs to the storage process, judging whether the storage process exists if the storage process needs to be deleted, deleting the corresponding storage process if the storage process exists, and synchronously sending a deleting instruction to a container containing an SQL converter; The conversion module is also used for converting the analysis result into Java class programs through the SQL converter, synchronously transmitting the Java class programs to a container containing the SQL converter, and converting the similar steps of the analysis result into corresponding Java class programs.
- 6. A heterogeneous database storage process access device, characterized in that the device comprises a memory, a processor and a heterogeneous database storage process access program stored on the memory and executable on the processor, the heterogeneous database storage process access program being configured to implement the steps of the heterogeneous database storage process access method according to any of claims 1 to 4.
- 7. A storage medium having stored thereon a heterogeneous database storage process access program which, when executed by a processor, implements the steps of the heterogeneous database storage process access method of any of claims 1 to 4.
Description
Heterogeneous database storage process access method, device, equipment and storage medium Technical Field The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for accessing a heterogeneous database storage process. Background Currently, core business systems of industries such as financial industry, operators, energy sources, government enterprises, army and the like are developed based on Oracle, so that the business forms a strong-association and tight-coupling dependency relationship on the Oracle. The localization of the database requires that the existing Oracle database is directly replaced by the domestic database, and the technical problem that the domestic database is compatible with the Oracle storage process and does not reach the standard is faced. The traditional scheme compatible with the Oracle storage process mainly comprises application end transformation and database end compatibility. For all application programs of which the application end is modified by the Oracle storage process, all storage processes are disassembled into a single SQL statement, but the scheme can lead hundreds of applications to be modified, meanwhile, the modification must involve testing and commissioning, no matter the time cost or the money cost is not born by a client, and meanwhile, the rewritten application program has potential unknown risks such as bug unseen, and has hidden danger of service interruption for 7x24 hours without stopping service. The database end compatibility refers to the storage process of directly compatible Oracle of the domestic database, but the domestic database cannot be fully compatible with the Oracle storage process in a short period in the current process. Therefore, a method for accessing the storage process of the heterogeneous database is needed, and the technical problem that the storage process is not supported by some domestic databases after the domestic databases are replaced by the existing Oracle databases in the application system is solved. Disclosure of Invention The invention mainly aims to provide a heterogeneous database storage process access method, a heterogeneous database storage process access device, heterogeneous database storage process access equipment and a heterogeneous database storage process storage medium, and aims to solve the technical problem that in the prior art, after an existing Oracle database is replaced by an existing Oracle database, some domestic databases cannot support a storage process. In order to achieve the above object, the present invention provides a method for accessing a heterogeneous database storage process, the method comprising the steps of: if the received Oracle SQL statement belongs to a storage process, judging whether the storage process needs to be created or replaced; If the storage process needs to be created or replaced, sequentially analyzing each step of the storage process to obtain an analysis result; Converting the analysis result into a Java class program; and loading the Java class program into an existing container, and returning an execution result. Optionally, the step of converting the parsing result into a Java class program specifically includes: Converting the analysis result into a Java class program through an SQL converter; and synchronously transmitting the Java class program to a container containing an SQL converter, and converting the similar steps of the analysis result into the corresponding Java class program. Optionally, if the received Oracle SQL statement belongs to a stored procedure, the step of determining whether the stored procedure needs to be created or replaced further includes: If the storage process does not need to be created or replaced, judging whether the storage process exists or not; if so, an error is prompted to exist. Optionally, after the step of determining whether the storage procedure exists if the storage procedure does not need to be created or replaced, the method further includes: If not, sequentially analyzing each step of the storage process to obtain an analysis result; converting the analysis result into a Java class program, and converting the similar steps of the analysis result into corresponding Java class programs; And synchronously sending the Java class program to a container containing the SQL converter, loading the Java class program to an existing container, and returning an execution result. Optionally, if the received Oracle SQL statement belongs to a stored procedure, before the step of determining whether the stored procedure needs to be created or replaced, the method further includes: Receiving Oracle SQL sentences, and intercepting and analyzing in real time; judging whether the Oracle SQL statement belongs to a storage process or not. Optionally, after the step of determining whether the Oracle SQL statement belongs to a stored procedure, the met