CN116414855A - Information processing method and device, electronic equipment and computer readable storage medium - Google Patents

Information processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116414855A
CN116414855A CN202310246415.6A CN202310246415A CN116414855A CN 116414855 A CN116414855 A CN 116414855A CN 202310246415 A CN202310246415 A CN 202310246415A CN 116414855 A CN116414855 A CN 116414855A
Authority
CN
China
Prior art keywords
structured query
query language
information processing
target
candidate
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
CN202310246415.6A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310246415.6A priority Critical patent/CN116414855A/en
Publication of CN116414855A publication Critical patent/CN116414855A/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/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The present disclosure provides an information processing method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the fields of computer technology, database technology, and finance. The information processing method comprises the following steps: in response to receiving the information processing instruction, acquiring information to be processed corresponding to a source database identifier according to the source database identifier in the information processing instruction, wherein the information processing instruction further comprises a target database identifier, the information to be processed comprises M original structured query sentences, and the M original structured query sentences respectively have N object types; determining preset conversion rules corresponding to N object types according to the target database identification and the information to be processed; and respectively processing the M original structured query sentences according to preset conversion rules corresponding to the N object types to obtain information processing results, wherein the information processing results comprise target structured query sentences corresponding to the M original structured query sentences.

Description

Information processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the fields of computer technology, database technology, and finance, and more particularly, to an information processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of computer technology, the conversion requirements of structured query language (Structured Query Language, SQL) are increasing.
The structured query language may be a database query and programming language that can be used to access data as well as query, update, and manage relational databases. The conversion of the structured query language may refer to converting the structured query language format applied to the source relational database to the structured query language format applied to the target relational database.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: the conversion of the structured query language is usually realized by a static text analysis mode, so that the conversion efficiency and accuracy of the structured query language cannot be ensured.
Disclosure of Invention
In view of this, the present disclosure provides an information processing method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to an aspect of the present disclosure, there is provided an information processing method including:
responding to a received information processing instruction, and acquiring information to be processed corresponding to a source database identifier according to the source database identifier in the information processing instruction, wherein the information processing instruction further comprises a target database identifier, the information to be processed comprises M original structured query sentences, the M original structured query sentences respectively have N object types, and M and N are positive integers;
determining preset conversion rules corresponding to the N object types according to the target database identification and the information to be processed; and
and respectively processing the M original structured query sentences according to preset conversion rules corresponding to the N object types to obtain information processing results, wherein the information processing results comprise target structured query sentences corresponding to the M original structured query sentences.
According to an embodiment of the present disclosure, the information processing instruction further includes a version library identifier and an index directory identifier corresponding to the version library identifier.
According to an embodiment of the present disclosure, the obtaining, in response to receiving an information processing instruction, to-be-processed information corresponding to a source database identifier in the information processing instruction includes:
Determining a target version library from at least one version library according to the version library identification;
determining a target index directory from at least one index directory corresponding to the target version library according to the index directory identification;
acquiring at least one candidate configuration file according to the target index directory;
determining P configuration files in the at least one candidate configuration file according to the source database identifier, wherein P is a positive integer;
for each of the P profiles described above,
analyzing the configuration file to obtain at least one original structured query language; and
and determining the M original structured query languages according to the at least one original structured query language corresponding to each configuration file.
According to an embodiment of the present disclosure, the determining, according to the target database identifier and the information to be processed, a preset conversion rule corresponding to each of the N object types includes:
determining at least one object name and a current object value corresponding to each of the at least one object name according to the M original structured query languages, wherein the object names have the object types;
Determining at least one candidate preset conversion rule corresponding to the target database identifier according to the target database identifier; and
for each of the at least one object names,
and determining a preset conversion rule corresponding to the object type in the at least one candidate preset conversion rule according to the object type corresponding to the object name.
According to an embodiment of the present disclosure, the above object types include at least one of: operators, keywords, and function statements.
According to an embodiment of the present disclosure, the preset conversion rule includes at least one of: a preset operator conversion rule corresponding to the operator, a preset keyword conversion rule corresponding to the keyword, and a preset keyword conversion rule corresponding to the function sentence.
According to an embodiment of the present disclosure, the processing the M original structured query sentences according to the preset conversion rules corresponding to the N object types, respectively, to obtain an information processing result includes:
for each of the M original structured query languages described above,
under the condition that the object type comprises the operator, converting the original structured query language according to the preset operator conversion rule to obtain a first candidate structured query language;
Under the condition that the object type comprises the keyword, converting the first candidate structured query language according to the preset keyword conversion rule to obtain a second candidate structured query language;
if the object type includes the function statement, converting the second candidate structured query language according to the preset function statement conversion rule to obtain the target structured query language;
and determining the information processing result according to the target structured query statement corresponding to each of the M original structured query statements.
According to an embodiment of the present disclosure, when the object type includes the operator, performing conversion processing on the original structured query language according to the preset operator conversion rule, and obtaining a first candidate structured query language includes:
converting the first operator in the original structured query language into a first function statement in response to detecting that the operator is the first operator;
converting the second operator in the original structured query language into a first keyword in response to detecting the operator as a second operator; and
And in response to detecting that the operator is a third operator, converting the third operator in the original structured query language into a second function statement.
According to an embodiment of the present disclosure, when the object type includes the keyword, performing conversion processing on the first candidate structured query language according to the preset keyword conversion rule, where obtaining a second candidate structured query language includes:
converting the second keyword in the first candidate structured query language to a third keyword in response to detecting the keyword as the second keyword;
converting the fourth keyword in the first candidate structured query language into a third functional statement in response to detecting the keyword as the fourth keyword; and
and converting the fifth keyword in the first candidate structured query language into a fourth functional statement in response to detecting that the keyword is the fifth keyword.
According to an embodiment of the present disclosure, when the object type includes the function statement, performing conversion processing on the second candidate structured query language according to the preset function statement conversion rule, to obtain the target structured query language includes:
In response to detecting that the function statement is a fifth function statement, changing the fifth function statement in the second candidate structured query language to a sixth function statement; and
and in response to detecting that the function statement is a seventh function statement, replacing the seventh function statement in the second candidate structured query language with an eighth function statement.
According to an embodiment of the present disclosure, the determining the information processing result according to the target structured query statement corresponding to each of the M original structured query statements includes:
determining grammar checking rules corresponding to the target database identifiers according to the target database identifiers;
for each of the M target structured query languages,
according to the grammar checking rule, carrying out grammar checking on the target structured query language to obtain a checking result;
outputting early warning information under the condition that the verification result represents that the target structured query language fails grammar verification;
under the condition that the verification result represents that the target structured query language passes grammar verification, determining the target structured query language as a candidate structured query language;
And performing splicing processing on at least one candidate structured query language to obtain the information processing result.
According to another aspect of the present disclosure, there is provided an information processing apparatus including:
the information processing device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for responding to a received information processing instruction and acquiring information to be processed corresponding to a source database identifier in the information processing instruction according to the source database identifier, the information processing instruction further comprises a target database identifier, the information to be processed comprises M original structured query sentences, the M original structured query languages respectively have N object types, and M and N are positive integers;
the determining module is used for determining preset conversion rules corresponding to the N object types according to the target database identification and the information to be processed; and
the processing module is used for respectively processing the M original structured query sentences according to preset conversion rules corresponding to the N object types to obtain information processing results, wherein the information processing results comprise target structured query sentences corresponding to the M original structured query sentences.
According to another aspect of the present disclosure, there is provided an electronic device including:
one or more processors;
a memory for storing one or more instructions,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement a method as described in the present disclosure.
According to another aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement a method as described in the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising computer executable instructions which, when executed, are adapted to carry out the method as described in the present disclosure.
According to the embodiment of the disclosure, since the preset conversion rules corresponding to the N object types are determined according to the target database identifier and the information to be processed, the N object types are obtained according to M original structured query languages, which are obtained according to the source database identifier in the information processing instruction, the technical problem that the conversion efficiency of the structured query language cannot be guaranteed in the related art is avoided, and since the automatic determination of the information to be processed and the preset conversion rules for processing the information to be processed is realized, the conversion efficiency of the structured query language is improved. On the basis, the M original structured query sentences are respectively processed according to the preset conversion rules corresponding to the N object types, so that the technical problem that the conversion accuracy of the structured query language cannot be guaranteed in the related art is avoided, and the conversion accuracy of the structured query language is improved because the preset conversion rules correspond to the object types.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments thereof with reference to the accompanying drawings in which:
FIG. 1 schematically illustrates a system architecture to which an information processing method may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of an information processing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates an example schematic diagram of a process of acquiring information to be processed corresponding to a source database identification in an information processing instruction in response to receiving the information processing instruction according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flowchart of a method for processing M original structured query sentences, respectively, according to preset conversion rules corresponding to N object types, to obtain information processing results, according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a flowchart of a method for processing M original structured query sentences, respectively, according to preset conversion rules corresponding to N object types, respectively, to obtain information processing results according to another embodiment of the present disclosure;
FIG. 6 schematically illustrates an example schematic diagram of an information processing process according to an embodiment of the disclosure;
Fig. 7 schematically shows a block diagram of an information processing apparatus according to an embodiment of the present disclosure; and
fig. 8 schematically illustrates a block diagram of an electronic device adapted to implement an information processing method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a formulation similar to at least one of "A, B or C, etc." is used, in general such a formulation should be interpreted in accordance with the ordinary understanding of one skilled in the art (e.g. "a system with at least one of A, B or C" would include but not be limited to systems with a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related personal information of the user all conform to the regulations of related laws and regulations, necessary security measures are taken, and the public order harmony is not violated.
In the technical scheme of the disclosure, the authorization or consent of the user is obtained before the personal information of the user is obtained or acquired.
In the related art, the conversion of the structured query language is typically implemented in a text parsing manner. However, since text parsing is generally static, explicit grammar errors cannot be found in time. In addition, since the extensible markup language (Extensible Markup Language, XML) format data cannot be well parsed, there is a problem in that tag confusion is likely to occur. In addition, in the relational database, since compatibility for a part of Oracle sentences is insufficient, conversion efficiency and accuracy between the Oracle sentences and Mysql sentences cannot be ensured.
In order to at least partially solve the technical problems in the related art, the present disclosure provides an information processing method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the computer technical field, the database technical field, and the financial field. The information processing method comprises the following steps: responding to the received information processing instruction, and acquiring information to be processed corresponding to a source database identifier according to the source database identifier in the information processing instruction, wherein the information processing instruction further comprises a target database identifier, the information to be processed comprises M original structured query sentences, the M original structured query languages respectively have N object types, and M and N are positive integers; determining preset conversion rules corresponding to N object types according to the target database identification and the information to be processed; and respectively processing the M original structured query sentences according to preset conversion rules corresponding to the N object types to obtain information processing results, wherein the information processing results comprise target structured query sentences corresponding to the M original structured query sentences.
It should be noted that the information processing method and apparatus provided in the embodiments of the present disclosure may be used in the fields of computer technology, database technology, and finance, for example, in the field of internet technology. The information processing method and the information processing device provided by the embodiment of the disclosure can also be used in any field except the field of computer technology, the field of database technology and the field of finance, for example, the field of information security. The application fields of the information processing method and the information processing device provided by the embodiment of the disclosure are not limited.
Fig. 1 schematically illustrates a system architecture to which an information processing method may be applied according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 through the network 104 using at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages, etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that, the information processing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the information processing apparatus provided by the embodiments of the present disclosure may be generally provided in the server 105. The information processing method provided by the embodiment of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105. Accordingly, the information processing apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105.
Alternatively, the information processing method provided by the embodiment of the present disclosure may also be performed by the first terminal apparatus 101, the second terminal apparatus 102, or the third terminal apparatus 103, or may also be performed by other terminal apparatuses other than the first terminal apparatus 101, the second terminal apparatus 102, or the third terminal apparatus 103. Accordingly, the information processing apparatus provided by the embodiments of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the sequence numbers of the respective operations in the following methods are merely representative of the operations for the purpose of description, and should not be construed as representing the order of execution of the respective operations. The method need not be performed in the exact order shown unless explicitly stated.
Fig. 2 schematically shows a flowchart of an information processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the information processing method includes operations S210 to S230.
In operation S210, in response to receiving the information processing instruction, obtaining information to be processed corresponding to the source database identifier according to the source database identifier in the information processing instruction, where the information processing instruction further includes a target database identifier, the information to be processed includes M original structured query sentences, each of the M original structured query sentences has N object types, and M and N are positive integers.
In operation S220, according to the target database identifier and the information to be processed, a preset conversion rule corresponding to each of the N object types is determined.
In operation S230, the M original structured query sentences are respectively processed according to the preset conversion rules corresponding to the N object types, so as to obtain an information processing result, where the information processing result includes target structured query sentences corresponding to the M original structured query sentences.
According to the embodiment of the disclosure, the code for generating the information processing instruction can be written in the script in advance, and the target terminal can run the script to generate the information processing instruction message in response to detecting the structural query language conversion operation performed by the target user by using the user terminal. The target terminal may send the information processing instruction packet to the server, so that the server processes the information processing instruction corresponding to the structured query language conversion operation according to the information processing instruction packet.
According to embodiments of the present disclosure, the information processing instruction message may include a source database identification and a target database identification. The source database identification may be used to indicate the source database. The target database identification may be used to indicate the target database. The source database and the target database may comprise relational databases, e.g., the source database or the target database may comprise one of: oracle, SQLServer, sybase, informix, access, DB2 and Mysql. Alternatively, the source database and the target database may also be non-relational databases, e.g., the source database or the target database may include one of the following: hbase, cassandra, simpleDB, couchDB, mongoDB or Redis, etc.
In accordance with an embodiment of the present disclosure, the structured query language conversion operation may include converting a first structured query language applied in the source database to a second structured query language applied in the target database. In an embodiment of the present disclosure, the first structured query language may not have M original structured query statements, and the second structured query language may be an information processing result.
According to an embodiment of the present disclosure, in response to receiving an information processing instruction, information to be processed corresponding to a source database identification in the information processing instruction may be obtained from a data source. The data source may include at least one of: local databases, cloud databases, and network resources. The information to be processed may include M original structured query statements. For example, a data interface may be invoked. And obtaining M original structured query sentences corresponding to the source database identifications from the data source by utilizing the data interface.
According to embodiments of the present disclosure, the structured query language pertains to database query and programming languages. The structured query language may include at least one of the following types: data query language (Data Query Language, DQL), data operation language (Data Manipulation Language, DML), transaction control language (Transaction Control Language, TCL), data control language (Data Control Language, DCL), data definition language (Data Language Definition, DDL), and pointer control language (Cursor Control Language, CCL).
According to an embodiment of the present disclosure, each of the M original structured query statements may have N object types. The object type may be used to characterize the field type in the original structured query statement. The object types may include at least one of: operators, keywords, and function statements.
According to the embodiment of the disclosure, after the information to be processed is obtained, a preset conversion rule corresponding to the object type may be determined for each of the N object types according to M original structured query sentences in the information to be processed. The preset conversion rule can be used for converting the field corresponding to the object type so as to meet the requirement of the structured query language conversion operation.
According to the embodiment of the disclosure, after determining the preset conversion rule corresponding to each of the N object types, for each of the N object types corresponding to each of the M original structured query sentences, sentence conversion processing may be performed on a field corresponding to the object type according to the preset conversion rule corresponding to the object type, so as to obtain an information processing result.
According to the embodiment of the disclosure, since the preset conversion rules corresponding to the N object types are determined according to the target database identifier and the information to be processed, the N object types are obtained according to M original structured query languages, which are obtained according to the source database identifier in the information processing instruction, the technical problem that the conversion efficiency of the structured query language cannot be guaranteed in the related art is avoided, and since the automatic determination of the information to be processed and the preset conversion rules for processing the information to be processed is realized, the conversion efficiency of the structured query language is improved. On the basis, the M original structured query sentences are respectively processed according to the preset conversion rules corresponding to the N object types, so that the technical problem that the conversion accuracy of the structured query language cannot be guaranteed in the related art is avoided, and the conversion accuracy of the structured query language is improved because the preset conversion rules correspond to the object types.
An information processing method 200 according to an embodiment of the present invention is further described below with reference to fig. 3 to 6.
According to an embodiment of the present disclosure, operation S210 may include the following operations.
And determining a target version library from the at least one version library according to the version library identification. And determining a target index directory from at least one index directory corresponding to the target version library according to the index directory identification. And acquiring at least one candidate configuration file according to the target index directory. And determining P configuration files in at least one candidate configuration file according to the source database identification, wherein P is a positive integer. And analyzing the configuration files aiming at each configuration file in the P configuration files to obtain at least one original structured query language. M original structured query languages are determined according to at least one original structured query language corresponding to each configuration file.
According to an embodiment of the present disclosure, the information processing instructions may further include a version library identification and an index directory identification corresponding to the version library identification.
According to embodiments of the present disclosure, a version library may refer to a software version control system. The version store may manage and control the version of each file according to the file content. For example, the version library may record each file modification result so that the user may roll back to the previous version or versions at any time in order to recover errors or analyze failures. The version store may include at least one of: myBatis, distributed version control systems (i.e., GIT), and Subversion (i.e., SVN).
According to embodiments of the present disclosure, the version store may include an index database, a program file repository, and a parallel maintenance program. The index database may include at least one index directory. The index directory may include candidate profile information corresponding to each of the at least one index directory. The candidate profile information may include at least one of: file name, file attribute, version number, and modification time. The program file repository may include candidate configuration files each corresponding to at least one index directory. The parallel maintenance program may be used to record the content of the file before and after modification to enable the user to rollback to the specified version at any time.
According to an embodiment of the present disclosure, after obtaining the information processing instruction, a target version library may be determined from at least one version library according to a version library identification in the information processing instruction. After determining the target version store, a target index directory may be determined from at least one index directory corresponding to the target version store based on the index directory identification in the information processing instructions. After the target index directory is obtained, the target index directory may be traversed in full according to the target index directory to obtain at least one candidate configuration file. For example, a MyBatis profile ending with a mapper.
According to the embodiment of the disclosure, since the structured query language is typically stored in the program file or the configuration file before compiling, after obtaining P configuration files, for each configuration file in the P configuration files, the configuration files may be parsed to obtain at least one original structured query language. For example, the configuration file may comprise an extensible markup language (Extensible Markup Language, XML) file, in which case the extensible markup language file may be parsed to obtain at least one original structured query language.
According to an embodiment of the present disclosure, since the configuration file is determined from the source database identifier among at least one candidate configuration file, the candidate configuration file is acquired from the target index directory, the target index directory is determined from at least one index directory corresponding to the target version library from the index directory identifier, and the target version library is determined from at least one version library from the version library identifier, thereby enabling the determination of the configuration file. On the basis, the original structured query language is obtained by analyzing the configuration file, so that the conversion efficiency of the structured query language is improved.
Fig. 3 schematically illustrates an example schematic diagram of a process of acquiring information to be processed corresponding to a source database identifier in an information processing instruction according to a source database identifier in response to receiving the information processing instruction according to an embodiment of the present disclosure.
As shown in fig. 3, in 300, information processing instructions 301 may include a version library identification 301_1, an index directory identification 301_2, and a source database identification 301_3. The at least one version store may include version store 302_1, version stores 302_2, …, version stores 302_s, …, version store 302_s. S may be an integer greater than or equal to 1, S e {1,2, …, (S-1), S }.
After receiving the information processing instruction 301, the target version library 303 may be determined from the version library 302_1, the version libraries 302_2, …, the version libraries 302_s, …, and the version library 302_s in accordance with the version library identification 301_1 in the information processing instruction 301.
After the target version library 303 is obtained, a target index directory 304 may be determined from at least one index directory corresponding to the target version library 303 according to the index directory identification 301_2 in the information processing instruction 301.
After obtaining the target index directory 304, at least one candidate configuration file 305 may be obtained from the target index directory 304. After obtaining the at least one candidate profile 305, P profiles 306 may be determined among the at least one candidate profile 305 based on the source database identification 301_3 in the information processing instructions 301.
After obtaining the P profiles 306, the profiles may be parsed for each of the P profiles 306 to obtain at least one original structured query language 307.
According to an embodiment of the present disclosure, operation S220 may include the following operations.
According to the M original structured query languages, at least one object name and a current object value corresponding to each of the at least one object name are determined, wherein the object names have object types. And determining at least one candidate preset conversion rule corresponding to the target database identifier according to the target database identifier. For each object name of the at least one object name, a preset conversion rule corresponding to the object type is determined in the at least one candidate preset conversion rule according to the object type corresponding to the object name.
According to the embodiment of the disclosure, taking the source database as an Oracle database as an example, the Oracle database can realize a self-increasing non-repeated Sequence through Sequence to serve as a primary key of a data table. Sequence may refer to an object used to generate contiguous integer data. For example, the consecutive self-increasing non-repeating integers may be continuously fetched using the select < sequoqnce name >. Nextval from dual statement.
Taking the target database as a Mysql database as an example, the Mysql database may generate a primary key through a Procedure using self-added attributes of the table structure itself, according to an embodiment of the present disclosure. Procedure may refer to a collection of structured query statements that may be understood as a function of a general programming language.
According to embodiments of the present disclosure, the Sequence call site in the Oracle database may be converted to a Procedure in the Mysql database in order to simulate the implementation of Sequence in the Mysql database.
According to an embodiment of the present disclosure, after obtaining the information to be processed, at least one object name and a current object value corresponding to each of the at least one object name may be determined according to M original structured query languages in the information to be processed. For example, for each of the at least one object name, a first candidate current object value corresponding to the object name may be determined. In the case where the first candidate current object value corresponding to the object name meets the target value, the first candidate current object value may be determined as the current object value. In the case where the first candidate current object value corresponding to the object name does not match the target value, a second candidate current object value may be determined from the first candidate current object value. The second candidate current object value is determined as the current object value.
According to the embodiment of the disclosure, since the preset conversion rule is determined in at least one candidate preset conversion rule according to the object type corresponding to the object name, the object name is determined according to the M original structured query languages, and at least one candidate preset conversion rule is determined according to the target database identifier, the preset conversion rule can be automatically determined according to the object type, thereby improving the conversion accuracy of the structured query languages.
According to an embodiment of the present disclosure, operation S230 may include the following operations.
And aiming at each original structured query language in the M original structured query languages, under the condition that the object type comprises an operator, converting the original structured query language according to a preset operator conversion rule to obtain a first candidate structured query language. And under the condition that the object type comprises keywords, converting the first candidate structured query language according to a preset keyword conversion rule to obtain a second candidate structured query language. And under the condition that the object type comprises a function statement, converting the second candidate structured query language according to a preset function statement conversion rule to obtain a target structured query language. And determining an information processing result according to the target structured query statement corresponding to each of the M original structured query statements.
According to an embodiment of the present disclosure, the object types may include at least one of: operators, keywords, and function statements.
According to an embodiment of the present disclosure, the preset conversion rule may include at least one of: a preset operator conversion rule corresponding to an operator, a preset keyword conversion rule corresponding to a keyword, and a preset keyword conversion rule corresponding to a function sentence.
According to the embodiment of the disclosure, since the information processing result is obtained by respectively processing the M original structured query sentences according to the preset conversion rules corresponding to the N object types, different points between the source database and the target database can be comprehensively considered, thereby improving the efficiency and accuracy of the structured query language conversion.
Fig. 4 schematically illustrates a flowchart of a method for processing M original structured query sentences according to preset conversion rules corresponding to N object types, respectively, to obtain information processing results according to an embodiment of the present disclosure.
As shown in fig. 4, operation S230 may include operations S431 to S432.
In operation S431, for each of the M original structured query languages, operation S410 may be performed.
In operation S410, the object type includes an operator?
If not, operation S4312 may be performed. In operation S4312, the original structured query language may be determined as the target structured query language.
If so, operation S4311 may be performed. In operation S4311, the original structured query language may be converted according to a preset operator conversion rule, to obtain a first candidate structured query language. After obtaining the first candidate structured query language, operation S420 may be performed.
In operation S420, the object type includes a keyword?
If not, operation S4314 may be performed. In operation S4314, the first candidate structured query language may be determined as the target structured query language.
If so, operation S4313 may be performed. In operation S4313, the first candidate structured query language may be converted according to a preset keyword conversion rule, to obtain a second candidate structured query language. After obtaining the second candidate structured query language, operation S430 may be performed.
In operation S430, the object type includes a function statement?
If not, operation S4316 may be performed. In operation S4316, the second candidate structured query language may be determined as the target structured query language.
If so, operation S4315 may be performed. In operation S4315, the second candidate structured query language may be converted according to a preset function statement conversion rule, to obtain a target structured query language.
After obtaining the target structured query language, operation S432 may be performed.
In operation S432, an information processing result may be determined according to a target structured query statement corresponding to each of the M original structured query statements.
According to an embodiment of the present disclosure, the following operations may be included in operation S4311.
In response to detecting that the operator is a first operator, converting the first operator in the original structured query language into a first function statement. In response to detecting the operator as the second operator, converting the second operator in the original structured query language to the first keyword. In response to detecting the operator as the third operator, converting the third operator in the original structured query language into a second function statement.
According to an embodiment of the present disclosure, in the case where the source database is an Oracle database and the target database is a Mysql database, the first operator, the first function statement, the second operator, the first keyword, the third operator, and the second function statement may be set according to actual service requirements, which is not limited herein.
For example, the first operator may be "||" and the first function statement may be "concat", in which case "|" in the original structured query language may be converted to "concat" in response to detecting that the operator is "|", whereby the splice string may be supported in both databases.
Alternatively, the second operator may be "(+)", the first keyword may be "left join", in which case "(+)" in the original structured query language may be converted to "left join" in response to detecting the operator as "(+)", whereby the outer join may be supported in both databases.
Alternatively, the third operator may be "+" or "-" and the second function statement may be "date_add" or "date_diff", in which case "+" or "-" in the original structured query language may be converted to "date_add" or "date_diff" in response to detecting that the operator is "+" or "-" whereby a batch conversion of date calculations between the two databases may be achieved.
According to an embodiment of the present disclosure, operation S4313 may include the following operations.
In response to detecting the keyword as the second keyword, the second keyword in the first candidate structured query language is converted to a third keyword. In response to detecting the keyword as the fourth keyword, converting the fourth keyword in the first candidate structured query language to a third functional statement. In response to detecting the keyword as the fifth keyword, converting the fifth keyword in the first candidate structured query language to a fourth functional statement.
According to an embodiment of the present disclosure, in the case where the source database is an Oracle database and the target database is a Mysql database, the second keyword, the third keyword, the fourth keyword, the third function statement, the fifth keyword, and the fourth function statement may be set according to actual service requirements, which is not limited herein.
For example, the second keyword may be "pivot", and the third keyword may be "limit", in which case "pivot" in the first candidate structured query language may be converted to "limit" in response to detecting the keyword as "pivot", whereby restrictions on query results may be implemented in both databases.
Alternatively, the fourth keyword may be "sysdate", and the third function statement may be a "now () function", in which case in response to detecting that the keyword is "sysdate", the "sysdate" in the first candidate structured query language may be converted to a "now () function", whereby a batch conversion of the current system time readings between the two databases may be achieved.
Alternatively, the fifth keyword may be "to_date" or "to_char", and the fourth function statement may be "str_to_date" or "date_format", in which case "to_date" or "to_char" in the first candidate structured query language may be converted to "str_to_date" or "date_format" in response to detecting the keyword as "to_date" or "to_char", whereby a batch conversion of date and string types between the two databases may be achieved.
According to an embodiment of the present disclosure, operation S4315 may include the following operations.
In response to detecting that the function statement is a fifth function statement, the fifth function statement in the second candidate structured query language is replaced with a sixth function statement. In response to detecting that the function statement is a seventh function statement, the seventh function statement in the second candidate structured query language is replaced with an eighth function statement.
According to an embodiment of the present disclosure, in the case where the source database is an Oracle database and the target database is a Mysql database, the fifth function statement, the sixth function statement, the seventh function statement, and the eighth function statement may be set according to actual service requirements, which is not limited herein.
For example, the fifth function statement may be "< variable name > is null", and the sixth function statement may be "< variable name > is null or < variable name > =", in which case "< variable name > is null" in the second candidate structured query language may be exchanged for "< variable name > is null" in response to detecting that the function statement is "< variable name > is null".
For example, the seventh function statement may be "< variable name > is not null", and the eighth function statement may be "< variable name > is not null and < variable name > ]! = ", in this case, in response to detecting that the function statement is" < variable name > is not null ", the" < variable name > is not null "in the second candidate structured query language is replaced with" < variable name > is not null and < variable name > |! = ".
According to the embodiment of the disclosure, in the process of respectively processing M original structured query sentences according to preset conversion rules corresponding to N object types to obtain an information processing result, batch detection may also be performed on the M original structured query sentences to determine whether the original structured query sentences have aliases. In the event that it is determined that no aliases exist in the original structured query statement, the aliases may be randomly generated.
According to an embodiment of the present disclosure, operation S432 may include the following operations.
And determining grammar checking rules corresponding to the target database identification according to the target database identification. And aiming at each target structured query language in the M target structured query languages, carrying out grammar verification on the target structured query language according to grammar verification rules to obtain a verification result. And outputting early warning information under the condition that the verification result represents that the target structured query language fails grammar verification. And determining the target structured query language as a candidate structured query language under the condition that the verification result represents that the target structured query language passes grammar verification. And performing splicing processing on at least one candidate structured query language to obtain an information processing result.
According to embodiments of the present disclosure, after obtaining the target structured query language, a grammar check rule corresponding to the target database identification may be determined from the target database identification. For example, in the case where the target database indicated by the target database identifier is a Mysql database, the target structured query language may be imported into the Mysql database driver, and the target structured query language may be validated based on the syntax checking rules of the Mysql database.
According to embodiments of the present disclosure, the verification results may be used to characterize whether the target structured query language is verified by grammar. And outputting early warning information under the condition that the verification result represents that the target structured query language fails grammar verification. For example, the target structured query language may be displayed and marked that manual intervention is required.
In accordance with an embodiment of the present disclosure, in the event that the verification result characterizes that the target structured query language is verified by grammar, the target structured query language may be determined as a candidate structured query language. And splicing at least one candidate structured query language to obtain an information processing result. The information processing result may be, for example, myBatis configuration file.
According to an embodiment of the present disclosure, after an information processing result is obtained, a global variable db_type may be injected to the information processing result. The database is configured based on the global variable db_type so as to automatically identify the type of the database which is currently connected in the process of calling the target structured query language by MyBatis, thereby realizing emergency switching.
According to the embodiment of the disclosure, since the early warning information is output under the condition that the verification result represents that the target structured query language fails the grammar verification, the timely early warning for the grammar problem is realized. In addition, the information processing result is obtained by splicing the verification result representing the target structured query language under the condition of grammar verification, so that the switching between the source database and the target database is realized, the operation and maintenance cost is reduced, and the information processing efficiency is further improved.
Fig. 5 schematically illustrates a flowchart of a method for processing M original structured query sentences according to preset conversion rules corresponding to N object types, respectively, to obtain information processing results according to another embodiment of the present disclosure.
As shown in fig. 5, operation S230 may include operations S531 to S533.
In operation S531, operations S510, S520, and S530 may be performed in parallel for each of the M original structured query languages.
In operation S510, the object type includes an operator?
If so, operation S5311 may be performed. In operation S5311, according to a preset operator conversion rule, and converting the original structured query language to obtain a third candidate structured query language. If not, the flow may end.
In operation S520, the object type includes a keyword?
If so, operation S5312 may be performed. In operation S5312, the conversion process is performed on the original candidate structured query language according to the preset keyword conversion rule, so as to obtain a fourth candidate structured query language. If not, the flow may end.
In operation S530, the object type includes a function statement?
If so, operation S5313 may be performed. In operation S5313, the conversion process is performed on the original candidate structured query language according to the preset function statement conversion rule, so as to obtain a fifth structured query language. If not, the flow may end.
After obtaining at least one of the third candidate structured query language, the fourth candidate structured query language, and the fifth structured query language, operation S532 may be performed.
In operation S532, a target structured query language is determined from at least one of the third candidate structured query language, the fourth candidate structured query language, and the fifth structured query language corresponding to each of the M original structured query sentences. After obtaining the target structured query language, operation S533 may be performed.
In operation S533, an information processing result is determined according to the target structured query statement corresponding to each of the M original structured query statements.
Fig. 6 schematically illustrates an example schematic diagram of a process of determining information processing results according to target structured query statements corresponding to each of M original structured query statements, according to an embodiment of the disclosure.
As shown in fig. 6, at 600, after obtaining the target structured query statement, a grammar check rule 602 corresponding to the target database identification 601 may be determined from the target database identification 601.
For each target structured query language in the M target structured query languages, grammar checking may be performed on the target structured query language according to the grammar checking rule 602, to obtain a checking result 603. After the verification result 603 is obtained, operation S610 may be performed.
In operation S610, the verification result characterizes that the target structured query language is verified by grammar?
If not, the early warning information 604 may be output.
If so, the target structured query language may be determined to be a candidate structured query language 605. At least one candidate structured query language 605 may be stitched to obtain information processing results 606.
The above is only an exemplary embodiment, but is not limited thereto, and other information processing methods known in the art may be included as long as the efficiency and accuracy of the structured query language conversion can be improved.
Fig. 7 schematically shows a block diagram of an information processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 7, the information processing apparatus 700 may include an acquisition module 710, a determination module 720, and a processing module 730.
The obtaining module 710 is configured to obtain, in response to receiving the information processing instruction, to-be-processed information corresponding to the source database identifier according to the source database identifier in the information processing instruction, where the information processing instruction further includes the target database identifier, the to-be-processed information includes M original structured query sentences, the M original structured query sentences each have N object types, and M and N are positive integers.
The determining module 720 is configured to determine preset conversion rules corresponding to the N object types according to the target database identifier and the information to be processed.
And the processing module 730 is configured to process the M original structured query sentences according to preset conversion rules corresponding to the N object types, respectively, to obtain an information processing result, where the information processing result includes target structured query sentences corresponding to the M original structured query sentences.
According to an embodiment of the present disclosure, the information processing instruction further includes a version library identification and an index directory identification corresponding to the version library identification.
According to an embodiment of the present disclosure, the acquisition module 710 may include a first determination sub-module, a second determination sub-module, a first acquisition sub-module, a third determination sub-module, a first processing sub-module, and a fourth determination sub-module.
And the first determining submodule is used for determining a target version library from at least one version library according to the version library identification.
And the second determining submodule is used for determining a target index directory from at least one index directory corresponding to the target version library according to the index directory identification.
And the first acquisition sub-module is used for acquiring at least one candidate configuration file according to the target index directory.
And the third determining submodule is used for determining P configuration files in at least one candidate configuration file according to the source database identification, wherein P is a positive integer.
The first processing sub-module is used for analyzing the configuration files aiming at each configuration file in the P configuration files to obtain at least one original structured query language.
And the fourth determining submodule is used for determining M original structured query languages according to at least one original structured query language corresponding to each configuration file.
According to an embodiment of the present disclosure, the determination module 720 may include a fifth determination sub-module, a sixth determination sub-module, and a seventh determination sub-module.
And a fifth determining submodule, configured to determine at least one object name and a current object value corresponding to each of the at least one object name according to the M original structured query languages, where the object name has an object type.
And the sixth determining submodule is used for determining at least one candidate preset conversion rule corresponding to the target database identifier according to the target database identifier.
A seventh determining sub-module, configured to determine, for each object name in the at least one object name, a preset conversion rule corresponding to the object type among the at least one candidate preset conversion rule according to the object type corresponding to the object name.
According to an embodiment of the present disclosure, the object types include at least one of: operators, keywords, and function statements.
According to an embodiment of the present disclosure, the preset conversion rule includes at least one of: a preset operator conversion rule corresponding to an operator, a preset keyword conversion rule corresponding to a keyword, and a preset keyword conversion rule corresponding to a function sentence.
According to an embodiment of the present disclosure, the processing module 730 may include a second processing sub-module, a third processing sub-module, a fourth processing sub-module, and an eighth determination sub-module for each of the M original structured query languages.
And the second processing sub-module is used for carrying out conversion processing on the original structured query language according to a preset operator conversion rule under the condition that the object type comprises the operator to obtain a first candidate structured query language.
And the third processing sub-module is used for carrying out conversion processing on the first candidate structured query language according to a preset keyword conversion rule under the condition that the object type comprises keywords, so as to obtain a second candidate structured query language.
And the fourth processing submodule is used for carrying out conversion processing on the second candidate structured query language according to a preset function statement conversion rule under the condition that the object type comprises the function statement to obtain the target structured query language.
And the eighth determining submodule is used for determining an information processing result according to the target structured query statement corresponding to each of the M original structured query statements.
According to an embodiment of the present disclosure, the second processing sub-module may include a first conversion unit, a second conversion unit, and a third conversion unit.
And the first conversion unit is used for converting the first operator in the original structured query language into a first function statement in response to detecting that the operator is the first operator.
And the second conversion unit is used for converting the second operator in the original structured query language into the first keyword in response to detecting that the operator is the second operator.
And a third conversion unit for converting the third operator in the original structured query language into a second function statement in response to detecting that the operator is the third operator.
According to an embodiment of the present disclosure, the third processing sub-module may include a fourth conversion unit, a fifth conversion unit, and a sixth conversion unit.
And a fourth conversion unit, configured to convert the second keyword in the first candidate structured query language into a third keyword in response to detecting that the keyword is the second keyword.
And a fifth conversion unit, configured to convert the fourth keyword in the first candidate structured query language into a third function statement in response to detecting that the keyword is the fourth keyword.
And a sixth conversion unit, configured to convert the fifth keyword in the first candidate structured query language into a fourth function statement in response to detecting that the keyword is the fifth keyword.
According to an embodiment of the present disclosure, the fourth processing sub-module may include a seventh conversion unit and an eighth conversion unit.
And a seventh converting unit, configured to convert the fifth function sentence in the second candidate structured query language into a sixth function sentence in response to detecting that the function sentence is the fifth function sentence.
And an eighth conversion unit configured to, in response to detecting that the function sentence is a seventh function sentence, convert the seventh function sentence in the second candidate structured query language to the eighth function sentence.
According to an embodiment of the present disclosure, the eighth determination submodule may include a first determination unit, a verification unit, an output unit, a second determination unit, and a processing unit.
And the first determining unit is used for determining grammar checking rules corresponding to the target database identification according to the target database identification.
The verification unit is used for carrying out grammar verification on the target structured query language according to grammar verification rules aiming at each target structured query language in the M target structured query languages to obtain a verification result.
And the output unit is used for outputting early warning information under the condition that the verification result represents that the target structured query language fails grammar verification.
And the second determining unit is used for determining the target structured query language as a candidate structured query language under the condition that the verification result represents that the target structured query language passes grammar verification.
And the processing unit is used for performing splicing processing on at least one candidate structured query language to obtain an information processing result.
Any number of modules, sub-modules, units, sub-units, or at least some of the functionality of any number of the sub-units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or in any other reasonable manner of hardware or firmware that integrates or encapsulates the circuit, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
For example, any of the acquisition module 710, the determination module 720, and the processing module 730 may be combined in one module/unit/sub-unit or any of the modules/units/sub-units may be split into multiple modules/units/sub-units. Alternatively, at least some of the functionality of one or more of these modules/units/sub-units may be combined with at least some of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to embodiments of the present disclosure, at least one of the acquisition module 710, the determination module 720, and the processing module 730 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or in hardware or firmware, such as any other reasonable manner of integrating or packaging the circuitry, or in any one of or a suitable combination of any of three implementations of software, hardware, and firmware. Alternatively, at least one of the acquisition module 710, the determination module 720 and the processing module 730 may be at least partially implemented as a computer program module, which when executed may perform the respective functions.
It should be noted that, in the embodiment of the present disclosure, the information processing apparatus portion corresponds to the information processing method portion in the embodiment of the present disclosure, and the description of the information processing apparatus portion specifically refers to the information processing method portion, which is not described herein.
Fig. 8 schematically illustrates a block diagram of an electronic device adapted to implement an information processing method according to an embodiment of the disclosure. The electronic device shown in fig. 8 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 8, a computer electronic device 800 according to an embodiment of the present disclosure includes a processor 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 809 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 801 may also include on-board memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the disclosure.
In the RAM 803, various programs and data required for the operation of the electronic device 800 are stored. The processor 801, the ROM802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM802 and/or the RAM 803. Note that the program may be stored in one or more memories other than the ROM802 and the RAM 803. The processor 801 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 800 may also include an input/output (I/O) interface 805, the input/output (I/O) interface 805 also being connected to the bus 804. The electronic device 800 may also include one or more of the following components connected to the I/O interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to the I/O interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 801. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 802 and/or RAM 803 and/or one or more memories other than ROM 802 and RAM 803 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program comprising program code for performing the methods provided by the embodiments of the present disclosure, the program code for causing an electronic device to implement the information processing methods provided by the embodiments of the present disclosure when the computer program product is run on the electronic device.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 801. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, and/or from a removable medium 811 via a communication portion 809. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (12)

1. An information processing method, comprising:
responding to a received information processing instruction, and acquiring information to be processed corresponding to a source database identifier according to the source database identifier in the information processing instruction, wherein the information processing instruction further comprises a target database identifier, the information to be processed comprises M original structured query sentences, the M original structured query sentences respectively have N object types, and M and N are positive integers;
determining preset conversion rules corresponding to the N object types according to the target database identification and the information to be processed; and
And respectively processing the M original structured query sentences according to preset conversion rules corresponding to the N object types to obtain information processing results, wherein the information processing results comprise target structured query sentences corresponding to the M original structured query sentences.
2. The method of claim 1, wherein the information processing instructions further comprise a version library identification and an index directory identification corresponding to the version library identification;
the responding to the received information processing instruction, according to the source database identification in the information processing instruction, the obtaining the information to be processed corresponding to the source database identification comprises the following steps:
determining a target version library from at least one version library according to the version library identification;
determining a target index directory from at least one index directory corresponding to the target version library according to the index directory identification;
acquiring at least one candidate configuration file according to the target index directory;
determining P configuration files in the at least one candidate configuration file according to the source database identification, wherein P is a positive integer;
for each of the P profiles,
Analyzing the configuration file to obtain at least one original structured query language; and
and determining the M original structured query languages according to the at least one original structured query language corresponding to each configuration file.
3. The method of claim 1, wherein the determining, according to the target database identifier and the information to be processed, a preset conversion rule corresponding to each of the N object types includes:
determining at least one object name and a current object value corresponding to each of the at least one object name according to the M original structured query languages, wherein the object names have the object types;
determining at least one candidate preset conversion rule corresponding to the target database identifier according to the target database identifier; and
for each of the at least one object names,
and determining a preset conversion rule corresponding to the object type in the at least one candidate preset conversion rule according to the object type corresponding to the object name.
4. A method according to any one of claims 1 to 3, wherein the object type comprises at least one of: operators, keywords, and function statements;
Wherein the preset conversion rule comprises at least one of the following: a preset operator conversion rule corresponding to the operator, a preset keyword conversion rule corresponding to the keyword, and a preset keyword conversion rule corresponding to the function statement;
the M original structured query sentences are respectively processed according to preset conversion rules corresponding to the N object types, and the information processing results are obtained and include:
for each of the M original structured query languages,
under the condition that the object type comprises the operator, converting the original structured query language according to the preset operator conversion rule to obtain a first candidate structured query language;
under the condition that the object type comprises the keyword, converting the first candidate structured query language according to the preset keyword conversion rule to obtain a second candidate structured query language;
under the condition that the object type comprises the function statement, converting the second candidate structured query language according to the preset function statement conversion rule to obtain the target structured query language;
And determining the information processing result according to the target structured query statement corresponding to each of the M original structured query statements.
5. The method of claim 4, wherein, in the case that the object type includes the operator, performing conversion processing on the original structured query language according to the preset operator conversion rule, to obtain a first candidate structured query language includes:
in response to detecting the operator as a first operator, converting the first operator in the original structured query language into a first function statement;
converting the second operator in the original structured query language to a first keyword in response to detecting the operator as a second operator; and
in response to detecting that the operator is a third operator, the third operator in the original structured query language is converted into a second function statement.
6. The method of claim 4, wherein, in the case that the object type includes the keyword, performing conversion processing on the first candidate structured query language according to the preset keyword conversion rule, to obtain a second candidate structured query language includes:
Converting the second keyword in the first candidate structured query language to a third keyword in response to detecting the keyword as a second keyword;
converting the fourth keyword in the first candidate structured query language into a third functional statement in response to detecting the keyword as a fourth keyword; and
in response to detecting that the keyword is a fifth keyword, the fifth keyword in the first candidate structured query language is converted to a fourth functional statement.
7. The method according to claim 4, wherein, in the case that the object type includes the function statement, performing conversion processing on the second candidate structured query language according to the preset function statement conversion rule, to obtain the target structured query language includes:
in response to detecting that the function statement is a fifth function statement, changing the fifth function statement in the second candidate structured query language to a sixth function statement; and
in response to detecting that the function statement is a seventh function statement, the seventh function statement in the second candidate structured query language is replaced with an eighth function statement.
8. The method of claim 4, wherein the determining the information processing result according to the target structured query statement corresponding to each of the M original structured query statements comprises:
determining grammar checking rules corresponding to the target database identification according to the target database identification;
for each of the M target structured query languages,
according to the grammar checking rule, carrying out grammar checking on the target structured query language to obtain a checking result;
outputting early warning information under the condition that the verification result represents that the target structured query language fails grammar verification;
determining the target structured query language as a candidate structured query language under the condition that the verification result represents that the target structured query language passes grammar verification;
and performing splicing processing on at least one candidate structured query language to obtain the information processing result.
9. An information processing apparatus comprising:
the information processing device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for responding to a received information processing instruction and acquiring information to be processed corresponding to a source database identifier in the information processing instruction according to the source database identifier, the information processing instruction further comprises a target database identifier, the information to be processed comprises M original structured query sentences, the M original structured query languages respectively have N object types, and M and N are positive integers;
The determining module is used for determining preset conversion rules corresponding to the N object types according to the target database identification and the information to be processed; and
the processing module is used for respectively processing the M original structured query sentences according to preset conversion rules corresponding to the N object types to obtain information processing results, wherein the information processing results comprise target structured query sentences corresponding to the M original structured query sentences.
10. An electronic device, comprising:
one or more processors;
a memory for storing one or more instructions,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 9.
11. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement the method of any of claims 1 to 9.
12. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 9 when executed.
CN202310246415.6A 2023-03-10 2023-03-10 Information processing method and device, electronic equipment and computer readable storage medium Pending CN116414855A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310246415.6A CN116414855A (en) 2023-03-10 2023-03-10 Information processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310246415.6A CN116414855A (en) 2023-03-10 2023-03-10 Information processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116414855A true CN116414855A (en) 2023-07-11

Family

ID=87048978

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310246415.6A Pending CN116414855A (en) 2023-03-10 2023-03-10 Information processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116414855A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117556790A (en) * 2024-01-02 2024-02-13 四川大学华西医院 Medical information processing method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117556790A (en) * 2024-01-02 2024-02-13 四川大学华西医院 Medical information processing method, device, equipment and storage medium
CN117556790B (en) * 2024-01-02 2024-04-16 四川大学华西医院 Medical information processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10983789B2 (en) Systems and methods for automating and monitoring software development operations
CN115599386A (en) Code generation method, device, equipment and storage medium
CN116414855A (en) Information processing method and device, electronic equipment and computer readable storage medium
CN112650526B (en) Method, device, electronic equipment and medium for detecting version consistency
CN113962597A (en) Data analysis method and device, electronic equipment and storage medium
CN114281803A (en) Data migration method, device, equipment, medium and program product
CN108694172B (en) Information output method and device
US8607201B2 (en) Augmenting visualization of a call stack
CN116069725A (en) File migration method, device, apparatus, medium and program product
CN113419740A (en) Program data stream analysis method and device, electronic device and readable storage medium
CN113468342A (en) Data model construction method, device, equipment and medium based on knowledge graph
CN116382703B (en) Software package generation method, code development method and device, electronic equipment and medium
US10216817B2 (en) Creating XML data from a database
CN116401319B (en) Data synchronization method and device, electronic equipment and computer readable storage medium
CN114564934B (en) Software program version difference analysis method, device, equipment and storage medium
US11860871B2 (en) Continuous delivery of database queries for applications based on named and versioned parameterized database queries
US8832128B2 (en) Expression evaluation over multiple data models
US20240046214A1 (en) Systems and methods for facilitating modifications and updates to shared content
CN115421779A (en) Object storage method and device, electronic equipment and computer readable storage medium
CN117407414A (en) Method, device, equipment and medium for processing structured query statement
CN116775618A (en) Code processing method, service processing method, device, electronic equipment and medium
CN117667926A (en) Correction method and device for database table establishment statement, electronic equipment and medium
CN115600578A (en) Data blood relationship analysis method, apparatus, device, medium, and program product
CN117171121A (en) Data synchronization method, device, equipment and storage medium
CN116205603A (en) Project management method, device, electronic 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