Search

CN-116166684-B - Database script logic conversion system and method

CN116166684BCN 116166684 BCN116166684 BCN 116166684BCN-116166684-B

Abstract

The invention relates to a logical conversion system and a logical conversion method for a database script, belongs to the technical field of computer script compiling, and solves the problems of low script conversion efficiency and high error rate of the existing manual script. The system comprises a matching module, a database function building module, a database script splitting module and a database script converting module, wherein the matching module is used for respectively matching keywords in a plurality of source language databases with keywords in a target language database to determine different keywords inconsistent in matching, the database function building module is used for building a conversion function for converting the different keywords into corresponding keywords in the target language database, the database script splitting module is used for splitting a source language database script to be converted into a plurality of logic script segments according to the different keywords, the database script converting module is used for converting the different keywords in the source language database script to be converted by calling the conversion function, and the sequence of the logic script segments is adjusted to be combined to obtain the database script of the target language. The system can realize automatic conversion of database scripts among different source languages.

Inventors

  • WANG WENYU
  • HAN FUZHOU
  • JIANG FAN

Assignees

  • 远光软件股份有限公司

Dates

Publication Date
20260505
Application Date
20211124

Claims (8)

  1. 1. A database script logic conversion system, comprising: The matching module is used for respectively matching the keywords in the multiple source language databases with the keywords in the target language database and determining different keywords inconsistent in matching; The database function building module is used for building a conversion function for converting the difference keywords into corresponding keywords in the target language database; for the situation that keywords corresponding to the difference keywords in the source language database exist in the target source language database, the database function building module is used for building a first mapping relation between the difference keywords and the corresponding keywords in the target language database, setting a corresponding logic script segment sequence adjustment algorithm for the difference keywords, and further obtaining the first conversion function for converting the difference keywords; For the situation that no keyword corresponding to the difference keyword in the source language database exists in the target source language database, the database function establishing module is used for establishing a function script capable of realizing the same function with the difference keyword, establishing a second mapping relation between the difference keyword and the function script, setting a corresponding logic script segment sequence adjusting algorithm for the difference keyword, and further obtaining a second conversion function corresponding to the difference keyword; the database script splitting module is used for splitting the source language database script to be converted into a plurality of logic script segments according to the difference keywords; And the database script conversion module is used for converting the difference keywords in the source language database script to be converted by calling the conversion function, adjusting the sequence of the logic script segments and further merging to obtain the database script of the target language.
  2. 2. The database script logic conversion system of claim 1 wherein the database function creation module is further configured to configure a corresponding conversion priority for each difference keyword and a corresponding conversion function.
  3. 3. The database script logic conversion system of claim 2 wherein the difference keywords are in one-to-one correspondence with logic script segments; The database script splitting module is specifically configured to split the source language database script to be converted according to the difference keywords to obtain a logic script segment corresponding to each difference keyword, so that the source language database script to be converted is split to obtain a plurality of logic script segments.
  4. 4. The database script logic conversion system of claim 3, wherein the database script conversion module is specifically configured to: And for the situation that keywords corresponding to the difference keywords in the source language database exist in the target source language database, calling a corresponding first conversion function according to the association relation between the difference keywords and the first conversion function, converting the difference keywords through the first mapping relation, and adjusting the sequence of the logic script segments corresponding to the difference keywords according to a corresponding logic script segment sequence adjustment algorithm.
  5. 5. The database script logic conversion system of claim 4, wherein the database script conversion module is further configured to: And for the situation that the target source language database does not have the keywords corresponding to the difference keywords in the source language database, calling a corresponding second conversion function according to the association relation between the difference keywords and the second conversion function, calling a corresponding function script to replace the difference keywords through a second mapping relation, and adjusting the sequence of the logic script segments corresponding to the difference keywords according to a corresponding logic script segment sequence adjustment algorithm.
  6. 6. The database script logic conversion system of claim 5, wherein the database script conversion module is further configured to: and recombining and integrating each converted difference keyword and the corresponding logic script segment according to the priority order to obtain the database script of the target language.
  7. 7. A method of logical conversion of a database script applied to the system of any of claims 1-6, comprising: matching keywords in the multiple source language databases with keywords in the target language databases respectively, and determining different keywords inconsistent in matching; Establishing a conversion function for converting the difference keywords into corresponding keywords in a target language database; splitting the source language database script to be converted into a plurality of logic script segments according to the difference keywords; And converting the difference keywords in the database script of the source language to be converted by calling the conversion function, adjusting the sequence of a plurality of logic script segments, and merging to obtain the database script of the target language.
  8. 8. A storage medium storing a computer program, wherein execution of the computer program by a processor enables the database script logic conversion method of claim 7.

Description

Database script logic conversion system and method Technical Field The invention relates to the technical field of computer script compiling, in particular to a database script logic conversion system and a method. Background The traditional database function is managed by a developer through adjusting codes, and the formats of the database language codes of different versions of different database platforms or the same database are often different, so that logic conversion between two database scripts is needed manually according to understanding based on the two database scripts, and the two database scripts before and after conversion can run to realize the same function. In the prior art, the manual conversion is performed based on understanding of codes by manpower, so that the efficiency is low, the error rate is high, and the error correction cost is high. Disclosure of Invention In view of the above analysis, the present invention aims to provide a system and a method for logical conversion of database scripts, which are used for solving the problems of low logical conversion efficiency, high error rate and high error correction cost of manually performing logical conversion on two database language scripts in the prior art. In one aspect, the present invention provides a database script logic conversion system, comprising: The matching module is used for respectively matching the keywords in the multiple source language databases with the keywords in the target language database and determining different keywords inconsistent in matching; The database function building module is used for building a conversion function for converting the difference keywords into corresponding keywords in the target language database; the database script splitting module is used for splitting the source language database script to be converted into a plurality of logic script segments according to the difference keywords; And the database script conversion module is used for converting the difference keywords in the source language database script to be converted by calling the conversion function, adjusting the sequence of the logic script segments and further merging to obtain the database script of the target language. Further, the database function establishing module is further configured to configure a corresponding conversion priority for each difference keyword and a corresponding conversion function. Further, the difference keywords are in one-to-one correspondence with the logic script segments; The database script splitting module is specifically configured to split the source language database script to be converted according to the difference keywords to obtain a logic script segment corresponding to each difference keyword, so that the source language database script to be converted is split to obtain a plurality of logic script segments. Further, the conversion function is a functional script for realizing the conversion of the difference keywords; And for the situation that keywords corresponding to the difference keywords in the source language database exist in the target source language database, the database function building module is used for obtaining a first conversion function for converting the difference keywords by building a first mapping relation between the difference keywords and the corresponding keywords in the target language database and setting a corresponding logic script segment sequence adjustment algorithm for the difference keywords. Further, for the case that no keyword corresponding to the difference keyword in the source language database exists in the target source language database, the database function establishing module is configured to establish a function script capable of implementing the same function with the difference keyword, establish a second mapping relationship between the difference keyword and the function script, and set a corresponding logic script segment sequence adjustment algorithm for the difference keyword, so as to obtain a second conversion function corresponding to the difference keyword. Further, the database script conversion module is specifically configured to: And for the situation that keywords corresponding to the difference keywords in the source language database exist in the target source language database, calling a corresponding first conversion function according to the association relation between the difference keywords and the first conversion function, converting the difference keywords through the first mapping relation, and adjusting the sequence of the logic script segments corresponding to the difference keywords according to a corresponding logic script segment sequence adjustment algorithm. Further, the database script conversion module is further configured to: And for the situation that the target source language database does not have the keywords corresponding to the difference keywords in the source language databa