CN115510137A - JDBC specification-based command conversion method, system, computer equipment and medium - Google Patents

JDBC specification-based command conversion method, system, computer equipment and medium Download PDF

Info

Publication number
CN115510137A
CN115510137A CN202211172072.5A CN202211172072A CN115510137A CN 115510137 A CN115510137 A CN 115510137A CN 202211172072 A CN202211172072 A CN 202211172072A CN 115510137 A CN115510137 A CN 115510137A
Authority
CN
China
Prior art keywords
database
protocol server
interface
result set
background system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211172072.5A
Other languages
Chinese (zh)
Inventor
代庆国
刘亚军
贺欢庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xinge Technology Co ltd
Original Assignee
Beijing Xinge Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xinge Technology Co ltd filed Critical Beijing Xinge Technology Co ltd
Priority to CN202211172072.5A priority Critical patent/CN115510137A/en
Publication of CN115510137A publication Critical patent/CN115510137A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a command conversion method based on JDBC specification, which is characterized by comprising a protocol server, a JDBC specification interface group, a database and a background system, wherein one end of the protocol server is connected with the JDBC specification interface group, the other end of the protocol server is connected with the database, and the background system is also connected with the JDBC specification interface group and the database.

Description

JDBC specification-based command conversion method, system, computer equipment and medium
Technical Field
The present invention relates to command conversion, and in particular, to a method, system, computer device, and medium for command conversion based on JDBC specification.
Background
JDBC (Java Database Connectivity) is a Java application to Database interface specification intended to allow Database developers to provide standard Database Application Programming Interfaces (APIs) for Java programmers. JDBC defines a cross-database and cross-platform general SQL database API;
however, in the prior art, because the number of interfaces adopting the JDBC specification is large in the SQL database at present, when an external decoded file needs to be input to the server through the JDBC specification interface for database calling and execution, the external decoded file needs to be modified in advance, so that a command object of the external decoded file and a calling interface are limited and then called by the database, and when the number of external decoded files to be accessed is too large, a large number of external decoded file modification work causes a use burden on a worker, which is not beneficial to improving the decoding efficiency.
Disclosure of Invention
Therefore, it is necessary to provide a JDBC specification-based command conversion method, system, computer device and medium that can improve decoding efficiency by automatically selecting a database call interface without modifying an external decoded file.
The invention discloses a command conversion method based on JDBC specification, which comprises a protocol server, a JDBC specification interface group, a database and a background system, wherein one end of the protocol server is connected with the JDBC specification interface group, the other end of the protocol server is connected with the database, the background system is also connected with the JDBC specification interface group and the database, and the method comprises the following steps:
a background system acquires a calling interface called when an external decoding file is input into a protocol server, and judges whether the calling interface is a Connection interface, wherein the Connection interface is contained in the JDBC standard interface group;
if yes, the protocol server judges whether the command object in the external decoding file is a Prepare object;
if yes, the protocol server creates a mirror image Prepare object according to the Prepare object through a preset Connect agent;
inputting the mirror image Premate object into the database, and setting secondary parameters of the mirror image Premate object when the database calls the mirror image Premate object, thereby generating a first conversion result set;
the database sends the first set of conversion results to the backend system.
Further, the background system obtains a call interface called when an external decoded file is input to a protocol server, and determines whether the call interface is a Connection interface, where the Connection interface is included in the JDBC specification interface group, and the method further includes:
if yes, the protocol server judges whether a command object in the external decoding file is an SQL object;
if so, the protocol server creates a mirror image SQL object according to the SQL object through a preset Connect agent;
the protocol server inputs the mirror image SQL object into the database to be called and executed, so that a second conversion result set is generated;
the database sends the second set of conversion results to a backend system.
Further, after the step of obtaining a calling interface called when the external decoded file is input to the protocol server, the background system further includes:
the background system judges whether the calling interface is a Driver interface or not, wherein the Driver interface is contained in the JDBC standard interface group;
if yes, the background system judges that a command object contained in an external decoding file input through the Driver interface is a Driver object;
the database inputs the Driver object into a preset registry for registration, so that the registration information of the database is updated;
the protocol server creates a mirror Driver object according to the Driver object through a preset Connect proxy;
the protocol server inputs the mirror Driver object into the updated database for calling and execution, so as to generate a third conversion result set;
the database sends the third set of conversion results to a backend system.
Further, after the step of obtaining a call interface called when the external decoding file is input to the protocol server, the background system further includes:
the background system judges whether the calling interface is a stateful interface, wherein the stateful interface is contained in the JDBC standard interface group;
if so, the protocol server analyzes the State Statement contained in the external decoding file to generate an analysis Statement set;
the protocol server judges whether an analytic statement matched with a preset dangerous statement library exists in the analytic statement set or not;
if yes, the protocol server intercepts the successfully matched analysis Statement and sends error information to a background system through the State element interface.
Further, after the step of determining whether there is an analytic statement in the analytic statement set that matches a preset dangerous statement library, the protocol server further includes:
if not, the protocol server inputs the analysis statement set into the database for calling and executing, so as to generate a preliminary conversion result set;
the database judges whether the primary conversion result set contains an analysis statement matched with a preset error code library;
if yes, the database records the successfully matched analysis statement as a common error code and then sends the common error code to a background system;
if not, the protocol server establishes a mirror image analysis statement set according to the analysis statement set through a preset Connect agent;
the protocol server inputs the mirror image analysis statement set into the database for calling and executing, so as to generate a fourth conversion result set;
the database sends the fourth conversion result set to a background system.
Further, the step of sending, by the database, the first conversion result set to the background system specifically includes:
the database judges whether command objects in a to-be-processed conversion result set exist in a buffer area or not, wherein the processing conversion result set comprises the first conversion result set, the second conversion result set, the third conversion result set and the fourth conversion result set;
and if so, sending the to-be-processed conversion result set to the background system.
Further, after the step of determining, by the database, whether the command object in the conversion result set to be processed exists in the buffer, the method further includes:
if not, the database checks whether the conversion result set to be processed exists in the buffer area again after a preset time period;
if so, sending the to-be-processed conversion result set to the background system;
and if not, acquiring a preset data ending state code and sending the preset data ending state code to the background system.
The invention also discloses a command conversion system based on JDBC specification, which comprises a protocol server, a JDBC specification interface group, a database and a background system, wherein one end of the protocol server is connected with the JDBC specification interface group, the other end of the protocol server is connected with the database, the background system is also connected with the JDBC specification interface group and the database, and the system comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for controlling a background system to acquire a calling interface called when an external decoding file is input into a protocol server and judging whether the calling interface is a Connection interface, and the Connection interface is contained in the JDBC standard interface group;
the object judging unit is used for judging whether the command object in the external decoding file is a Prepare object or not if the command object is judged to be the Prepare object;
the creating unit is used for judging whether the image is a mirror image Premate object or not, if so, the protocol server creates the mirror image Premate object according to the Premate object through a preset Connect agent;
the calling unit is used for inputting the mirror image Prepare object into the database and carrying out secondary parameter setting on the mirror image Prepare object when the database calls the mirror image Prepare object, so that a first conversion result set is generated;
a sending unit, configured to send, by the database, the first conversion result set to the background system.
A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of:
a background system acquires a calling interface called when an external decoding file is input into a protocol server, and judges whether the calling interface is a Connection interface, wherein the Connection interface is contained in the JDBC standard interface group;
if yes, the protocol server judges whether the command object in the external decoding file is a Prepare object;
if yes, the protocol server creates a mirror image Prepare object according to the Prepare object through a preset Connect agent;
inputting the mirror image Prepare object into the database, and setting secondary parameters of the mirror image Prepare object when the database calls the mirror image Prepare object, thereby generating a first conversion result set;
the database sends the first set of conversion results to the backend system.
A computer-readable medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of:
a background system acquires a calling interface called when an external decoding file is input into a protocol server, and judges whether the calling interface is a Connection interface, wherein the Connection interface is contained in the JDBC standard interface group;
if yes, the protocol server judges whether the command object in the external decoding file is a Prepare object;
if yes, the protocol server creates a mirror image Prepare object according to the Prepare object through a preset Connect agent;
inputting the mirror image Prepare object into the database, and setting secondary parameters of the mirror image Prepare object when the database calls the mirror image Prepare object, thereby generating a first conversion result set;
the database sends the first set of conversion results to the backend system.
According to the JDBC specification-based command conversion method, the system, the computer equipment and the medium, the external decoding files are classified according to the type of the calling interface and the type of the command object and then are processed respectively, so that the external decoding files can be directly input into the database through the JDBC specification interface for calling and analyzing without performing early operation on the external decoding files, the problem that in the prior art, when the external decoding files need to be input into the database through the JDBC specification interface for calling and executing, the external decoding files need to be modified in advance, the number of the modified files is increased when the number of the input external decoding files is too large, the decoding efficiency is reduced is solved, and the decoding efficiency of the external decoding files is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
FIG. 1 is a flow chart illustrating a JDBC specification-based command conversion method in an embodiment;
FIG. 2 is a system diagram of a JDBC specification-based command translation system in an embodiment;
FIG. 3 is a block diagram of a computer device in one embodiment;
fig. 4 is a schematic diagram illustrating connections between a protocol server, JDBC specification interface, database, and a backend system according to an embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1 and 4, the invention discloses a JDBC specification-based command conversion method, including a protocol server 2, a JDBC specification interface group 1, a database 3, and a background system 4, where one end of the protocol server 2 is connected to the JDBC specification interface group 1, the other end of the protocol server 2 is connected to the database 3, and the background system 4 is further connected to the JDBC specification interface group 1 and the database 4, the method including:
s1, a background system acquires a calling interface called when an external decoding file is input into a protocol server and judges whether the calling interface is a Connection interface, wherein the Connection interface is contained in the JDBC standard interface group;
as described in the step S1, the background system 4 obtains the call interface called by the external decoded file input protocol server 3, and it can be understood that the call interface can be set by the user for inputting the external decoded file into the protocol server for decoding, and then the protocol server 3 determines whether the call interface called is a Connection interface, and the Connection interface is included in the JDBC specification interface group 1.
In addition, the background system 4 is generally a background server, and in addition, the background system 4 may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like, which is not limited in this respect.
S2, if yes, the protocol server judges whether the command object in the external decoding file is a Prepare object;
as described in the step S2, after the background system 4 determines that the call interface called when the external decoded file is input to the protocol server 2 is the Connection interface, at this time, the protocol server 2 determines whether the command object in the input external decoded file is a Prepare object, so as to implement the function of identifying the command object in the external decoded file.
S3, if yes, the protocol server creates a mirror image Premate object according to the Premate object through a preset Connect agent;
as described in step S3, when the background system 4 and the protocol server 2 determine that the call interface of the input external decoded file is the Connection interface and the command object of the external decoded file is the Prepare object, the protocol server 2 creates the mirror image Prepare object according to the external decoded file by using the preset Connection agent, and continues the next operation by using the mirror image Prepare object, thereby implementing the function of archiving and backing up the main file (i.e., the external decoded file).
S4, inputting the mirror image Premate object into the database, and setting secondary parameters of the mirror image Premate object when the database calls the mirror image Premate object, so as to generate a first conversion result set;
as described in step S4, the protocol server 2 inputs the mirror image preparation object into the database 3, and performs secondary parameter setting on the mirror image preparation object when the database 3 calls the mirror image preparation object, thereby completing the call processing on the mirror image preparation object and generating the first conversion result set.
And S5, the database sends the first conversion result set to the background system.
As described in step S5 above, the database 3 sends the first conversion result set to the background system 4, so as to complete the function of call conversion on the external decoded file whose call interface is the Connection interface and whose command object is the Prepare object.
It can be understood that, through the above steps, the background system can perform multi-layer screening on the obtained external decoding files according to the command object types of the external decoding files and the input calling interface, so that the external decoding files meeting the screening conditions are called and converted through the database and then output a conversion result set to the background system, and the external decoding files not meeting the screening conditions are automatically executed with other processing, thereby realizing the function of directly inputting the external decoding files into the database for calling and executing without pre-processing the external decoding files, and outputting the conversion results.
According to the method, the external decoding files are classified and then are processed respectively according to the type of the calling interface and the type of the command object, the external decoding files can be directly input into the database through the JDBC standard interface for calling and analyzing without being subjected to early operation, the problem that in the prior art, when the external decoding files need to be input into the database through the JDBC standard interface for calling and executing, the external decoding files need to be modified in advance, the number of the modified files is increased when the input external decoding files are too many, and the decoding efficiency is reduced is solved, and the decoding efficiency of the external decoding files is improved.
In an embodiment, after the step S1, the method further includes:
s11, if yes, the protocol server judges whether a command object in the external decoding file is an SQL object, if yes, the protocol server creates a mirror image SQL object according to the SQL object through a preset Connect agent, the protocol server inputs the mirror image SQL object into the database for calling and executing, and therefore a second conversion result set is generated, and the database sends the second conversion result set to a background system.
As described in the foregoing embodiment, after the background system 4 determines that the call interface called when the external decoded file is input into the protocol server 2 is the Connection interface, at this time, the protocol server 2 determines whether the command object in the input external decoded file is an SQL object, if so, the protocol server 2 creates the mirror image SQL object according to the external decoded file by using a preset Connection agent, and continues the next operation by using the mirror image SQL object, thereby implementing the function of archiving and backing up the main file (i.e., the external decoded file), then the protocol server 2 inputs the mirror image SQL object into the database 3 to perform call execution, thereby generating a second conversion result set, and finally the database 3 sends the second conversion result set to the background system 4, thereby completing the function of call conversion of the external decoded file whose call interface is the Connection interface and whose command object is an SQL object.
In an embodiment, after the step of obtaining, by the background system, a call interface called when the external decoded file is input to the protocol server, the method further includes:
s12, the background system judges whether the calling interface is a Driver interface, the Driver interface is contained in the JDBC standard interface group, if yes, the background system judges that a command object contained in an external decoding file input through the Driver interface is a Driver object, the database inputs the Driver object into a preset registry for registration, and therefore the registration information of the database is updated, the protocol server creates a mirror image Driver object according to the Driver object through a preset Connect agent, the protocol server inputs the mirror image Driver object into the updated database for calling and executing, and therefore a third conversion result set is generated, and the database sends the third conversion result set to the background system.
As described in the foregoing embodiment, when the background system 4 obtains the calling interface called by the 3 when the external decoded file is input into the protocol server, it can be understood that the calling interface can be set by the user, and is used for inputting the external decoded file into the protocol server for decoding, and then the protocol server 3 determines whether the called calling interface is a Driver interface, and in addition, the Driver interface is included in the JDBC specification interface group 1;
when the background system 4 determines that the called calling interface is a Driver interface, that is, the background system 4 simultaneously determines that a command object included in an external decoding file input via the Driver interface is a Driver object, and then the database 3 inputs the Driver object into a preset registry for registration, it can be understood that the preset registry is preset in the database 3 by a user and is used for updating parameters of the database 3, when the database 3 inputs the Driver object into the preset registry for registration, the database 3 updates according to the newly registered preset registry, thereby completing the calling setting of the database 3 for the Driver object, and then the protocol server 2 inputs the mirror image Driver object into the updated database 3 for calling execution, thereby generating a third conversion result set, and finally the database 3 sends the third conversion result set to the background system, thereby completing the function of calling and converting the external decoding file, of which uses the calling interface as the Driver interface and simultaneously commands the command object as the Driver object.
In an embodiment, after the step S1, the method further includes:
s13, the background system judges whether the calling interface is a stateful interface, the stateful interface is contained in the JDBC standard interface group, if yes, the protocol server analyzes stateful sentences contained in the external decoding file to generate an analysis sentence set, the protocol server judges whether analysis sentences matched with a preset dangerous sentence library exist in the analysis sentence set, if yes, the protocol server intercepts and captures the analysis sentences successfully matched with the analysis sentences and sends error information to the background system through the stateful interface.
As described in the foregoing embodiment, when the background system 4 obtains the external decoded file and inputs the external decoded file into the protocol server, 3 calls the calling interface, it can be understood that the calling interface can be set by the user, and is used for inputting the external decoded file into the protocol server for decoding, and then 3 determines whether the called calling interface is a Statement interface in the protocol server, and in addition, the Statement interface is included in the JDBC specification interface group 1;
and when the background system 4 determines that the called calling interface is a Statement interface, that is, the background system 4 simultaneously determines that a command object included in an external decoding file input through the Statement interface is a Statement object, then the protocol server 2 analyzes Statement statements included in the external decoding file to generate an analysis Statement set, at this time, the protocol server 2 determines whether an analysis Statement matched with a preset dangerous Statement library exists in the analysis Statement set, it can be understood that the preset dangerous Statement library includes a plurality of dangerous statements which cause a fault in calling a conversion process of the database 3, and when the analysis Statement included in the analysis Statement set is matched with a dangerous Statement in the preset dangerous Statement library, the protocol server 2 records the successfully matched analysis Statement and intercepts the successfully matched analysis Statement, and sends error information to the background system 4 through the Statement interface, thereby preventing the fault in calling the conversion process of the database 3.
In one embodiment, after the step of determining whether there is an analytic statement in the analytic statement set that matches a preset dangerous statement library, the protocol server further includes:
s15, if not, the protocol server inputs the analysis statement set into the database to be called and executed, so that a preliminary conversion result set is generated, the database judges whether the preliminary conversion result set contains analysis statements matched with a preset error code library, if yes, the database records the successfully matched analysis statements as common error codes and then sends the common error codes to a background system, if not, the protocol server creates a mirror image analysis statement set according to the analysis statement set through a preset Connect agent, the protocol server inputs the mirror image analysis statement set into the database to be called and executed, so that a fourth conversion result set is generated, and the database sends the fourth conversion result set to the background system.
As described in the above embodiment, when the protocol server 2 determines that there is no parsing statement matching the preset dangerous statement library in the parsing statement set, the protocol server 2 inputs the parsing statement set into the database 3 for calling and executing, thereby generating a preliminary conversion result set, and then the protocol server 2 determines again whether there is a parsing statement matching the preset dangerous statement library in the preliminary conversion result set, if so, the protocol server 2 determines that there is a dangerous statement that may cause a failure in the database 3 calling and converting process in the preliminary conversion result set, and at this time, the protocol server 2 marks the successfully matched parsing statement as a normal error code and then sends the normal error code to the background system 4, thereby preventing the normal error code from being called by the database 3;
in addition, when the protocol server 2 judges that there is no analytic statement matching with the preset dangerous statement library in the preliminary conversion result set, the preset Connect agent creates a mirror image analytic statement set according to the analytic statement set, and then the mirror image analytic statement set is input into the database 4 for calling and executing, so as to generate a fourth conversion result set; therefore, the function of calling and converting the external decoding file of which the calling interface is a State element interface, the command object is a State element object, and no error Statement exists in the internal analysis Statement and no error code exists is completed.
In an embodiment, the step S5 specifically includes:
s51, the database judges whether command objects in a to-be-processed conversion result set exist in a buffer area, the to-be-processed conversion result set comprises the first conversion result set, the second conversion result set, the third conversion result set and the fourth conversion result set, and if yes, the to-be-processed conversion result set is sent to the background system.
As described in the above embodiment, when the database 3 determines whether the command object in the to-be-processed conversion result set is in the buffer of the database 3, if so, the database 3 sends the to-be-processed conversion result set to the background system 4, thereby completing the transfer process of calling the external decoding file;
it can be understood that the processing conversion result set includes the first conversion result set, the second conversion result set, the third conversion result set, and the fourth conversion result set, so as to implement a function of sending all conversion results output by the database 3 to the background system 4 in the technical solution of the present invention.
In an embodiment, after the step of determining, by the database, whether the command object in the set of conversion results to be processed exists in the buffer, the method further includes:
s52, if not, the database checks whether the conversion result set to be processed exists in the buffer area again after a preset time period, if so, the conversion result set to be processed is sent to the background system, and if not, a preset data ending state code is obtained and sent to the background system.
As described in the above embodiment, when the database 3 determines that the command object in the to-be-processed conversion result set is not in the buffer area of the database 3, at this time, after a preset time period elapses, the database 3 checks again whether the to-be-processed conversion result set exists in the buffer area, so as to achieve a function of acquiring and determining whether the command object in the next acquired to-be-processed conversion result set is in the buffer area of the database 3, and if so, the database 3 sends the next acquired to-be-processed conversion result set to the background system 4, thereby achieving continuous call conversion of a plurality of external decoded files;
in addition, when the to-be-processed conversion result set does not exist in the buffer after the preset time period, the database 3 judges that the call conversion process of the external decoding file is finished, and acquires the preset data end state code and sends the preset data end state code to the background system 4, so that the call conversion process of the external decoding file is finished.
Referring to fig. 2, the present invention also discloses a JDBC specification-based command conversion system, including a protocol server 2, a JDBC specification interface group 1, a database 3, and a background system 4, where one end of the protocol server 2 is connected to the JDBC specification interface group 1, the other end of the protocol server 2 is connected to the database 3, and the background system 4 is further connected to the JDBC specification interface group 1 and the database 3, and the system includes:
an obtaining unit 10, configured to control a background system to obtain a call interface called when an external decoded file is input to a protocol server, and determine whether the call interface is a Connection interface, where the Connection interface is included in the JDBC specification interface group;
an object determining unit 20, configured to determine, if the command object in the external decoded file is a Prepare object, that is, the protocol server determines whether the command object in the external decoded file is a Prepare object;
a creating unit 30, configured to determine that, if the image is a mirror image, create, by the protocol server, a mirror image Prepare object according to the Prepare object through a preset Connect agent;
the calling unit 40 is configured to input the mirror image Prepare object into the database, and perform secondary parameter setting on the mirror image Prepare object when the database calls the mirror image Prepare object, so as to generate a first conversion result set;
a sending unit 50, configured to send, by the database, the first conversion result set to the background system.
The above units are for executing the above JDBC specification-based command conversion system, and are not described one by one here.
FIG. 3 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be a server including, but not limited to, a high performance computer and a cluster of high performance computers. As shown in fig. 3, the computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and also stores a computer program, and when the computer program is executed by a processor, the computer program can enable the processor to realize the employee state judgment method. The internal memory may also store a computer program, and when the computer program is executed by the processor, the computer program may cause the processor to execute the JDBC specification-based command conversion method.
In one embodiment, the client behavior recognition method provided by the present invention can be implemented in the form of a computer program that can be run on a computer device as shown in fig. 3. The memory of the computer equipment can store various program templates which form the automatic mail classifying and aggregating device. Such as: an acquisition unit 10, an object judgment unit 20, a creation unit 30, a calling unit 40, and a transmission unit 50.
A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
the background system judges whether a command type contained in a MYSQL protocol packet input by an ODBC standard interface is a query command, if so, the protocol server analyzes a statement contained in the MYSQL protocol packet to generate an analysis statement set, the protocol server judges whether the analysis statement contained in the analysis statement set is a MYSQL statement, if so, the protocol server converts the MYSQL statement into an interface conversion parameter set and then calls and executes a JDBC standard interface group in the database so as to convert the MYSQL statement into a conversion result set, and the database sends the conversion result set to the background system.
As can be seen from the foregoing embodiments, the maximum beneficial effect of the present invention is that a background system obtains a call interface that is called when an external decoded file is input to a protocol server, and determines whether the call interface is a Connection interface, where the Connection interface is included in the JDBC specification interface group, if so, the protocol server determines whether a command object in the external decoded file is a prefix object, and if so, the protocol server creates a mirror image prefix object according to the prefix object through a preset Connection proxy, inputs the mirror image prefix object into the database, and performs secondary parameter setting on the mirror image prefix object when the database calls the mirror image prefix object, thereby generating a first conversion result set, and the database sends the first conversion result set to the background system.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, databases or other media used in the embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), and double data rate.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is specific and detailed, but not to be understood as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A command conversion method based on JDBC specification is characterized by comprising a protocol server, a JDBC specification interface group, a database and a background system, wherein one end of the protocol server is connected with the JDBC specification interface group, the other end of the protocol server is connected with the database, the background system is also connected with the JDBC specification interface group and the database, and the method comprises the following steps:
a background system acquires a calling interface called when an external decoding file is input into a protocol server, and judges whether the calling interface is a Connection interface, wherein the Connection interface is contained in the JDBC standard interface group;
if yes, the protocol server judges whether the command object in the external decoding file is a Prepare object;
if so, the protocol server creates a mirror image Prepare object according to the Prepare object through a preset Connect agent;
inputting the mirror image Prepare object into the database, and setting secondary parameters of the mirror image Prepare object when the database calls the mirror image Prepare object, thereby generating a first conversion result set;
the database sends the first set of conversion results to the backend system.
2. The JDBC specification-based command conversion method of claim 1, wherein the background system acquires a call interface called when an external decoded file is input to a protocol server, and determines whether the call interface is a Connection interface, and wherein the Connection interface is included after the step of the JDBC specification interface group, the method further comprises:
if yes, the protocol server judges whether the command object in the external decoding file is an SQL object;
if so, the protocol server creates a mirror image SQL object according to the SQL object through a preset Connect agent;
the protocol server inputs the mirror SQL object into the database for calling and executing, thereby generating a second conversion result set;
the database sends the second set of conversion results to a backend system.
3. The JDBC specification-based command conversion method of claim 2, wherein after the step of the background system obtaining the call interface called when the external decoded file is input to the protocol server, the method further comprises:
the background system judges whether the calling interface is a Driver interface or not, wherein the Driver interface is contained in the JDBC standard interface group;
if yes, the background system judges that a command object contained in an external decoding file input through the Driver interface is a Driver object;
the database inputs the Driver object into a preset registry for registration, so that the registration information of the database is updated;
the protocol server creates a mirror Driver object according to the Driver object through a preset Connect proxy;
the protocol server inputs the mirror Driver object into the updated database for calling and executing, so as to generate a third conversion result set;
the database sends the third set of conversion results to a backend system.
4. The JDBC specification-based command conversion method of claim 3, wherein after the step of the background system obtaining the call interface called when the external decoded file is input to the protocol server, the method further comprises:
the background system judges whether the calling interface is a stateful interface, wherein the stateful interface is contained in the JDBC standard interface group;
if so, the protocol server analyzes the State Statement contained in the external decoding file to generate an analysis Statement set;
the protocol server judges whether an analytic statement matched with a preset dangerous statement library exists in the analytic statement set or not;
if yes, the protocol server intercepts the successfully matched analysis Statement and sends error information to a background system through the State element interface.
5. The JDBC specification-based command conversion method of claim 4, wherein after the step of determining whether there is a parsing sentence matching a preset dangerous sentence library in the parsing sentence set, the protocol server further comprises:
if not, the protocol server inputs the analysis statement set into the database for calling and executing, so as to generate a preliminary conversion result set;
the database judges whether the primary conversion result set contains an analysis statement matched with a preset error code library;
if yes, the database records the successfully matched analysis statement as a common error code and then sends the common error code to a background system;
if not, the protocol server establishes a mirror image analysis statement set according to the analysis statement set through a preset Connect agent;
the protocol server inputs the mirror image analysis statement set into the database for calling and executing, so as to generate a fourth conversion result set;
the database sends the fourth conversion result set to a background system.
6. The JDBC specification-based command conversion method of claim 5, wherein the step of sending the first conversion result set to the background system by the database specifically comprises:
the database judges whether command objects in a conversion result set to be processed exist in a buffer area or not, wherein the conversion result set to be processed comprises the first conversion result set, the second conversion result set, the third conversion result set and the fourth conversion result set;
and if so, sending the to-be-processed conversion result set to the background system.
7. The JDBC specification-based command conversion method of claim 6, wherein after the step of determining whether command objects in the conversion result set to be processed are present in the buffer by the database, further comprising:
if not, the database checks whether the conversion result set to be processed exists in the buffer area again after a preset time period;
if so, sending the to-be-processed conversion result set to the background system;
and if not, acquiring a preset data ending state code and sending the preset data ending state code to the background system.
8. A command conversion system based on ODBC specification is characterized by comprising a protocol server, a JDBC specification interface group, a database and a background system, wherein one end of the protocol server is connected with the JDBC specification interface group, the other end of the protocol server is connected with the database, the background system is also connected with the JDBC specification interface group and the database, and the system comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for controlling a background system to acquire a calling interface called when an external decoding file is input into a protocol server and judging whether the calling interface is a Connection interface, and the Connection interface is contained in the JDBC standard interface group;
the object judging unit is used for judging whether the command object in the external decoding file is a Prepare object or not if the command object is judged to be the Prepare object;
the creating unit is used for judging whether the image is a mirror image Premate object or not, if so, the protocol server creates the mirror image Premate object according to the Premate object through a preset Connect agent;
the calling unit is used for inputting the mirror image Prepare object into the database and carrying out secondary parameter setting on the mirror image Prepare object when the database calls the mirror image Prepare object, so that a first conversion result set is generated;
a sending unit, configured to send, by the database, the first conversion result set to the background system.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the JDBC specification based command conversion method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the JDBC specification based command conversion method according to any one of claims 1 to 7.
CN202211172072.5A 2022-09-26 2022-09-26 JDBC specification-based command conversion method, system, computer equipment and medium Pending CN115510137A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211172072.5A CN115510137A (en) 2022-09-26 2022-09-26 JDBC specification-based command conversion method, system, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211172072.5A CN115510137A (en) 2022-09-26 2022-09-26 JDBC specification-based command conversion method, system, computer equipment and medium

Publications (1)

Publication Number Publication Date
CN115510137A true CN115510137A (en) 2022-12-23

Family

ID=84505209

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211172072.5A Pending CN115510137A (en) 2022-09-26 2022-09-26 JDBC specification-based command conversion method, system, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN115510137A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501415A (en) * 2023-06-30 2023-07-28 英诺达(成都)电子科技有限公司 Command execution method and device, electronic equipment and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501415A (en) * 2023-06-30 2023-07-28 英诺达(成都)电子科技有限公司 Command execution method and device, electronic equipment and computer readable storage medium
CN116501415B (en) * 2023-06-30 2023-09-22 英诺达(成都)电子科技有限公司 Command execution method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN108170740B (en) Data migration method, system and computer readable storage medium
US20110022618A1 (en) Standardized database connectivity support for an event processing server in an embedded context
CN107038222B (en) Database cache implementation method and system
CN109361628B (en) Message assembling method and device, computer equipment and storage medium
US10261767B2 (en) Data integration job conversion
CN107229628B (en) Distributed database preprocessing method and device
WO2021022714A1 (en) Message processing method for cross-block chain node, device, apparatus and medium
CN112154420A (en) Automatic intelligent cloud service testing tool
CN115510137A (en) JDBC specification-based command conversion method, system, computer equipment and medium
CN114553953A (en) Event pushing method for JAVA intelligent contract of block chain
CN112953983A (en) SFTP transmission method and device
CN108363588B (en) Method for realizing interaction between web and native function, electronic device and readable storage medium
CN113992738A (en) Reverse proxy method, device, equipment and storage medium based on micro service gateway
CN108415998B (en) Application dependency relationship updating method, terminal, device and storage medium
CN115329170A (en) Webpage crawling method, device, equipment and storage medium
CN110502242B (en) Code automatic generation method and device, computer equipment and storage medium
CN115002099A (en) Man-machine interactive file processing method and device for realizing IA (Internet of things) based on RPA (resilient packet Access) and AI (Artificial Intelligence)
CN110554857B (en) JavaBean generation method, device and system and readable storage medium
US11055072B2 (en) Generation of data model from protocol buffer compiler generated java classes
CN112559344A (en) Remote mock testing method and system
CN111159142B (en) Data processing method and device
US20230023290A1 (en) Method for managing function based on engine, electronic device and medium
CN112883088A (en) Data processing method, device, equipment and storage medium
CN116226259A (en) Method for taking object model as unified standard output interface, electronic equipment and medium
CN110795197A (en) Method and device for internationalizing enumerated classes, computer 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