CN117992436A - Information system automatic transformation method and equipment based on different types of databases - Google Patents

Information system automatic transformation method and equipment based on different types of databases Download PDF

Info

Publication number
CN117992436A
CN117992436A CN202410402731.2A CN202410402731A CN117992436A CN 117992436 A CN117992436 A CN 117992436A CN 202410402731 A CN202410402731 A CN 202410402731A CN 117992436 A CN117992436 A CN 117992436A
Authority
CN
China
Prior art keywords
target
process object
source
stored
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410402731.2A
Other languages
Chinese (zh)
Other versions
CN117992436B (en
Inventor
曾焱
苗旭成
刘鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Jiuyou Database Co ltd
Original Assignee
Shenzhen Jiuyou Database Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jiuyou Database Co ltd filed Critical Shenzhen Jiuyou Database Co ltd
Priority to CN202410402731.2A priority Critical patent/CN117992436B/en
Publication of CN117992436A publication Critical patent/CN117992436A/en
Application granted granted Critical
Publication of CN117992436B publication Critical patent/CN117992436B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an automatic information system reconstruction method and equipment based on different types of databases, wherein the method comprises the steps of obtaining a reconstruction instruction and a source database and a target database indicated in the reconstruction instruction; acquiring a source grammar rule indicating the source database and acquiring a target grammar rule indicating the target database; traversing a non-stored process object of the source database, obtaining a target non-stored process object corresponding to the non-stored process object based on the source grammar rule and the target grammar rule, obtaining data of the target non-stored process object, and migrating the data of the target non-stored process object to the target database; traversing the stored process object of the source database, and converting the stored process object of the source database into a target stored process object of the target database based on the source grammar rule and the target grammar rule.

Description

Information system automatic transformation method and equipment based on different types of databases
Technical Field
The invention relates to the technical field of databases, in particular to an automatic information system reconstruction method and equipment based on different types of databases.
Background
In the existing database technology, under the condition that the information system bottom database needs to be modified, the manual data object migration, the data migration and the service system code modification are complicated, errors, omission and the like are easy to occur, and a large amount of manpower and material resources are needed. Therefore, the labor is required to spend a great deal of time for reconstruction and transformation, the use of an information system cannot be guaranteed, and the working efficiency is low.
Disclosure of Invention
In order to solve the existing technical problems, the embodiment of the invention provides an information system automatic transformation method and electronic equipment based on databases of different types, which can automatically transform an information system to be transformed and can improve the database transformation efficiency.
In a first aspect, an automatic information system reconstruction method based on different types of databases is provided, including: acquiring a transformation instruction and a source database and a target database indicated in the transformation instruction; acquiring a source grammar rule indicating the source database and acquiring a target grammar rule indicating the target database; responding to the transformation instruction, traversing the non-storage process object of the source database, obtaining a target non-storage process object corresponding to the non-storage process object based on the source grammar rule and the target grammar rule, obtaining data of the target non-storage process object, and migrating the data of the target non-storage process object to the target database; and responding to the transformation instruction, traversing the stored process object of the source database, and converting the stored process object of the source database into a target stored process object of the target database based on the source grammar rule and the target grammar rule.
In a second aspect, an electronic device is provided, including a memory and a processor, where the memory stores a computer program, where the computer program when executed by the processor causes the processor to execute the steps of an automatic modification method for an information system based on a database of a different type provided by an embodiment of the present application.
In the above embodiment, according to the source grammar rule and the target grammar rule, the data of each non-stored process object in the source database is migrated and converted first, and then the stored process object is migrated and converted, because the non-stored process object is the basic data of the database, only after the non-stored process object is successfully reformed, the success of the reformation of the stored process object can be ensured, so the application can automatically reform the database to be reformed, and the efficiency of the reformation of the database can be improved.
Drawings
FIG. 1 is a diagram of an application environment for an automatic information system modification method based on different types of databases in an embodiment;
FIG. 2 is a flow chart of a method for automatically retrofitting an information system based on different types of databases in one embodiment;
FIG. 3 is a schematic diagram of an information system automatic retrofit device based on different types of databases in an embodiment;
Fig. 4 is a schematic diagram of an electronic device in an embodiment.
Detailed Description
The technical scheme of the invention is further elaborated below by referring to the drawings in the specification and the specific embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the scope of the invention. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
In the following description, reference is made to the expression "some embodiments" which describe a subset of all possible embodiments, but it should be understood that "some embodiments" may be the same subset or a different subset of all possible embodiments and may be combined with each other without conflict.
Referring to fig. 1, an application environment diagram of an automatic information system modification method based on different types of databases in an embodiment is shown. The application environment map may include a business system 100, a source database system 200, an information system automatic retrofit system 300 (hereinafter referred to as retrofit system 300) based on different types of databases, and a target database system 400. The service system 100 is in data communication with the source database system 200, the service system 100 is a system for user use, and the source database system 200 and the target database system 400 are databases based on a database model to provide data support for the service system 100. The service system 100 provides various functions for users based on the data provided by the source database system 200 and the target database system 400, the service system 100 provides various functions for users based on the data provided by the source database system 200 before modification, and provides various functions for users based on the data provided by the target database system 400 after modification. The business system 100 requests data from the source database system 200 based on the functional usage of the user. The source database system 200 queries the data associated with the request according to the request and using a database query language. The transformation system 300 is in data communication with the source database system 200 and the target database system 400, and the transformation system 300 transforms the source database system 200 by using the information system automatic transformation method based on different types of databases in the embodiment of the application to obtain the target database system 400 so as to better serve the business system 100. The source database system 200 and the target database system 400 may be oracle database, db2 data block, SQL SERVER database, mySQL, etc., wherein the source database system 200 and the target database system 400 are different types of databases. The business system 100, the information system automatic retrofit system 300 based on different types of databases may refer to logically independent software, applets, and the like. The service system 100, the source database system 200, the transformation system 300 and the target database system 400 can be located in the same electronic device at the same time or with data, or can be located in different electronic devices respectively, so that the service system 100, the source database system 200, the transformation system 300 and the target database system 400 can be guaranteed to be capable of carrying out data communication. In some embodiments, the retrofit system 300 may be located in the source database system 200 or the target source database system 400 as a retrofit tool for the source database system 200 or the target source database system 400.
Referring to fig. 2, a flowchart of a method for automatically modifying an information system based on different types of databases according to an embodiment of the present application is shown. The automatic information system transformation method based on the databases of different types is applied to the electronic equipment and comprises the following steps:
s11, acquiring a transformation instruction and a source database and a target database indicated in the transformation instruction.
In this embodiment, the transformation instruction is used for the information of the source database to be transformed and the target database after transformation. The reform instruction includes reform parameters including, but not limited to, information of the source database, information of the target database. The information of the source database includes, but is not limited to, the database type, version, database address, account number and password of the database, source grammar rule and the like of the source database. Wherein the information of the target database includes, but is not limited to, a database type, version, database address, account number password of the database, target grammar rule, etc. of the target database. The source grammar rule indicates grammar rules of various objects of the source database, and the target grammar rule indicates grammar rules of various objects of the target database. Wherein the connection to the source database can be established by the database address of the source database and the connection to the target database can be established by the database address of the target database. Optionally, the source database and the target database may also be connected to each other. Wherein the target grammar rules may be the same or partially the same or completely different.
In some embodiments, the method for automatically modifying an information system based on different types of databases may provide a user interface, where a setting item associated with information of a source database is provided on the user interface, and the setting item may be one or more, for example, a database type selection drop-down box, a version input box, an input library address input box, and the like are provided, a setting operation of a user based on the setting item associated with the information of the source database is obtained through the user interface, and data corresponding to the obtained setting operation is used as a part of a modification instruction. The user interface upper page may be provided with configuration items associated with information of the target database, and the configuration items may be one or more, for example, a database type selection drop-down box, a version input box, an input library address input box, and the like, and the configuration operation of the user based on the configuration items associated with the information of the target database is acquired through the user interface, and data corresponding to the acquired configuration operation is used as a part of the transformation instruction.
S12, acquiring a source grammar rule indicating the source database and acquiring a target grammar rule indicating the target database.
In this embodiment, the source grammar rules include, but are not limited to, grammar rules for non-stored process objects, stored process grammar rules. Wherein the non-stored process objects include, but are not limited to: tables, indexes, views, triggers, sequences, functions, event schedulers, etc. For each non-stored process object to a respective grammar rule, then the grammar rule for each non-stored process object includes a plurality of grammars for creating or manipulating the non-stored process object, e.g., for a table object, the grammar rules for the table object include, but are not limited to: definition syntax of a table, syntax of creating a table, syntax of viewing a table definition, syntax of deleting a table, and the like.
The stored procedure object is similar to a subroutine or a function, is a set of pre-compiled query sentences on a database server, is stored in the database as an object, and can be called as a whole by client management tools, application programs and other stored procedures. One stored procedure object includes a variable declaration section, an execution section, and an exception handling section. For the execution portion and exception handling portion, expressions and/or control statements are included, and so forth. The stored procedure grammar rules include, but are not limited to, at least one of: variable declaration grammar, control statement grammar, expression grammar, grammar for creating a stored procedure object, grammar for deleting a stored procedure object, grammar for calling a stored procedure object, and the like. The control statement and the expression are all based on the non-stored process object, so that the conversion accuracy of the non-stored process object is ensured first, and the conversion of the subsequent stored process is correct.
In some embodiments, the source grammar rule of the source database and the target grammar rule of the target database may be input through a user interface, and then the input file may be acquired, or may be stored in a server corresponding to each other, and then the source grammar rule and the target grammar rule may be acquired from various servers corresponding to each other. The source grammar rules, e.g., the source database, are stored on a server in communication with the source database and the target grammar rules are stored on a server in communication with the target database. The source grammar rule and the target grammar rule can be stored in the electronic equipment in advance and can be directly read from the electronic equipment.
And S13, responding to the transformation instruction, traversing the non-stored process object of the source database, obtaining a target non-stored process object corresponding to the non-stored process object based on the source grammar rule and the target grammar rule, obtaining data of the target non-stored process object, and migrating the data of the target non-stored process object to the target database.
In this embodiment, for each non-stored process object in the source database, the grammar rule corresponding to each non-stored process object may be a plurality of grammars, so for one non-stored process object, the source grammar rule of the non-stored process object is compared with the corresponding target grammar rule in turn, for having the same grammar rule, the data corresponding to the same place is not required to be modified, and for the grammar rule at different points, the data at different points of the non-stored process object is required to be converted, so that the converted data accords with the corresponding target grammar rule.
Because different objects correspond to different type identifications, the non-stored process objects and the stored process objects can be distinguished according to the type identifications of the objects, and therefore the non-stored process objects of the source database are acquired according to the type identifications of the objects.
And S14, responding to the transformation instruction, traversing the stored process object of the source database, and converting the stored process object of the source database into a target stored process object of the target database based on the source grammar rule and the target grammar rule.
In this embodiment, for each stored procedure object in the source database, the grammar rule corresponding to each stored procedure object may be a plurality of grammar rules, so for one stored procedure object, the source stored procedure grammar rule of the stored procedure object is compared with the corresponding target stored procedure grammar rule in turn, for having the same grammar rule, the data corresponding to the same place is not required to be modified, and for the grammar rules at different points, the data at different points of the stored procedure object need to be converted, so that the converted data accords with the corresponding target stored procedure grammar rule. And then obtaining a target database based on the target non-stored process object and the target stored process object.
Because different objects correspond to different type identifications, non-stored process objects and stored process objects can be distinguished according to the type identifications of the objects, and therefore the stored process objects of the source database are acquired according to the type identifications of the objects.
In the above embodiment, according to the source grammar rule and the target grammar rule, the data of each non-stored process object in the source database is migrated and converted first, and then the stored process object is migrated and converted, because the non-stored process object is the basic data of the database, only after the non-stored process object is successfully reformed, the success of the reformation of the stored process object can be ensured, so the application can automatically reform the database to be reformed, and the efficiency of the reformation of the database can be improved.
In some embodiments, the traversing the non-stored process object of the source database and converting the non-stored process object of the source database to a target non-stored process object of the target database based on the source grammar rules and the target grammar rules comprises:
Judging whether source grammar rules and target grammar rules corresponding to the non-stored process objects are the same or not;
if the source grammar rule and the target grammar rule corresponding to the non-stored process object are the same, directly migrating the data of the non-stored process object into the target database to serve as the data of the target non-stored process object corresponding to the non-stored process object;
If the source grammar rule and the target grammar rule corresponding to the non-stored process object are different, converting the non-stored process object into the target non-stored process object so that the target non-stored process object accords with the target grammar rule, and converting the data of the non-stored process object to obtain the data of the target non-stored process object so that the data of the target non-stored process object accords with the target grammar rule.
For each non-stored process object, the steps are sequentially executed until all the non-stored process objects are traversed, for one non-stored process object, each source grammar rule of the non-stored process object is sequentially compared with each corresponding tagline rule, for the same grammar rule, the corresponding data at the same place can be not modified, and for grammar rules at different points, the data at different points of the non-stored process object are required to be converted, so that the converted data accords with the corresponding target grammar rule. For example, the non-stored procedure object is a table object, a table is defined as 300 rows and 300 columns in the source grammar rule, the stored data type is a float type, a table is defined as 300 rows and 300 columns in the target grammar rule, and the stored data type is an int type, so that the definition of the table is the same, the table can be not modified, but the stored data type is different, and the float type data needs to be converted into the int type data to meet the target grammar rule.
In the above embodiment, each non-stored process object is traversed in sequence, and each source grammar rule and each corresponding target grammar rule of the non-stored process object are compared, and data of the non-stored process object are converted into data conforming to the target grammar rule, so that the database to be modified is automatically modified, and the database modification efficiency can be improved.
In some embodiments, after converting the non-stored process object of the source database to a target non-stored process object of the target database, the method further comprises:
Acquiring first statistical information of data of the target non-stored process object and second statistical information of data of a non-stored process object corresponding to the target non-stored process object, wherein the statistical information comprises at least one of the following: column count, row count, numerical data, text length;
Comparing the first statistical information with the second statistical information, indicating that the conversion is wrong when the comparison of the first statistical information and the second statistical information is different, and analyzing the reason of the conversion error according to a source grammar rule and a target grammar rule corresponding to the data of the place where the conversion is wrong;
Generating a conversion report of a non-stored process object, wherein the conversion report of a non-stored process object comprises at least one of: non-stored process objects where conversion errors occur, where the error data is located, the reason for the conversion errors.
For any non-stored process object, after the conversion of the non-stored process object is completed, the data of the corresponding target non-stored process object needs to be checked to verify whether the converted data is correct, so that the first statistical information indicating the data of the target non-stored process object and the second statistical information indicating the data of the non-stored process object corresponding to the target non-stored process object need to be acquired, and when the comparison between the first statistical information and the second statistical information is different, the conversion is indicated to have errors. And analyzing and converting error reasons according to source grammar rules and target grammar rules corresponding to the positions of the error data, wherein the positions of the first statistical information and the second statistical information are different points of the error data. And report real conversion information at the conversion of the non-stored process object so as to be able to intuitively view the conversion result of the non-stored process object. Through the conversion report, maintenance personnel can directly judge the error position and the error reason, and the problem is rapidly solved, so that the efficiency of database transformation is improved.
In the above embodiment, the data of the target non-stored procedure object corresponding to the non-stored procedure object after completing the conversion is checked to determine whether the converted data is correct, determine the position of the error data and the reason of the conversion error, and visually display the conversion result of the non-stored procedure object through the conversion report, thereby improving the quick solution problem and improving the efficiency of database transformation.
In some embodiments, the source grammar rules comprise source stored procedure grammar rules, the target grammar rules comprise target stored procedure grammar rules, and the traversing the stored procedure object of the source database in response to the reform instruction and converting the stored procedure object of the source database into the target stored procedure object of the target database based on the source grammar rules and the target grammar rules comprises:
judging whether source storage process grammar rules and target storage process grammar rules corresponding to the storage process objects are the same or not;
if the source storage process grammar rule and the target storage process grammar rule corresponding to the storage process object are the same, directly transferring the storage process object into the target database to serve as a target storage process object corresponding to the storage process object;
If the source storage process grammar rule and the target storage process grammar rule corresponding to the storage process object are different, respectively acquiring variable declaration data in the storage process object according to the source storage process grammar rule, and generating variable declaration data of the target storage process object according to the variable declaration grammar in the target storage process grammar rule;
respectively acquiring control structure data in the storage process object according to a source storage process grammar rule, and generating control structure data of the target storage process object according to the control structure grammar in the target storage process grammar rule;
and respectively acquiring the expression data in the storage process object according to the source storage process grammar rule, and generating the expression data of the target storage process object according to the expression grammar in the target storage process grammar rule.
For each stored procedure object, the steps are sequentially executed to complete the conversion and migration of each stored procedure object, for one stored procedure object, the source stored procedure grammar rule of the stored procedure object is sequentially compared with the corresponding target stored procedure grammar rule, for the stored procedure object with the same grammar rule, the definition corresponding to the same place can be not modified, and for the grammar rule at different points, the definition at different points of the stored procedure object needs to be converted, so that the converted stored procedure object accords with the corresponding target stored procedure grammar rule.
In an alternative embodiment, the stored procedure object includes a variable declaration portion, an execution portion, and an exception handling portion. For the variable declaration portion, the grammar rules in different databases may be different, and it is necessary to convert variable declarations with different target stored procedure grammar rules in the source stored procedure grammar rules into compliance with the target stored procedure grammar rules. The execution part and the exception processing part comprise control sentences and/or expressions, so that the stored procedure object needs to be converted based on variable declaration grammar, control sentence grammar and expression grammar.
In the above embodiment, each stored procedure object is traversed in sequence, and each source stored procedure grammar rule of the stored procedure object is compared with each corresponding target stored procedure grammar rule, so that the stored procedure object is converted into a target stored procedure object conforming to the target grammar rule, and the database to be modified is automatically modified, and the database modification efficiency can be improved.
In some embodiments, after converting the stored procedure object of the source database to the target stored procedure object of the target database, the method further comprises:
Obtaining a stored procedure object whose conversion is unsuccessful and a corresponding conversion error, and generating a conversion report of the stored procedure object based on the conversion error occurring in the stored procedure object whose conversion is unsuccessful, wherein the conversion report of the stored procedure object includes at least one of the following: the stored procedure object whose conversion was unsuccessful, the unsupported grammar, and the classification display of conversion error data based on the grammar type in the stored procedure grammar rules.
The storage process can be understood as a set of pre-compiled query sentences with a certain function, so that input data corresponding to a storage process object to be detected can be obtained according to the input requirement of the storage process object to be detected, input into the storage process to be detected, output data are obtained, whether the output data are identical to target output data or not is judged, and if so, the conversion of the storage process object to be detected is successful; if the objects are different, the object conversion of the storage process to be detected is unsuccessful. When the output data is different from the target output data, the execution steps of the stored process object to be detected are analyzed step by step, the position of the conversion error is determined, and the conversion error reason is determined based on the source stored process rule and the target stored process rule corresponding to the data of the position of the conversion error. The unsupported grammar indicates grammar rules which cannot be converted in source grammar rules, namely, the grammar rules cannot be automatically converted.
In the above embodiment, the conversion result of the stored procedure object is verified to verify whether the converted stored procedure object is correct, determine the position where the conversion error is located and the reason of the conversion error, and visually display the conversion result of the stored procedure object through the conversion report, thereby improving the quick solution of the problem and improving the efficiency of database transformation.
In some embodiments, the method further comprises:
and converting the target storage process object without conversion errors into an anonymous block, and converting the anonymous block into an application program file.
A stored procedure is understood to be a collection of pre-compiled query statements with a certain functionality, an anonymous block being a block of code for performing infrequent or repetitive activities, allowing a programmer to define and execute code in a single session. The method comprises the steps of converting a stored process object into an anonymous block, packaging the anonymous block into an application program file, and converting the stored process object into a code of an application program for decoupling, so that the dependence of the application program on the characteristics of a database is reduced, and the application program can be connected with various databases.
In the above embodiment, the purpose of converting the stored procedure object into the code of the application program is to decouple, reduce the dependency of the application program on the characteristics of the database, and enable the application program to interface with multiple databases.
In some embodiments, the method further comprises:
acquiring a source code file of a service system connected with the source database;
the source code file is modified into a target source code file conforming to the target grammar rule.
The business system connected with the source database is a source code file edited based on the source grammar rule, so that the requirement of the target database is not met, and the business system needs to be connected with the target database, and the source code file corresponding to the business system is changed into a target source code file meeting the target grammar rule. The source code file of the business system is obtained based on parameters of the business system, wherein the parameters of the business system include, but are not limited to, a development language of the source code file, a path of the source code file, and a version of the source code file. And updating the non-stored procedure object in the source code file to a target non-stored procedure object corresponding to the non-stored procedure object, and updating the called stored procedure object to a target stored procedure object corresponding to the stored procedure. After the transformation of the source code file of each service system is completed, the corresponding target source code file can be verified to confirm whether the target source code file can realize the related function or not, and the conversion error of the service system with unsuccessful conversion can be obtained. In an alternative embodiment, input data of a target source code file is obtained, the input data is executed through the target source code file, corresponding output data is obtained, whether the output data is identical to expected output or not is determined, if the output data is identical to the expected output, the target source code file is successfully converted, if the output data is not identical to the expected output, the conversion of the target source code file is unsuccessful, each step in the target source code file is gradually executed, a position where a conversion error occurs is located, and a conversion error reason is determined based on a source grammar rule and a target grammar rule corresponding to the data of the position where the conversion error occurs. And generating a conversion report corresponding to the service system based on the conversion result of each service system. The service system correspondingly comprises at least one of the following: the source code file corresponding to the unsuccessful service system is converted, the wrong data position is converted, and the error reason is caused.
In the embodiment, the source code file of the service system connected with the source database is modified, so that the service system can be automatically connected with the target database and access data, and the database modification efficiency is improved.
In some embodiments, the method further comprises:
acquiring multiple types of verification query sentences, respectively executing each verification query sentence through the source database to obtain a source result corresponding to each verification query sentence, and executing through the target database to obtain a target result corresponding to each verification query sentence;
And comparing the source results corresponding to the various types of verification query sentences with the corresponding target results to generate an overall conversion report.
Optionally, the overall conversion report includes one or more of:
Classifying and displaying the conversion errors of each service system, and classifying and displaying each conversion error in each service system according to the error type;
Classifying and displaying conversion errors of the non-stored process objects;
Classifying and displaying the conversion errors of the stored process objects;
Classifying and displaying conversion errors corresponding to various verification query sentences;
classifying and displaying the difference data of each non-stored process object and the stored process object after migration;
And classifying and displaying conversion errors corresponding to various grammar rules.
The method comprises the steps of establishing a target database based on a converted target non-storage process object and a converted target storage process object, wherein the target database can be suitable for various types of query sentences, such as conditional query, range query, fuzzy query and the like, respectively obtaining a source result corresponding to each verification query sentence through a source database for each type of query sentence, and obtaining a target result corresponding to each verification query sentence through the target database, if the source result corresponding to each verification query sentence is the same as the corresponding target result, indicating that no error occurs for the query sentence, and if the source result corresponding to each verification query sentence is different from the corresponding target result, indicating that an error occurs for the query sentence. Different types of verification query statements may also be executed separately at each business system.
In the overall conversion report, the conversion errors are displayed in the angle of the service system, so that maintenance personnel can clearly and intuitively know the problems in the conversion of each service system, and the overall analysis and maintenance are convenient. And displaying the conversion errors by taking each non-stored process object as an angle, so that maintenance personnel can conveniently analyze the reasons of the errors caused by the conversion of the non-stored process objects. And displaying the conversion errors by taking each stored process object as an angle, so that maintenance personnel can analyze the reasons of the errors caused by the conversion of the stored process objects. And the conversion errors are displayed by taking the query statement types as angles, so that the types of query statements with more conversion errors in the target database can be analyzed conveniently, and main reasons can be positioned conveniently. The comparison data before and after the migration of each object is displayed in a classified mode, so that the change data before and after the migration can be observed intuitively, and the error position can be positioned timely when the conversion problem occurs. And the various grammar rules are taken as angles, the conversion errors are displayed, so that the grammar rule types with more conversion errors in the target database can be analyzed conveniently, and the main reasons can be positioned conveniently.
Referring to fig. 3, an embodiment of the present application provides an automatic information system reconstruction device based on different types of databases, including: the acquisition module 31 is used for acquiring a transformation instruction and a source database and a target database indicated in the transformation instruction; the obtaining module 31 is further configured to obtain a source grammar rule indicating the source database and obtain a target grammar rule indicating the target database; a transformation module 32, configured to traverse a non-stored procedure object of the source database in response to the transformation instruction, obtain a target non-stored procedure object corresponding to the non-stored procedure object based on the source grammar rule and the target grammar rule, obtain data of the target non-stored procedure object, and migrate the data of the target non-stored procedure object to the target database; the transformation module 32 is further configured to traverse the stored procedure object of the source database in response to the transformation instruction, and convert the stored procedure object of the source database into a target stored procedure object of the target database based on the source grammar rule and the target grammar rule.
Optionally, the retrofit module 32 is further configured to:
Judging whether source grammar rules and target grammar rules corresponding to the non-stored process objects are the same or not;
if the source grammar rule and the target grammar rule corresponding to the non-stored process object are the same, directly migrating the data of the non-stored process object into the target database to serve as the data of the target non-stored process object corresponding to the non-stored process object;
If the source grammar rule and the target grammar rule corresponding to the non-stored process object are different, converting the non-stored process object into the target non-stored process object so that the target non-stored process object accords with the target grammar rule, and converting the data of the non-stored process object to obtain the data of the target non-stored process object.
Optionally, the retrofit module 32 is further configured to:
Acquiring first statistical information of data of the target non-stored process object and second statistical information of data of a non-stored process object corresponding to the target non-stored process object, wherein the statistical information comprises at least one of the following: column count, row count, numerical data, text length;
Comparing the first statistical information with the second statistical information, indicating that the conversion is wrong when the comparison of the first statistical information and the second statistical information is different, and analyzing the reason of the conversion error according to a source grammar rule and a target grammar rule corresponding to the data of the place where the conversion is wrong;
Generating a conversion report of a non-stored process object, wherein the conversion report of a non-stored process object comprises at least one of: non-stored process objects where conversion errors occur, where the error data is located, the reason for the conversion errors.
Optionally, the retrofit module 32 is further configured to:
judging whether source storage process grammar rules and target storage process grammar rules corresponding to the storage process objects are the same or not;
if the source storage process grammar rule and the target storage process grammar rule corresponding to the storage process object are the same, directly transferring the storage process object into the target database to serve as a target storage process object corresponding to the storage process object;
If the source storage process grammar rule and the target storage process grammar rule corresponding to the storage process object are different, respectively acquiring variable declaration data in the storage process object according to the source storage process grammar rule, and generating variable declaration data of the target storage process object according to the variable declaration grammar in the target storage process grammar rule;
respectively acquiring control structure data in the storage process object according to a source storage process grammar rule, and generating control structure data of the target storage process object according to the control structure grammar in the target storage process grammar rule;
and respectively acquiring the expression data in the storage process object according to the source storage process grammar rule, and generating the expression data of the target storage process object according to the expression grammar in the target storage process grammar rule.
Optionally, the retrofit module 32 is further configured to:
Obtaining a stored procedure object whose conversion is unsuccessful and a corresponding conversion error, and generating a conversion report of the stored procedure object based on the conversion error occurring in the stored procedure object whose conversion is unsuccessful, wherein the conversion report of the stored procedure object includes at least one of the following: the stored procedure object whose conversion was unsuccessful, the unsupported grammar, and the classification display of conversion error data based on the grammar type in the stored procedure grammar rules.
Optionally, the retrofit module 32 is also used to
And converting the target storage process object without conversion errors into an anonymous block, and converting the anonymous block into an application program file.
Optionally, the retrofit module 32 is also used to
Acquiring a source code file of a service system connected with the source database;
the source code file is modified into a target source code file conforming to the target grammar rule.
Optionally, the retrofit module 32 is also used to
Acquiring multiple types of verification query sentences, respectively executing each verification query sentence through the source database to obtain a source result corresponding to each verification query sentence, and executing through the target database to obtain a target result corresponding to each verification query sentence;
And comparing the source results corresponding to the various types of verification query sentences with the corresponding target results to generate an overall conversion report.
Optionally, the overall conversion report includes one or more of:
Classifying and displaying the conversion errors of each service system, and classifying and displaying each conversion error in each service system according to the error type;
Classifying and displaying conversion errors of the non-stored process objects;
Classifying and displaying the conversion errors of the stored process objects;
Classifying and displaying conversion errors corresponding to various verification query sentences;
classifying and displaying the difference data of each non-stored process object and the stored process object after migration;
And classifying and displaying conversion errors corresponding to various grammar rules.
It will be appreciated by those skilled in the art that the configuration of the information system automatic modification apparatus based on the different types of databases in fig. 3 does not constitute a limitation of the information system automatic modification apparatus based on the different types of databases, and the respective modules may be implemented in whole or in data by software, hardware, and a combination thereof. The above modules may be embedded in hardware or independent of a controller in a computer device, or may be stored in software in a memory in the computer device, so that the controller may call and execute operations corresponding to the above modules. In other embodiments, more or fewer modules than shown may be included in an information system automation device based on a different type of database.
Referring to fig. 4, in another aspect of the embodiment of the present application, there is further provided an electronic device 500, including a memory 3011 and a processor 3012, where the memory 3011 stores a computer program, and the computer program when executed by the processor causes the processor 3012 to execute the steps of the method for automatically modifying an information system based on a database of a different type provided in any of the embodiments of the present application. Electronic device 500 may include a computing device (e.g., desktop computer, laptop computer, tablet computer, handheld computer, smart speaker, server, etc.), mobile phone (e.g., smart phone, wireless phone, etc.), wearable device (e.g., a pair of smart glasses or smart watch), or similar device, robotic device.
Wherein the information system automatic retrofit equipment based on different types of databases includes, but is not limited to: embedded equipment and electronic equipment.
Wherein the processor 3012 is a control center, various interfaces and lines are utilized to connect the various data of the overall computer device, perform various functions of the computer device and process the data by running or executing software programs and/or modules stored in the memory 3011, and invoking the data stored in the memory 3011. Optionally, the processor 3012 may include one or more processing cores; preferably, the processor 3012 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user pages, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 3012.
The memory 3011 may be used to store software programs and modules, and the processor 3012 executes various functional applications and data processing by executing the software programs and modules stored in the memory 3011. The memory 3011 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 3011 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 3011 may also include a memory controller to provide access to the memory 3011 by the processor 3012.
In another aspect of the embodiments of the present application, there is further provided a storage medium storing a computer program, where the computer program when executed by a processor causes the processor to execute the steps of the method for automatically modifying an information system based on a database of a different type provided in any one of the embodiments of the present application.
Those skilled in the art will appreciate that implementing all or some of the methods provided in the above embodiments may be accomplished by computer programs stored on a non-transitory computer readable storage medium, which when executed, may include the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. The scope of the invention is to be determined by the appended claims.

Claims (10)

1. An automatic information system reconstruction method based on different types of databases, which is characterized by comprising the following steps:
acquiring a transformation instruction and a source database and a target database indicated in the transformation instruction;
acquiring a source grammar rule indicating the source database and acquiring a target grammar rule indicating the target database;
responding to the transformation instruction, traversing the non-storage process object of the source database, obtaining a target non-storage process object corresponding to the non-storage process object based on the source grammar rule and the target grammar rule, obtaining data of the target non-storage process object, and migrating the data of the target non-storage process object to the target database;
and responding to the transformation instruction, traversing the stored process object of the source database, and converting the stored process object of the source database into a target stored process object of the target database based on the source grammar rule and the target grammar rule.
2. The method for automatically transforming information systems based on different types of databases according to claim 1, wherein traversing the non-stored process object of the source database in response to the transformation instruction, and obtaining a target non-stored process object corresponding to the non-stored process object based on the source grammar rule and the target grammar rule, and obtaining data of the target non-stored process object, comprises:
Judging whether source grammar rules and target grammar rules corresponding to the non-stored process objects are the same or not;
if the source grammar rule and the target grammar rule corresponding to the non-stored process object are the same, directly migrating the data of the non-stored process object into the target database to serve as the data of the target non-stored process object corresponding to the non-stored process object;
If the source grammar rule and the target grammar rule corresponding to the non-stored process object are different, converting the non-stored process object into the target non-stored process object so that the target non-stored process object accords with the target grammar rule, and converting the data of the non-stored process object to obtain the data of the target non-stored process object.
3. The method for automatically retrofitting an information system based on a different type of database according to claim 2, wherein after converting a non-stored process object of said source database to a target non-stored process object of said target database, said method further comprises:
Acquiring first statistical information of data of the target non-stored process object and second statistical information of data of a non-stored process object corresponding to the target non-stored process object, wherein the statistical information comprises at least one of the following: column count, row count, numerical data, text length;
Comparing the first statistical information with the second statistical information, indicating that the conversion is wrong when the comparison of the first statistical information and the second statistical information is different, and analyzing the reason of the conversion error according to a source grammar rule and a target grammar rule corresponding to the data of the place where the conversion is wrong;
Generating a conversion report of a non-stored process object, wherein the conversion report of a non-stored process object comprises at least one of: non-stored process objects where conversion errors occur, where the error data is located, the reason for the conversion errors.
4. The method of claim 1, wherein the source grammar rules comprise source stored procedure grammar rules and the target grammar rules comprise target stored procedure grammar rules, wherein traversing the stored procedure object of the source database in response to the reform instruction and converting the stored procedure object of the source database into the target stored procedure object of the target database based on the source grammar rules and the target grammar rules comprises:
judging whether source storage process grammar rules and target storage process grammar rules corresponding to the storage process objects are the same or not;
if the source storage process grammar rule and the target storage process grammar rule corresponding to the storage process object are the same, directly transferring the storage process object into the target database to serve as a target storage process object corresponding to the storage process object;
If the source storage process grammar rule and the target storage process grammar rule corresponding to the storage process object are different, respectively acquiring variable declaration data in the storage process object according to the source storage process grammar rule, and generating variable declaration data of the target storage process object according to the variable declaration grammar in the target storage process grammar rule;
respectively acquiring control structure data in the storage process object according to a source storage process grammar rule, and generating control structure data of the target storage process object according to the control structure grammar in the target storage process grammar rule;
and respectively acquiring the expression data in the storage process object according to the source storage process grammar rule, and generating the expression data of the target storage process object according to the expression grammar in the target storage process grammar rule.
5. The automated transformation method of information systems based on different types of databases according to claim 4, wherein after converting the stored procedure object of the source database to the target stored procedure object of the target database, the method further comprises:
Obtaining a stored procedure object whose conversion is unsuccessful and a corresponding conversion error, and generating a conversion report of the stored procedure object based on the conversion error occurring in the stored procedure object whose conversion is unsuccessful, wherein the conversion report of the stored procedure object includes at least one of the following: the stored procedure object whose conversion was unsuccessful, the unsupported grammar, and the classification display of conversion error data based on the grammar type in the stored procedure grammar rules.
6. The method for automatically retrofitting an information system based on a different type of database according to claim 5 and also comprising:
and converting the target storage process object without conversion errors into an anonymous block, and converting the anonymous block into an application program file.
7. The method for automatically retrofitting an information system based on a different type of database according to claim 1, said method further comprising:
acquiring a source code file of a service system connected with the source database;
the source code file is modified into a target source code file conforming to the target grammar rule.
8. The method for automatically retrofitting an information system based on a different type of database according to claim 1, said method further comprising:
acquiring multiple types of verification query sentences, respectively executing each verification query sentence through the source database to obtain a source result corresponding to each verification query sentence, and executing through the target database to obtain a target result corresponding to each verification query sentence;
And comparing the source results corresponding to the various types of verification query sentences with the corresponding target results to generate an overall conversion report.
9. The automated heterogeneous database-based information system transformation method of claim 8, wherein the overall transformation report comprises one or more of:
Classifying and displaying the conversion errors of each service system, and classifying and displaying each conversion error in each service system according to the error type;
Classifying and displaying conversion errors of the non-stored process objects;
Classifying and displaying the conversion errors of the stored process objects;
Classifying and displaying conversion errors corresponding to various verification query sentences;
classifying and displaying the difference data of each non-stored process object and the stored process object after migration;
And classifying and displaying conversion errors corresponding to various grammar rules.
10. An electronic device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method of any one of claims 1 to 9.
CN202410402731.2A 2024-04-03 2024-04-03 Information system automatic transformation method and equipment based on different types of databases Active CN117992436B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410402731.2A CN117992436B (en) 2024-04-03 2024-04-03 Information system automatic transformation method and equipment based on different types of databases

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410402731.2A CN117992436B (en) 2024-04-03 2024-04-03 Information system automatic transformation method and equipment based on different types of databases

Publications (2)

Publication Number Publication Date
CN117992436A true CN117992436A (en) 2024-05-07
CN117992436B CN117992436B (en) 2024-06-25

Family

ID=90902391

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410402731.2A Active CN117992436B (en) 2024-04-03 2024-04-03 Information system automatic transformation method and equipment based on different types of databases

Country Status (1)

Country Link
CN (1) CN117992436B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109408493A (en) * 2018-10-17 2019-03-01 成都四方伟业软件股份有限公司 A kind of moving method and system of data source
CN112632038A (en) * 2020-12-31 2021-04-09 中国平安人寿保险股份有限公司 Database migration method, device, terminal and storage medium
WO2021259290A1 (en) * 2020-06-22 2021-12-30 中兴通讯股份有限公司 Stored procedure conversion method and apparatus, and device and storage medium
CN116842042A (en) * 2023-06-30 2023-10-03 中国人民解放军国防科技大学 Universal method, device, electronic equipment and storage medium for dissimilating database
CN116955393A (en) * 2023-02-03 2023-10-27 中国建设银行股份有限公司 Data processing method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109408493A (en) * 2018-10-17 2019-03-01 成都四方伟业软件股份有限公司 A kind of moving method and system of data source
WO2021259290A1 (en) * 2020-06-22 2021-12-30 中兴通讯股份有限公司 Stored procedure conversion method and apparatus, and device and storage medium
CN112632038A (en) * 2020-12-31 2021-04-09 中国平安人寿保险股份有限公司 Database migration method, device, terminal and storage medium
CN116955393A (en) * 2023-02-03 2023-10-27 中国建设银行股份有限公司 Data processing method and device, electronic equipment and storage medium
CN116842042A (en) * 2023-06-30 2023-10-03 中国人民解放军国防科技大学 Universal method, device, electronic equipment and storage medium for dissimilating database

Also Published As

Publication number Publication date
CN117992436B (en) 2024-06-25

Similar Documents

Publication Publication Date Title
CN110069572B (en) HIVE task scheduling method, device, equipment and storage medium based on big data platform
CN110209650B (en) Data normalization and migration method and device, computer equipment and storage medium
US11651272B2 (en) Machine-learning-facilitated conversion of database systems
US8346773B2 (en) Product classification system
US20180165179A1 (en) Determining incompatibilities of automated test cases with modified user interfaces
US20190057335A1 (en) Targeted data element detection for crowd sourced projects with machine learning
US20060129609A1 (en) Database synchronization using change log
CN110737594A (en) Database standard conformance testing method and device for automatically generating test cases
CN112506778A (en) WEB user interface automatic test method, device, equipment and storage medium
CN117271481B (en) Automatic database optimization method and equipment
CN111026670A (en) Test case generation method, test case generation device, and storage medium
CN114064601B (en) Storage process conversion method, device, equipment and storage medium
CN103186384A (en) Business-component-oriented software designing and analyzing system and using method thereof
US10606728B2 (en) Framework for detecting source code anomalies
CN113297251A (en) Multi-source data retrieval method, device, equipment and storage medium
CN117992436B (en) Information system automatic transformation method and equipment based on different types of databases
CN113722337B (en) Service data determination method, device, equipment and storage medium
WO2023081153A1 (en) Columnar cache query using hybrid query execution plan
CN115562989A (en) Automatic test sequence conversion method, system, equipment and medium
CN114968725A (en) Task dependency relationship correction method and device, computer equipment and storage medium
CN115098368A (en) Intelligent verification method and device for recognizing brain picture use case
CN110515653B (en) Document generation method and device, electronic equipment and computer readable storage medium
CN114238467A (en) Structured data analysis method and system
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data
CN114328572A (en) Data query method, device, system and medium based on SQL parser

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant