CN117093564A - Project migration processing method and device and electronic equipment - Google Patents

Project migration processing method and device and electronic equipment Download PDF

Info

Publication number
CN117093564A
CN117093564A CN202311010636.XA CN202311010636A CN117093564A CN 117093564 A CN117093564 A CN 117093564A CN 202311010636 A CN202311010636 A CN 202311010636A CN 117093564 A CN117093564 A CN 117093564A
Authority
CN
China
Prior art keywords
database
mapper
sql
target
project
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
CN202311010636.XA
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202311010636.XA priority Critical patent/CN117093564A/en
Publication of CN117093564A publication Critical patent/CN117093564A/en
Pending legal-status Critical Current

Links

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/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • 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
    • 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/245Query processing
    • G06F16/2455Query execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a project migration processing method, a project migration processing device and electronic equipment, wherein the method comprises the following steps: receiving a migration request for a target item; capturing all the mapper files from the target project files; analyzing each file to obtain a corresponding executable SQL sentence; executing SQL sentences in the databases corresponding to each target database connection string to obtain an execution result corresponding to the mapper file under each database; based on the execution results corresponding to all files in each database, a result report is generated for relevant personnel to check and repair the problems so as to complete project migration. According to the method, the execution condition test of migrating all the mapper files in the project to the target database can be completed through an automatic analysis processing process, and a result report is generated so that related personnel can repair the problems, thereby improving project migration efficiency and project quality after migration.

Description

Project migration processing method and device and electronic equipment
Technical Field
The present application relates to the field of financial technologies, and in particular, to a method and an apparatus for item migration processing, and an electronic device.
Background
At present, in the whole financial industry, a great industry technology trend exists, namely the prior system is subjected to Oracle modification, namely an Oracle database is required to be changed into other databases, under the background, many applications based on MyBatis can be migrated from the Oracle database to the other databases, and due to the fact that different database grammars have differences, grammar judgment and related repair are required to be carried out on map files stored in MyBatis in the migration process.
The existing processing mode is an artificial processing process, such as grammar judgment is carried out on each mapper file, adjustment test is carried out after problems exist, different test conditions are constructed aiming at different databases, and the like.
Disclosure of Invention
The application aims to provide a project migration processing method, a project migration processing device and electronic equipment, which can finish execution condition inspection of migration of all mapper files in a project to a target database through an automatic analysis processing process, and generate a result report so as to facilitate related personnel to repair problems, thereby improving project migration efficiency and project quality after migration.
In a first aspect, the present application provides a method for item migration processing, where the method includes: receiving a migration request for a target item; the migration request carries a target project file and at least one target database connection string; capturing all the mapper files from the target project files; analyzing the mapper files aiming at each mapper file to obtain corresponding executable SQL sentences; executing SQL sentences in the databases corresponding to each target database connection string to obtain an execution result corresponding to the mapper file under each database; based on the execution results corresponding to all the mapper files in each database, a result report is generated for relevant personnel to check and repair the problems so as to complete project migration.
In a preferred embodiment of the present application, the step of receiving the migration request for the target item includes: responding to configuration operation for the database connection string and analysis triggering operation of all SQL for the target item to receive migration request for the target item.
In a preferred embodiment of the present application, the step of parsing the mapper file to obtain a corresponding executable SQL statement includes: for each mapper statement in the mapper file, the following steps are performed: obtaining a database parameter type corresponding to a mapper statement; constructing corresponding parameter values for the database parameter types; and transmitting the parameter value into a mapper statement, and removing a designated label in the mapper statement to obtain an executable SQL statement corresponding to the mapper statement.
In a preferred embodiment of the present application, the step of constructing the corresponding parameter values for the database parameter types includes: determining the SQL parameter type corresponding to the database parameter type according to the mapping relation between the database parameter and the java parameter; and taking the predefined parameter value corresponding to the SQL parameter type as the parameter value corresponding to the database parameter type.
In a preferred embodiment of the present application, the step of executing the SQL statement in the database corresponding to each target database connection string includes: for each target database connection string, the following operations are performed: obtaining a login account and a password from a target database connection string; logging in a corresponding database through a login account and a password; executing the SQL sentence in the database to obtain an execution result corresponding to the SQL sentence.
In a preferred embodiment of the present application, the step of executing the SQL statement in the database to obtain an execution result corresponding to the SQL statement includes: if the SQL statement is successfully executed, generating an execution success result; if the SQL statement fails to execute, an execution failure result is generated and the failure reason is recorded.
In a preferred embodiment of the present application, after the step of generating the result report, the method further includes: and responding to the repair operation aiming at the problem statement in the result report, and completing the repair of the problem statement.
In a second aspect, the present application further provides an item migration processing apparatus, where the apparatus includes: the request receiving module is used for receiving a migration request aiming at a target item; the migration request carries a target project file and at least one target database connection string; the file grabbing module is used for grabbing all the mapper files from the target project files; the SQL sentence acquisition and execution module is used for analyzing the mapper files aiming at each mapper file to acquire corresponding executable SQL sentences; executing SQL sentences in the databases corresponding to each target database connection string to obtain an execution result corresponding to the mapper file under each database; and the report generation module is used for generating a result report based on the execution results corresponding to all the mapper files under each database so as to be checked by related personnel and repair problems to finish project migration.
In a third aspect, the present application also provides an electronic device comprising a processor and a memory, the memory storing computer executable instructions executable by the processor, the processor executing the computer executable instructions to implement the method of the first aspect.
In a fourth aspect, the present application also provides a computer readable storage medium storing computer executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of the first aspect.
In the project migration processing method, the project migration processing device and the electronic equipment provided by the application, firstly, a migration request aiming at a target project is received; the migration request carries a target project file and at least one target database connection string; then grabbing all the mapper files from the target project files; analyzing the mapper files aiming at each mapper file to obtain corresponding executable SQL sentences; executing SQL sentences in the databases corresponding to each target database connection string to obtain an execution result corresponding to the mapper file under each database; and finally, generating a result report based on execution results corresponding to all the mapper files under each database, so that related personnel can check and repair the problems to finish project migration. According to the embodiment of the application, through an automatic analysis processing process, the execution condition test of migrating all the mapper files in the project to the target database can be completed, and a result report is generated so that related personnel can repair the problems, thereby improving the project migration efficiency and the project quality after migration.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for item migration processing according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a database connection string configuration according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a request initiation according to an embodiment of the present application;
FIG. 4 is a block diagram of a project migration processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the present application will be clearly and completely described in connection with the embodiments, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The basic process flow of the current project migration is: each SQL statement in the mapper configuration file is checked, judgment and adjustment are carried out on the SQL statement with possible grammar errors, the mapper file related to most data-based application is more, the whole change time is extremely long, and the condition of missing change is very frequent. The analysis of the mapper file is based on the relevant framework, and the relevant framework is required to be additionally introduced for introducing relevant functions, so that the method is invasive to the original project code.
After the grammar error is repaired, relevant tests are required to be carried out; the mapper interface often relates to dynamic parameters, artificial construction parameters are needed during testing, and the construction parameters are needed to be constructed aiming at different types of parameter values; when the parameters are more, the transmission value errors often exist, and the transmission value is not transmitted, so that the error reporting or the incomplete testing is performed.
When the project is migrated, the project is migrated to different databases such as OceanBase, mySQL, the related drive support of each database is different, the related drive support needs to be independently reconfigured and then can be used, and the related drive support cannot be rapidly switched, evaluated and reformed.
In addition, in the normal development process, after the table structure is often modified, the application end needs to search all relevant points for evaluation, all corresponding changed points are uncovered when the table structure is modified, problems exist after the project is online due to the fact that all changed points are searched or the project is missed, and the quality of the project is difficult to guarantee.
Based on the above, the embodiment of the application provides a project migration processing method, a device and electronic equipment, which can finish the execution condition test of migrating all the mapper files in the project to a target database through an automatic analysis processing process, and generate a result report so as to facilitate related personnel to repair the problems, thereby improving project migration efficiency and project quality after migration.
For the sake of understanding the present embodiment, first, a detailed description is given of a method for item migration processing disclosed in the present embodiment.
Fig. 1 is a flowchart of a project migration processing method according to an embodiment of the present application, where the method may be implemented by a software tool that is developed based on a commonly used IDEA (IntelliJ IDEA, integrated development environment), and is used only after offline installation, without introducing other frameworks, and is convenient to use and non-invasive to project codes. The specific method for realizing the tool comprises the following steps:
step S102, receiving a migration request for a target item; the migration request carries a target project file and at least one target database connection string;
the method supports various databases, only the corresponding database connection strings are needed to be configured, the tool can automatically identify the corresponding databases and load related drivers, and the corresponding databases are executed according to the configured databases.
Step S104, capturing all the mapper files from the target project file; the mapper file is an xml format configuration file, and is composed of a series of elements having hierarchical relationships, and the elements have association relationships with each other by attributes of the elements. One target item file includes a plurality of mapper files.
Step S106, analyzing the mapper files aiming at each mapper file to obtain corresponding executable SQL sentences; executing SQL sentences in the databases corresponding to each target database connection string to obtain execution results corresponding to the mapper files under each database.
Because a mapper file generally includes a plurality of mapper statements, through the parsing process, executable SQL (Structured Query Language ) statements corresponding to each mapper statement can be obtained, and then the statements are executed in databases corresponding to each target database connection string, so that an execution result in each database can be obtained. The execution result may be execution success or execution failure and failure cause.
Step S108, based on the execution results corresponding to all the mapper files in each database, a result report is generated for relevant personnel to check and repair the problems so as to complete project migration.
And generating a result report corresponding to each database by taking the database as a unit, wherein the report comprises an execution result corresponding to each mapper file.
In the project migration processing method provided by the application, firstly, a migration request aiming at a target project is received; the migration request carries a target project file and at least one target database connection string; then grabbing all the mapper files from the target project files; analyzing the mapper files aiming at each mapper file to obtain corresponding executable SQL sentences; executing SQL sentences in the databases corresponding to each target database connection string to obtain an execution result corresponding to the mapper file under each database; and finally, generating a result report based on execution results corresponding to all the mapper files under each database, so that related personnel can check and repair the problems to finish project migration. According to the embodiment of the application, through an automatic analysis processing process, the execution condition test of migrating all the mapper files in the project to the target database can be completed, and a result report is generated so that related personnel can repair the problems, thereby improving the project migration efficiency and the project quality after migration.
The embodiment of the application also provides another item migration processing method, which is realized on the basis of the embodiment; the present embodiment focuses on the initiation request process, the parsing process, and the problem repair process.
In a preferred embodiment of the present application, the step of receiving the migration request for the target item includes: responding to configuration operation for the database connection string and analysis triggering operation of all SQL for the target item to receive migration request for the target item.
In particular implementations, the relevant person may initiate a migration request for an item by configuring a database connection string in the aforementioned software tool, as shown in FIG. 2, and selecting all SQL parse-trigger operations for the target item. For example, clicking the right mouse button in the code editing area, then selecting to test all sql, and then clicking goto, as shown in fig. 3, may initiate a migration request.
In a preferred embodiment of the present application, the step of parsing the mapper file to obtain a corresponding executable SQL statement includes:
for each mapper statement in the mapper file, the following steps are performed:
(1) Obtaining a database parameter type corresponding to a mapper statement;
(2) And constructing corresponding parameter values for the database parameter types. In the implementation, the SQL parameter type corresponding to the database parameter type can be determined according to the mapping relation between the database parameter and the java parameter; and taking the predefined parameter value corresponding to the SQL parameter type as the parameter value corresponding to the database parameter type.
The mapping relation between the database parameters and the java parameters is as follows:
varchar String;
char String;
tinyblob String;
tinytext String;
blob String;
text String;
longblob String;
longtext String;
mediumblob String;
mediumtext String;
tinyint int;
smallint int;
int int;
integer int;
bigint int;
float BigDecimal;
double BigDecimal;
decimal BigDecimal;
date Date;
time Date;
year Date;
datetime Date;
timestamp Date;
number BigDecimal;
clob String;
varchar2 String。
the left column is database parameters, the right column is java parameters, and each java parameter corresponds to a predefined parameter value. For example, if the predefined parameter value corresponding to String is '1', the predefined parameter value corresponding to int is 1, and the predefined parameter value corresponding to date is '2023-01-01'.
Furthermore, for container classes such as list, corresponding parameter values ('1', '2', '3') are generated; and for the custom class, acquiring a field of the custom class, and acquiring a basic type and a following configuration type, and carrying out default assignment according to the mapping relation of the database parameters and the java parameters.
(3) And transmitting the parameter value into a mapper statement, and removing a designated label in the mapper statement to obtain an executable SQL statement corresponding to the mapper statement.
Since the mapper statement is not directly executable, it needs to be converted into an executable SQL statement, and the specific conversion process is as follows:
such as:
<select id="queryUserGroupCount"resultType="java.lang.Integer">
select count(1)from pa_t_sys_usergroup where usergroup_name=upper(#{usergroupName,jdbcType=VARCHAR})
</select>
the method comprises the following steps: integer queryUserGroupCount (String usergroupName); if the parameters are String, directly inputting a default value of 1, removing irrelevant labels from a Mapper statement, and inputting the parameters into the default value to generate executable SQL as follows:
select count(1)from pa_t_sys_usergroup where usergroup_name=upper('1')。
in a preferred embodiment of the present application, the step of executing the SQL statement in the database corresponding to each target database connection string includes:
for each target database connection string, the following operations are performed: obtaining a login account and a password from a target database connection string; logging in a corresponding database through a login account and a password; executing the SQL sentence in the database to obtain an execution result corresponding to the SQL sentence.
In a preferred embodiment of the present application, the step of executing the SQL statement in the database to obtain an execution result corresponding to the SQL statement includes: if the SQL statement is successfully executed, generating an execution success result; if the SQL statement fails to execute, an execution failure result is generated and the failure reason is recorded.
When the method is implemented, SQL sentences are executed in a database, and if the execution is successful, the database returns a successful identification; if execution fails, an identification of the failure is returned, along with the cause of the failure. The program can receive the corresponding identification and information for display.
In a preferred embodiment of the present application, after the step of generating the result report, the method further includes: and responding to the repair operation aiming at the problem statement in the result report, and completing the repair of the problem statement.
For example, the error information displayed in the result report is:
SELECT command denied to user'mriskdbopr'@'22.3.85.241'for table'pa_t_md_int_ric_rprm_cfg'。
it can be seen from the error information that because no corresponding table is built in the database, it is necessary to create a relevant table in the database. There are a number of error conditions that require modification based on manual determination of the corresponding error.
According to the item migration processing method provided by the embodiment of the application, full-automatic quick analysis and execution judgment SQL can be realized by simply clicking, all the mapper files in the whole item system are completely grabbed, full-automatic analysis processing is carried out on SQL sentences of each mapper interface, full-automatic analysis on SQL of the whole item can be quickly completed within a few minutes to tens of minutes, parameter construction is carried out, judgment is carried out, and an executed result is output to a corresponding report. Compared with the method for judging each mapper file, the method has the advantages that parameters are artificially constructed and independently tested, the full-automatic treatment is realized by using the tool, the result can be rapidly output, and the problem is solved based on the output result in a rapid positioning way.
The advantage of this scheme lies in:
1. simple operation
For a team with idea as a development tool, only the corresponding component needs to be directly installed, and simple operation is performed in the idea.
2. Full automation
The database connection is only required to be configured, the mapper file and the parameter transmission of the whole item can be analyzed after the interface is clicked, the parameter transmission is automatically assigned, and then the sql is actually operated, and the execution result and the error information are obtained.
3. Rapid action
The method is directly executed by default parameters without starting service and constructing corresponding parameters, and the result can be quickly obtained in a few minutes in summer under most conditions.
4. Accuracy of
All sql of the item is actually executed to prevent missing modifications from causing problems.
Based on the above method embodiment, the embodiment of the present application further provides an item migration processing apparatus, as shown in fig. 4, where the apparatus includes:
a request receiving module 42 for receiving a migration request for a target item; the migration request carries a target project file and at least one target database connection string; a file grabbing module 44, configured to grab all the mapper files from the target project file; the SQL sentence acquisition and execution module 46 is configured to analyze the mapper file for each mapper file to obtain a corresponding executable SQL sentence; executing SQL sentences in the databases corresponding to each target database connection string to obtain an execution result corresponding to the mapper file under each database; the report generation module 48 is configured to generate a result report based on execution results corresponding to all the mapper files under each database, so that related personnel can check and repair problems to complete project migration.
In a preferred embodiment of the present application, the request receiving module 42 is configured to respond to the configuration operation for the database connection string and the parsing trigger operation for all the SQLs of the target item, so as to receive the migration request for the target item.
In a preferred embodiment of the present application, the SQL statement obtaining and executing module 46 is configured to execute, for each mapper statement in the mapper file, the following steps: obtaining a database parameter type corresponding to a mapper statement; constructing corresponding parameter values for the database parameter types; and transmitting the parameter value into a mapper statement, and removing a designated label in the mapper statement to obtain an executable SQL statement corresponding to the mapper statement.
In a preferred embodiment of the present application, the SQL statement obtaining and executing module 46 is configured to determine an SQL parameter type corresponding to the database parameter type according to a mapping relationship between the database parameter and the java parameter; and taking the predefined parameter value corresponding to the SQL parameter type as the parameter value corresponding to the database parameter type.
In a preferred embodiment of the present application, the SQL statement obtaining and executing module 46 is configured to, for each target database connection string, perform the following operations: obtaining a login account and a password from a target database connection string; logging in a corresponding database through a login account and a password; executing the SQL sentence in the database to obtain an execution result corresponding to the SQL sentence.
In the preferred embodiment of the present application, the SQL statement obtaining and executing module 46 is configured to generate an execution success result if the SQL statement is executed successfully; if the SQL statement fails to execute, an execution failure result is generated and the failure reason is recorded.
In a preferred embodiment of the present application, the apparatus further comprises: and the repairing module is used for responding to the repairing operation aiming at the problem statement in the result report after the step of generating the result report, and finishing the repairing of the problem statement.
The device provided by the embodiment of the present application has the same implementation principle and technical effects as those of the foregoing method embodiment, and for the sake of brief description, reference may be made to the corresponding content in the foregoing method embodiment where the device embodiment is not mentioned.
An embodiment of the present application further provides an electronic device, as shown in fig. 5, which is a schematic structural diagram of the electronic device, where the electronic device includes a processor 51 and a memory 50, where the memory 50 stores computer executable instructions that can be executed by the processor 51, and the processor 51 executes the computer executable instructions to implement the above method.
In the embodiment shown in fig. 5, the electronic device further comprises a bus 52 and a communication interface 53, wherein the processor 51, the communication interface 53 and the memory 50 are connected by the bus 52.
The memory 50 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and at least one other network element is achieved via at least one communication interface 53 (which may be wired or wireless), and the internet, wide area network, local network, metropolitan area network, etc. may be used. Bus 52 may be an ISA (Industry Standard Architecture ) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The bus 52 may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one bi-directional arrow is shown in FIG. 5, but not only one bus or type of bus.
The processor 51 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 51 or by instructions in the form of software. The processor 51 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory and the processor 51 reads information in the memory and in combination with its hardware performs the steps of the method of the previous embodiment.
The embodiment of the application also provides a computer readable storage medium, which stores computer executable instructions that, when being called and executed by a processor, cause the processor to implement the above method, and the specific implementation can refer to the foregoing method embodiment and will not be described herein.
The method, the apparatus and the computer program product of the electronic device provided in the embodiments of the present application include a computer readable storage medium storing program codes, where the instructions included in the program codes may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment and will not be described herein.
The relative steps, numerical expressions and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present application unless it is specifically stated otherwise.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description of the present application, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present application, and are not intended to limit the scope of the present application, but it should be understood by those skilled in the art that the present application is not limited thereto, and that the present application is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of item migration processing, the method comprising:
receiving a migration request for a target item; the migration request carries a target project file and at least one target database connection string;
capturing all map files from the target project file;
analyzing the mapper files aiming at each mapper file to obtain corresponding executable SQL sentences;
executing the SQL sentences in the databases corresponding to each target database connection string to obtain execution results corresponding to the mapper files under each database;
based on the execution results corresponding to all the mapper files in each database, a result report is generated for relevant personnel to check and repair the problems so as to complete project migration.
2. The method of claim 1, wherein the step of receiving a migration request for a target item comprises:
responding to configuration operation for the database connection string and analysis triggering operation of all SQL for the target item to receive migration request for the target item.
3. The method of claim 1, wherein the step of parsing the mapper file to obtain corresponding executable SQL statements comprises:
for each mapper statement in the mapper file, the following steps are performed:
acquiring a database parameter type corresponding to the mapper statement;
constructing corresponding parameter values for the database parameter types;
and transmitting the parameter value into the mapper statement, and removing the appointed label in the mapper statement to obtain an executable SQL statement corresponding to the mapper statement.
4. A method according to claim 3, wherein the step of constructing corresponding parameter values for the database parameter types comprises:
determining the SQL parameter type corresponding to the database parameter type according to the mapping relation between the database parameter and the java parameter;
and taking the predefined parameter value corresponding to the SQL parameter type as the parameter value corresponding to the database parameter type.
5. The method of claim 1, wherein the step of executing the SQL statement in the database corresponding to each of the target database connection strings comprises:
for each target database connection string, the following operations are performed:
obtaining a login account and a password from the target database connection string;
logging in a corresponding database through the login account and the password;
executing the SQL sentence in the database to obtain an execution result corresponding to the SQL sentence.
6. The method according to claim 5, wherein the step of executing the SQL statement in the database to obtain an execution result corresponding to the SQL statement comprises:
if the SQL statement is successfully executed, generating an execution success result;
if the SQL statement fails to execute, an execution failure result is generated and the failure reason is recorded.
7. The method of claim 1, further comprising, after the step of generating the results report:
and responding to the repair operation aiming at the problem statement in the result report, and completing the repair of the problem statement.
8. An item migration processing apparatus, the apparatus comprising:
the request receiving module is used for receiving a migration request aiming at a target item; the migration request carries a target project file and at least one target database connection string;
the file grabbing module is used for grabbing all the mapper files from the target project files;
the SQL sentence acquisition and execution module is used for analyzing the mapper files aiming at each mapper file to acquire corresponding executable SQL sentences; executing the SQL sentences in the databases corresponding to each target database connection string to obtain execution results corresponding to the mapper files under each database;
and the report generation module is used for generating a result report based on the execution results corresponding to all the mapper files under each database so as to be checked by related personnel and repair problems to finish project migration.
9. An electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 7.
10. A computer readable storage medium storing computer executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 7.
CN202311010636.XA 2023-08-11 2023-08-11 Project migration processing method and device and electronic equipment Pending CN117093564A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311010636.XA CN117093564A (en) 2023-08-11 2023-08-11 Project migration processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311010636.XA CN117093564A (en) 2023-08-11 2023-08-11 Project migration processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117093564A true CN117093564A (en) 2023-11-21

Family

ID=88771029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311010636.XA Pending CN117093564A (en) 2023-08-11 2023-08-11 Project migration processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117093564A (en)

Similar Documents

Publication Publication Date Title
CN104077140B (en) Automation Compilation Method and compilation device for continuous integrating
CN108628748B (en) Automatic test management method and automatic test management system
US8875110B2 (en) Code inspection executing system for performing a code inspection of ABAP source codes
US20120116561A1 (en) Program testing apparatus, method of testing a program, and program testing program
CN102053906A (en) System and method for collecting program runtime information
CN108804326B (en) Automatic software code detection method
US10437717B2 (en) Defect reporting in application testing
CN107045477B (en) Quality assessment platform capable of carrying out multi-dimensional detection
CN113010413B (en) Automatic interface testing method and device
CN112199277B (en) Defect reproduction method, device, equipment and storage medium based on browser
CN112540924A (en) Interface automation test method, device, equipment and storage medium
KR102269286B1 (en) the automatic monitoring system for annotation
CN111597104A (en) Multi-protocol adaptive interface regression testing method, system, equipment and medium
CN111966587A (en) Data acquisition method, device and equipment
CN100428243C (en) Method and system for realizing action on model
JP2019194818A (en) Software trouble prediction device
US20080172659A1 (en) Harmonizing a test file and test configuration in a revision control system
CN117093564A (en) Project migration processing method and device and electronic equipment
JP2003345626A (en) Knowledge automation engine for product knowledge management
CN111078193A (en) Software development method and system for data analysis system
CN113138926B (en) Network service interface evaluation method and device
CN113467978A (en) Method and device for detecting and repairing code defects
CN117520136A (en) Function test method, device and equipment of application program and readable storage medium
CN115964260A (en) Software quality inspection method and related product
CN118152540A (en) Question-answering model training method and device, computer equipment and storage medium

Legal Events

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