Database data processing method and device and server

By automatically obtaining and analyzing the database system dictionary table, using regular matching detection and processing implicit conversion, the performance problems caused by implicit conversion after database migration are solved, and efficient and accurate automatic processing is achieved.

CN119988439APending Publication Date: 2025-05-13INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410708408.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In financial business scenarios, after the database is migrated from one type to another, implicit conversion is prone to affecting the database performance. The existing methods require manual detection and processing, which are inefficient and prone to errors.

Method used

By obtaining the system dictionary table of the target database, using regular matching and preset matching rules, implicit conversions are automatically detected and processed, including obtaining stored procedure information, detecting field information and performing conversion processing.

Benefits of technology

Automatic detection and processing of implicit database conversions is realized, processing efficiency is improved, manual intervention is reduced, and detection accuracy and database performance are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988439A_ABST
    Figure CN119988439A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device of a database and a server, and can be applied to the field of finance. Based on the method, a first system dictionary table used for recording storage process information of a target database can be firstly obtained; obtaining a corresponding target field through regular matching according to a preset matching rule and the first system dictionary table; storing the target field into a preset detection record table; obtaining a second system dictionary table used for recording field information of the target database; according to a preset detection rule, detecting whether implicit conversion exists in the target database or not by utilizing a preset detection record table and a second system dictionary table; and under the condition of determining that the implicit conversion exists in the target database, performing corresponding conversion processing according to a preset processing rule. Therefore, implicit conversion in the database after the first type of database is migrated and converted into the second type of database can be efficiently and accurately detected and processed, and the database performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular to a method, device and server for processing data in a database. Background Art

[0002] In financial business scenarios, due to technological development and business transformation needs, it is sometimes necessary to migrate the transaction business database from one type of database to another. However, the database obtained after the migration often has implicit conversions, which in turn affects the performance of the database.

[0003] Based on the existing methods, most of them need to rely on technicians to manually comb through the database code to detect implicit conversions and manually process the detected implicit conversions. There are problems such as heavy workload for technicians, low processing efficiency, and easy errors.

[0004] Currently, no effective solution has been proposed to the above problems. Summary of the invention

[0005] The present specification provides a database data processing method, device and server, which can automatically detect and process implicit conversions in a database after migration and conversion from a first type of database to a second type of database in a relatively efficient and accurate manner.

[0006] This specification provides a method for processing data in a database, including:

[0007] Acquire a first system dictionary table of a target database; wherein the target database is a business database that is migrated from a first type database to a second type database through an automatic migration tool; the first system dictionary table is used to record stored procedure information of the target database;

[0008] According to the preset matching rules and the first system dictionary table, the corresponding target field is obtained through regular matching; and the target field is stored in the preset detection record table;

[0009] Acquire a second system dictionary table of the target database; wherein the second system dictionary table is used to record field information of the target database;

[0010] According to the preset detection rules, using the preset detection record table and the second system dictionary table, detect whether there is implicit conversion in the target database;

[0011] When it is determined that the target database has implicit conversion, corresponding conversion processing is performed according to preset processing rules.

[0012] In one embodiment, obtaining a first system dictionary table of a target database includes:

[0013] Connect to the target database; and query and obtain the first system dictionary table of the target database by executing the corresponding first SQL query instruction.

[0014] In one embodiment, the target field includes at least: a stored procedure name, a target table name, and a target field name.

[0015] In one embodiment, according to the preset matching rule and the first system dictionary table, the corresponding target field is obtained through regular matching, including:

[0016] According to the first system dictionary table, obtaining the stored procedure source code of the target database;

[0017] According to the stored procedure source code of the target database, the corresponding stored procedure name and the stored procedure body code are extracted;

[0018] According to the main code of the stored procedure, determine the corresponding target program package body;

[0019] According to the preset matching rules, the corresponding target table name and target field name are obtained by performing regular matching on the target package body.

[0020] In one embodiment, according to a preset matching rule, by performing regular matching on the target package body, the corresponding target table name and target field name are obtained, including:

[0021] Retrieving the first characteristic identifier in the target program package body according to a preset matching rule;

[0022] Dividing the target program package body into a plurality of stage codes according to the first feature identifier;

[0023] The corresponding target table name and target field name are retrieved and determined according to the first characteristic field and the second characteristic identifier of each stage code in the plurality of stage codes.

[0024] In one embodiment, retrieving and determining the corresponding target table name and target field name according to the first characteristic field and the second characteristic identifier of each stage code in the plurality of stage codes includes:

[0025] Determine the target table name and target field name corresponding to the current stage code among multiple stage codes in the following manner:

[0026] In the current stage code, retrieve and locate the first feature field;

[0027] Detecting whether there is a second feature identifier at a position adjacent to the rear of the first feature field;

[0028] When it is determined that there is no second feature identifier at a position adjacent to the rear of the first feature field, the second feature field is retrieved and located in the area code behind the first feature field;

[0029] The corresponding target table name and target field name are obtained and determined according to the characters between the first characteristic field and the second characteristic field.

[0030] In one embodiment, after detecting whether there is a second feature identifier at a position adjacent to the rear of the first feature field, the method further includes:

[0031] When it is determined that there is a second feature identifier at a position adjacent to the rear of the first feature field, the second feature field is retrieved and located in the area code behind the first feature field;

[0032] According to the second characteristic field, obtaining a characteristic code segment in a vicinity of the second characteristic field;

[0033] Retrieving and determining, based on a third feature identifier in the feature code segment, whether the feature code segment meets a preset condition;

[0034] When it is determined that the characteristic code segment meets the preset condition, the corresponding target table name and target field name are obtained and determined according to the characters at both ends of the third characteristic identifier.

[0035] In one embodiment, according to a preset detection rule, using a preset detection record table and a second system dictionary table, detecting whether there is an implicit conversion in the target database includes:

[0036] According to the preset detection rules, using the target table name and target field name in the preset detection record table, querying the second system dictionary table to determine the corresponding first type field and second type field;

[0037] Calculate the field difference value between the first type field and the second type field;

[0038] When it is determined that the field difference value is greater than or equal to the preset difference threshold, it is determined that implicit conversion exists in the target database.

[0039] In one embodiment, querying the second system dictionary table to determine the corresponding first type field and second type field includes:

[0040] According to the target table name and target field name in the preset detection record table, a corresponding second SQL query instruction is obtained by splicing;

[0041] By executing the second SQL query instruction, the corresponding data value is queried and acquired from the second system dictionary table to obtain the corresponding first type field and second type field.

[0042] In one embodiment, according to a preset processing rule, corresponding conversion processing is performed, including:

[0043] Get the target execution plan of the stored procedure on the target database;

[0044] According to the preset processing rules and the target execution plan, in the first type field and the second type field of the second system dictionary table, a standard type field and a target type field are determined;

[0045] Convert the target type field in the second dictionary table to the corresponding standard type field.

[0046] In one embodiment, after performing corresponding conversion processing according to a preset processing rule, the method further includes:

[0047] Based on the converted target database, business data processing involving the target database stored procedures is performed.

[0048] This specification also provides a database data processing device, including:

[0049] A first acquisition module is used to acquire a first system dictionary table of a target database; wherein the target database is a business database that is migrated from a first type database to a second type database through an automatic migration tool; the first system dictionary table is used to record stored procedure information of the target database;

[0050] A matching module, used to obtain the corresponding target field through regular matching according to the preset matching rules and the first system dictionary table; and store the target field in a preset detection record table;

[0051] A second acquisition module is used to acquire a second system dictionary table of the target database; wherein the second system dictionary table is used to record field information of the target database;

[0052] A detection module, used to detect whether there is an implicit conversion in the target database according to a preset detection rule, using a preset detection record table and a second system dictionary table;

[0053] The processing module is used to perform corresponding conversion processing according to preset processing rules when it is determined that the target database has implicit conversion.

[0054] The present specification also provides a server, comprising a processor and a memory for storing processor executable instructions, wherein the processor implements relevant steps of the database data processing method when executing the instructions.

[0055] The present specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the relevant steps of the database data processing method are implemented.

[0056] The present specification also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the relevant steps of the database data processing method are implemented.

[0057] Based on the data processing method, device and server of the database provided in this specification, the first system dictionary table for recording the storage process information of the target database can be obtained first; according to the preset matching rules and the first system dictionary table, the corresponding target field can be obtained through regular matching; and the target field can be stored in the preset detection record table; then the second system dictionary table for recording the field information of the target database can be obtained; according to the preset detection rules, the preset detection record table and the second system dictionary table are used to detect whether there is an implicit conversion in the target database; in the case of determining that there is an implicit conversion in the target database, the corresponding conversion processing is performed according to the preset processing rules. In this way, the implicit conversion in the database after the migration and conversion from the first type of database to the second type of database can be automatically detected and identified more efficiently and accurately; and the implicit conversion can be processed in a timely manner to improve the performance of the database, and then the business data processing involving the database can be completed more efficiently and accurately based on the converted database. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of this specification, the drawings required for use in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0059] Figure 1 is a flowchart of a method for processing data in a database provided by an embodiment of the present specification;

[0060] Figure 2 It is a schematic diagram of an embodiment of a method for processing database data provided by an embodiment of this specification in a scenario example;

[0061] Figure 3 It is a schematic diagram of an embodiment of a method for processing database data provided by an embodiment of this specification in a scenario example;

[0062] Figure 4 It is a schematic diagram of an embodiment of a method for processing database data provided by an embodiment of this specification, in a scenario example;

[0063] Figure 5 It is a schematic diagram of an embodiment of a method for processing database data provided by an embodiment of this specification, in a scenario example;

[0064] Figure 6 It is a schematic diagram of an embodiment of a method for processing database data provided by an embodiment of this specification, in a scenario example;

[0065] Figure 7 It is a schematic diagram of the structure of a server provided by an embodiment of this specification;

[0066] Figure 8 It is a schematic diagram of the structure of a data processing device for a database provided by an embodiment of the present specification;

[0067] Fig. 9 It is a schematic diagram of an embodiment of a method for processing database data provided by an embodiment of this specification, in a scenario example;

[0068] Fig.10 It is a schematic diagram of an embodiment of a method for processing database data provided by an embodiment of this specification, in a scenario example;

[0069] Fig.11 It is a schematic diagram of an embodiment of a database data processing method provided by an embodiment of this specification, in a scenario example. DETAILED DESCRIPTION

[0070] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0071] It should be noted that the user-related information and data involved in the embodiments of this specification are all information and data authorized by the user or fully authorized by relevant parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users or relevant parties to choose to authorize or refuse.

[0072] It should also be noted that in the embodiments of this specification, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0073] See also Figure 1 As shown, the embodiment of this specification provides a method for processing data in a database. The method is specifically applied to the server side. When implemented specifically, the method may include the following contents:

[0074] S101: Acquire a first system dictionary table of a target database; wherein the target database is a business database that is migrated from a first type database to a second type database through an automatic migration tool; the first system dictionary table is used to record stored procedure information of the target database;

[0075] S102: According to the preset matching rule and the first system dictionary table, a corresponding target field is obtained through regular matching; and the target field is stored in a preset detection record table;

[0076] S103: Acquire a second system dictionary table of the target database; wherein the second system dictionary table is used to record field information of the target database;

[0077] S104: According to a preset detection rule, using a preset detection record table and a second system dictionary table, detecting whether there is an implicit conversion in the target database;

[0078] S105: When it is determined that the target database has implicit conversion, corresponding conversion processing is performed according to a preset processing rule.

[0079] The implicit conversion mentioned above may specifically refer to a type conversion that occurs automatically in an expression without the need for explicit manual conversion.

[0080] The above-mentioned first type database and second type database may be different database types. Specifically, the above-mentioned first type database may be an oracle database; the above-mentioned second type database may be a Gaussian database. Of course, it should be noted that the above-mentioned first type database and second type database are only schematic illustrations. During specific implementation, according to specific application scenarios and processing requirements, the above-mentioned first type database and second type database may also be other different types of databases. This specification does not limit this.

[0081] The target database may be a business database of a trading platform. Specifically, the target database may store different types of transaction business data based on the trading platform, such as customer information, account resource data, credit rating, etc.

[0082] Specifically, the target database may be a business database that is migrated from a first type database to a second type database in advance by an automatic migration tool.

[0083] The automatic migration tool may specifically be a migration tool that matches the first type of database and the second type of database, for example, the ugo automatic migration tool.

[0084] Specifically, when the target database is migrated from the first type database to the second type database using the automatic migration tool, only syntax conversion can be achieved, but the functional consistency cannot be guaranteed, and thus the performance of the database cannot be guaranteed. That is, during the migration process, the automatic migration tool can only ensure that the statements based on the first type database can be rewritten into corresponding statements that can be executed on the second type database, but it can only be executed, and it cannot ensure that the execution of the statement is optimal or the most efficient.

[0085] Accordingly, when performing table association query based on the target database, the implicit conversion function of the target database will be triggered due to reasons such as inconsistent types defined by the two fields, resulting in implicit conversion.

[0086] Based on the above embodiment, the first system dictionary table and the second system dictionary table of the target database can be obtained and automatically detected through corresponding regular matching and detection processing, and the detected implicit conversion can be automatically processed accordingly in a timely manner, thereby effectively reducing the workload of technical personnel, improving the overall processing efficiency, and improving the performance of the target database, so that the corresponding transaction business data processing can be more efficiently and accurately implemented based on the converted target database.

[0087] In some embodiments, the data processing method of the database can be specifically applied to a server side. The server can also be connected to an operation and maintenance terminal.

[0088] The server may specifically include a background server applied to one side of the trading platform and capable of realizing functions such as data transmission and data processing. Specifically, the server may be, for example, an electronic device having data calculation, storage and network interaction functions. Alternatively, the server may also be a software program running in the electronic device to provide support for data processing, storage and network interaction. In this embodiment, the number of the servers is not specifically limited. The server may specifically be one server, or several servers, or a server cluster formed by several servers.

[0089] The operation and maintenance terminal may specifically include a front end applied to the operation and maintenance personnel side, capable of realizing functions such as data collection and data transmission. Specifically, the operation and maintenance terminal may be, for example, an electronic device such as a desktop computer, a tablet computer, a laptop computer, a smart phone, etc. Alternatively, the operation and maintenance terminal may also be a software application that can be run in the above electronic devices.

[0090] In specific implementation, when the operation and maintenance terminal monitors that the target database is migrated from a first type of database to a second type of database, an implicit conversion detection processing request for the target database can be generated; and the implicit conversion detection processing request is sent to the server to trigger the server to execute the database data processing method provided in this specification.

[0091] In some embodiments, the first system dictionary table may specifically be gs_package.

[0092] The above-mentioned acquisition of the first system dictionary table of the target database may include the following contents during specific implementation:

[0093] Connect to the target database; and query and obtain the first system dictionary table of the target database by executing the corresponding first SQL query instruction.

[0094] Based on the above embodiment, the first system dictionary table of the target database can be automatically queried and acquired relatively efficiently.

[0095] The first SQL query instruction may specifically be a select pkgname,pkgbodydeclsrc fromgs_package statement.

[0096] In specific implementation, the server can obtain the connection interface of the target database; and generate corresponding connection credentials based on the connection interface of the target database and the identity held by the server through a preset encryption algorithm; and then generate and initiate a connection request for the target database; wherein the connection request carries at least the server's identity and connection credentials.

[0097] The target database receives and responds to the connection request, extracts the connection credentials and the server's identity; then, based on a preset encryption algorithm, it uses the connection credentials and the server's identity to perform security verification; when it is determined that the security verification has passed; based on the target database's connection interface, a secure connection is established between the server and the target database, thereby enabling the connection between the server and the target database.

[0098] In one embodiment, the above-mentioned preset detection record table can be recorded as sqlanalyze, and can be specifically used to record the matching results obtained by regular matching based on preset matching rules.

[0099] The preset detection record table at least stores the target field obtained by regular matching.

[0100] The target fields may include at least: a stored procedure name (eg, may be written as pkg), a target table name (eg, table_name, may be abbreviated as table), a target field name (eg, column_name, may be abbreviated as col), and the like.

[0101] The target table name may include a table name and a table alias.

[0102] Furthermore, the target field may also include: a line number of the stored procedure code (for example, may be recorded as pkgnum).

[0103] Based on the above embodiment, a target field with relatively rich and comprehensive information can be obtained and used to construct a preset detection record table, so that it can be subsequently accurately determined whether there is an implicit conversion in the target database based on the above preset detection record table.

[0104] In some embodiments, see Figure 2 As shown, the above-mentioned method obtains the corresponding target field through regular matching according to the preset matching rule and the first system dictionary table. When implemented specifically, it may include the following contents:

[0105] S1: Obtain the stored procedure source code of the target database according to the first system dictionary table;

[0106] S2: Extract the corresponding stored procedure name and stored procedure body code according to the stored procedure source code of the target database;

[0107] S3: Determine the corresponding target program package body according to the stored procedure main code;

[0108] S4: According to the preset matching rules, the corresponding target table name and target field name are obtained by performing regular expression matching on the target package body.

[0109] The above-mentioned stored procedure source code can be specifically understood as a set of SQL code statements that can complete business data processing of specific functions based on a database.

[0110] The above-mentioned storage process may specifically include customer information management, rating process, resource data verification, etc. based on the trading platform.

[0111] The above-mentioned SQL (Structured Query Language) may specifically refer to a database query and programming language used for accessing data and querying, updating and managing relational database systems.

[0112] Based on the above embodiment, the preset matching rules and the first system dictionary table can be used to perform regular matching more accurately and efficiently to obtain the required target field.

[0113] In specific implementation, the server can obtain the stored procedure source code of the target database by querying the first system dictionary table according to the stored procedure keywords related to business data processing (for example, the pkgbodydeclsrc field of the stored procedure body). The above-mentioned stored procedures can specifically include customer information management based on the trading platform, rating process, resource data verification and other functional businesses involving database operations.

[0114] In some embodiments, see Figure 3 As shown, according to the preset matching rules, the target package body is matched with regular expressions to obtain the corresponding target table name and target field name. When implemented specifically, the following contents may be included:

[0115] S1: Retrieving a first characteristic identifier in a target program package according to a preset matching rule;

[0116] S2: Divide the target program package body into a plurality of stage codes according to the first feature identifier;

[0117] S3: Retrieve and determine the corresponding target table name and target field name according to the first characteristic field and the second characteristic identifier of each stage code in the plurality of stage codes.

[0118] The first characteristic identifier may be a symbol “;”. The first characteristic field may be a field “from”. The second characteristic identifier may be a symbol “(”.

[0119] Based on the above embodiment, the first feature identifier, the second feature identifier, and the first feature field can be retrieved and used according to the preset matching rule to precisely implement regular matching for the target program package body.

[0120] In specific implementation, according to a preset matching rule, the line number of the stored procedure code can be determined and recorded according to the retrieved first identifier.

[0121] In a specific implementation, according to the preset matching rule, according to the retrieved first identifier, by dividing the code between two adjacent first identifiers in the target program package body into a stage code, the target program body is divided into multiple stage codes. Then, according to the preset matching rule, corresponding regular expression matching can be performed for each stage code in the multiple stage codes respectively, so that the corresponding target table name and target field name can be efficiently determined by parallel processing.

[0122] In some embodiments, the corresponding target table name and target field name are determined according to the first characteristic field and the second characteristic identifier of each stage code in the plurality of stage codes. Figure 4 As shown, it may include: determining the target table name and target field name corresponding to the current stage code among the multiple stage codes in the following manner:

[0123] S1: In the current stage code, retrieve and locate the first feature field;

[0124] S2: Detect whether there is a second feature identifier at a position adjacent to the rear of the first feature field;

[0125] S3: when it is determined that there is no second feature identifier at a position adjacent to the rear of the first feature field, the second feature field is retrieved and located in the area code behind the first feature field;

[0126] S4: Obtain and determine the corresponding target table name and target field name according to the characters between the first characteristic field and the second characteristic field.

[0127] The aforementioned rear adjacent position may be specifically understood as a region position with a rear interval of at most one byte.

[0128] The second characteristic field mentioned above may specifically be a field "where".

[0129] Based on the above embodiment, different situations can be distinguished during regular matching. When it is determined that there is no second feature identifier at the adjacent position behind the first feature field, the corresponding target table name and target field name can be determined efficiently and accurately by matching.

[0130] In specific implementation, the characters between the first feature field and the second feature field can be first determined and obtained; then, among the above characters, a fourth feature identifier (for example, the symbol ",") can be determined and used as a splitting basis to further split the above characters into multiple target table names and multiple target field names.

[0131] In some embodiments, see Figure 5 As shown, after detecting whether there is a second feature identifier at a position adjacent to the rear of the first feature field, the method may further include the following contents when implemented:

[0132] S1: when it is determined that there is a second feature identifier at a position adjacent to the rear of the first feature field, the second feature field is retrieved and located in the area code behind the first feature field;

[0133] S2: according to the second characteristic field, obtaining a characteristic code segment in a vicinity of the second characteristic field;

[0134] S3: Retrieve and determine, based on a third feature identifier in the feature code segment, whether the feature code segment meets a preset condition;

[0135] S4: When it is determined that the characteristic code segment meets the preset condition, the corresponding target table name and target field name are obtained and determined according to the characters at both ends of the third characteristic identifier.

[0136] The characteristic code segment in the vicinity of the second characteristic field may specifically be a code segment that is behind the second characteristic field and is within the scope of action of the second characteristic field.

[0137] The third characteristic identifier may specifically be a symbol “=”.

[0138] The above determination of whether the characteristic code segment satisfies the preset condition may include, when implemented specifically: detecting whether the right end of the third characteristic identifier is a single quotation mark, and whether the left end is a colon; and determining that the preset condition is satisfied when it is determined that the right end of the third characteristic identifier is not a single quotation mark, and the left end is not a colon.

[0139] Based on the above embodiment, different situations can be distinguished during regular matching. When it is determined that there is a second feature identifier at a position adjacent to the rear of the first feature field, the corresponding target table name and target field name can be determined efficiently and accurately by matching.

[0140] In specific implementation, different situations can be distinguished in the above manner to determine the corresponding target table name and target field name in other stage codes; and stored in the preset detection record table to obtain a preset detection record table that meets the requirements.

[0141] In some embodiments, the second system dictionary table may be adm_tab_columns. In specific implementation, the target database may be connected, and the second system dictionary table of the target database may be obtained by executing a corresponding SQL query instruction.

[0142] In some embodiments, the above-mentioned detection of whether there is an implicit conversion in the target database according to the preset detection rules, using the preset detection record table and the second system dictionary table, may include the following contents during specific implementation:

[0143] S1: According to the preset detection rules, using the target table name and target field name in the preset detection record table, querying the second system dictionary table to determine the corresponding first type field and second type field;

[0144] S2: Calculate the field difference value between the first type field and the second type field;

[0145] S3: When it is determined that the field difference value is greater than or equal to the preset difference threshold, it is determined that implicit conversion exists in the target database.

[0146] Based on the above embodiments, implicit conversions in the target database can be accurately detected and identified according to preset detection rules by jointly utilizing the preset detection record table and the second system dictionary table.

[0147] In specific implementation, according to preset detection rules, the target table name and target field name can be used to query the data value of the type field (for example, the data_type field) in the second system dictionary table to obtain the corresponding first type field and second type field.

[0148] Then, the field difference value between the first type field and the second type field is calculated. The field difference value is compared with the preset difference threshold to obtain the corresponding comparison result. The preset difference threshold can be a minimum value close to 0,

[0149] According to the comparison result, when it is determined that the field difference value is greater than or equal to the preset difference threshold, it can be determined that the first type field and the second type field are different, and then it can be determined that there is implicit conversion in the code at this stage, that is, there is implicit conversion in the target database.

[0150] On the contrary, according to the comparison result, when it is determined that the field difference value is less than the preset difference threshold, it can be determined that the first type field and the second type field are the same, and then it can be determined that there is no implicit conversion in the code of this stage. When it is determined that there is no implicit conversion in the code of all stages, it can be determined that there is no implicit conversion in the target database.

[0151] When implementing, if implicit conversion is determined, refer to Figure 6 As shown, an existence mark, for example, a number "1" can be set at the data value of the result type field (for example, the type field) of the row where the row number of the corresponding stored procedure code in the preset detection record table is located. On the contrary, when it is determined that there is no implicit conversion, an absence mark, for example, a number "0" can be set at the result type field of the row where the row number of the corresponding stored procedure code in the preset detection record table is located. In addition, through regular matching, the data value "tl_v1.0" can be set at the data value of pkg in the preset detection record table; the data value "83" can be set at the data value of pkgnum; the data value "mag_func_info" can be set at the data value of table; the data value "a" can be set at the data value of col, etc.

[0152] In some embodiments, the querying of the second system dictionary table to determine the corresponding first type field and second type field may include the following contents during specific implementation:

[0153] S1: According to the target table name and target field name in the preset detection record table, a corresponding second SQL query instruction is obtained by splicing;

[0154] S2: by executing the second SQL query instruction, query and obtain the corresponding data value from the second system dictionary table, and obtain the corresponding first type field and second type field.

[0155] Based on the above embodiment, the second system dictionary table can be efficiently queried to obtain the corresponding first type fields and second type fields by configuring and executing the corresponding second SQL query instruction.

[0156] In some embodiments, during specific implementation, when it is determined that an implicit conversion exists in the target database, the location information of the implicit conversion can be determined based on a preset detection record table; then, according to the preset processing rules and the location information of the implicit conversion, the implicit conversion in the target database is converted accordingly to obtain the converted target database and improve the performance of the target database.

[0157] In some embodiments, the above-mentioned corresponding conversion processing is performed according to the preset processing rules, and when implemented specifically, it may include the following contents:

[0158] S1: Get the target execution plan of the stored procedure of the target database;

[0159] S2: According to the preset processing rules and the target execution plan, in the first type field and the second type field of the second system dictionary table, determine the standard type field and the target type field;

[0160] S3: Convert the target type field in the second dictionary table into a corresponding standard type field.

[0161] The target execution plan matches the target database. Specifically, the target execution plan is an SQL-based execution plan associated with the kernel of the target database.

[0162] Based on the above embodiment, by acquiring and executing the plan according to the above target, the detected implicit conversion can be automatically processed efficiently and accurately to improve the performance of the target database.

[0163] In specific implementation, for example, according to preset processing rules and target execution plans, the second type field can be determined as a standard type field, and the first type field can be determined as a target type field; then, the data value of the first type field can be modified to the data value of the second type field based on the data value of the second type field.

[0164] In some embodiments, after performing corresponding conversion processing according to preset processing rules, the method may further include the following contents when implemented: performing business data processing involving target database storage procedures according to the converted target database.

[0165] In specific implementation, a business data processing request initiated by a user end can be received; according to the business data processing request, corresponding SQL instruction statements are executed to utilize the converted target database to complete the business data processing involving the target database storage procedure.

[0166] Based on the above embodiments, the converted target database can be used to efficiently complete the relevant business data processing and improve the overall data processing efficiency.

[0167] As can be seen from the above, based on the data processing method of the database provided in the embodiment of this specification, the first system dictionary table for recording the storage process information of the target database can be obtained first; according to the preset matching rules and the first system dictionary table, the corresponding target field can be obtained through regular matching; and the target field is stored in the preset detection record table; then the second system dictionary table for recording the field information of the target database can be obtained; according to the preset detection rules, the preset detection record table and the second system dictionary table are used to detect whether there is an implicit conversion in the target database; in the case of determining that there is an implicit conversion in the target database, the corresponding conversion processing is performed according to the preset processing rules. In this way, the implicit conversion in the database after the migration and conversion from the first type of database to the second type of database can be automatically detected and identified more efficiently and accurately; and the implicit conversion can be processed in a timely manner to improve the performance of the database, and then the business data processing involving the database can be completed more efficiently and accurately based on the converted database.

[0168] This specification also provides a server, which can be found at Figure 7 The server includes a network communication port 701, a processor 702 and a memory 703, and the above structures are connected through internal cables so that each structure can perform specific data interaction.

[0169] The network communication port 701 may be specifically used to receive an implicit conversion detection processing request.

[0170] The processor 702 can be specifically used to respond to an implicit conversion detection processing request and obtain a first system dictionary table of a target database; wherein the target database is a business database that is migrated from a first type of database to a second type of database through an automatic migration tool; the first system dictionary table is used to record storage process information of the target database; according to a preset matching rule and the first system dictionary table, the corresponding target field is obtained through regular matching; and the target field is stored in a preset detection record table; a second system dictionary table of the target database is obtained; wherein the second system dictionary table is used to record field information of the target database; according to the preset detection rule, using the preset detection record table and the second system dictionary table, it is detected whether there is an implicit conversion in the target database; when it is determined that the target database has an implicit conversion, corresponding conversion processing is performed according to the preset processing rule.

[0171] The memory 703 may be specifically used to store corresponding instruction programs.

[0172] In this embodiment, the network communication port 701 can be a virtual port that is bound to different communication protocols so that different data can be sent or received. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. In addition, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it can also be a Bluetooth chip.

[0173] In this embodiment, the processor 702 may be implemented in any appropriate manner. For example, the processor may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. This specification does not limit this.

[0174] In this embodiment, the memory 703 may include multiple levels. In a digital system, anything that can store binary data can be a memory; in an integrated circuit, a circuit with a storage function that has no physical form is also called a memory, such as RAM, FIFO, etc.; in a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.

[0175] The embodiment of the present specification also provides a computer-readable storage medium of the data processing method based on the above-mentioned database, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed, the following are implemented: obtaining a first system dictionary table of the target database; wherein the target database is a business database migrated from a first type of database to a second type of database through an automatic migration tool; the first system dictionary table is used to record the storage process information of the target database; according to the preset matching rules and the first system dictionary table, the corresponding target field is obtained through regular matching; and the target field is stored in a preset detection record table; obtaining a second system dictionary table of the target database; wherein the second system dictionary table is used to record the field information of the target database; according to the preset detection rules, using the preset detection record table and the second system dictionary table, detecting whether there is an implicit conversion in the target database; and when it is determined that there is an implicit conversion in the target database, performing corresponding conversion processing according to the preset processing rules.

[0176] In this embodiment, the storage medium includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a cache, a hard disk (HDD), or a memory card. The memory may be used to store computer program instructions. The network communication unit may be an interface for network connection communication set in accordance with the standard specified by the communication protocol.

[0177] In this embodiment, the functions and effects specifically implemented by the program instructions stored in the computer-readable storage medium can be explained in comparison with other implementations and will not be described in detail here.

[0178] The embodiment of the present specification also provides a computer program product, which at least includes a computer program, and when the computer program is executed by a processor, the following method steps are implemented: obtaining a first system dictionary table of a target database; wherein the target database is a business database migrated from a first type of database to a second type of database through an automatic migration tool; the first system dictionary table is used to record the storage process information of the target database; according to a preset matching rule and the first system dictionary table, the corresponding target field is obtained through regular matching; and the target field is stored in a preset detection record table; obtaining a second system dictionary table of the target database; wherein the second system dictionary table is used to record the field information of the target database; according to the preset detection rule, using the preset detection record table and the second system dictionary table, detecting whether there is an implicit conversion in the target database; when it is determined that the target database has an implicit conversion, performing corresponding conversion processing according to the preset processing rule.

[0179] See also Figure 8 As shown, the embodiment of this specification also provides a data processing device for a database, which may specifically include the following structural modules:

[0180] The first acquisition module 801 may be specifically used to acquire a first system dictionary table of a target database; wherein the target database is a business database that is migrated from a first type database to a second type database through an automatic migration tool; the first system dictionary table is used to record stored procedure information of the target database;

[0181] The matching module 802 may be specifically used to obtain the corresponding target field through regular matching according to the preset matching rule and the first system dictionary table; and store the target field in the preset detection record table;

[0182] The second acquisition module 803 may be specifically used to acquire a second system dictionary table of the target database; wherein the second system dictionary table is used to record field information of the target database;

[0183] The detection module 804 may be specifically configured to detect whether there is an implicit conversion in the target database according to a preset detection rule, using a preset detection record table and a second system dictionary table;

[0184] The processing module 805 may be specifically configured to perform corresponding conversion processing according to a preset processing rule when it is determined that the target database has implicit conversion.

[0185] In some embodiments, when the first acquisition module 801 is implemented, the first system dictionary table of the target database can be acquired in the following manner: connecting to the target database; and querying and acquiring the first system dictionary table of the target database by executing the corresponding first SQL query instruction.

[0186] In some embodiments, the target field may include at least: a stored procedure name, a target table name, a target field name, etc.

[0187] In some embodiments, when the above-mentioned matching module 802 is specifically implemented, the corresponding target field can be obtained by regular matching according to the preset matching rules and the first system dictionary table in the following manner: according to the first system dictionary table, the stored procedure source code of the target database is obtained; according to the stored procedure source code of the target database, the corresponding stored procedure name and the stored procedure body code are extracted; according to the stored procedure body code, the corresponding target program package body is determined; according to the preset matching rules, the corresponding target table name and target field name are obtained by regular matching the target program package body.

[0188] In some embodiments, when the matching module 802 is specifically implemented, the corresponding target table name and target field name can be obtained by performing regular matching on the target program package body according to the preset matching rules in the following manner: according to the preset matching rules, the first feature identifier in the target program package body is retrieved; according to the first feature identifier, the target program package body is divided into multiple stage codes; and the corresponding target table name and target field name are retrieved and determined according to the first feature field and the second feature identifier of each stage code in the multiple stage codes.

[0189] In some embodiments, when the above-mentioned matching module 802 is specifically implemented, the target table name and target field name corresponding to the current stage code in multiple stage codes can be determined in the following manner: in the current stage code, the first feature field is retrieved and located; whether the second feature identifier exists in the adjacent position behind the first feature field is detected; when it is determined that the second feature identifier does not exist in the adjacent position behind the first feature field, the second feature field is retrieved and located in the rear area code of the first feature field; and the corresponding target table name and target field name are obtained and determined based on the characters between the first feature field and the second feature field.

[0190] In some embodiments, after detecting whether there is a second feature identifier at a position adjacent to the rear of the first feature field, the matching module 802, when implemented, can also be used to: when it is determined that there is a second feature identifier at a position adjacent to the rear of the first feature field, retrieve and locate the second feature field in the rear area code of the first feature field; obtain a feature code segment within the adjacent range of the second feature field based on the second feature field; retrieve and determine whether the feature code segment meets a preset condition based on a third feature identifier in the feature code segment; when it is determined that the feature code segment meets the preset condition, obtain and determine the corresponding target table name and target field name based on the characters at both ends of the third feature identifier.

[0191] In some embodiments, when the above-mentioned detection module 804 is implemented, it can be detected whether there is an implicit conversion in the target database in the following manner according to the preset detection rules, using the preset detection record table and the second system dictionary table: according to the preset detection rules, using the target table name and the target field name in the preset detection record table, query the second system dictionary table to determine the corresponding first type field and second type field; calculate the field difference value between the first type field and the second type field; when it is determined that the field difference value is greater than or equal to the preset difference threshold, determine that there is an implicit conversion in the target database.

[0192] In some embodiments, when the above-mentioned detection module 804 is implemented, the second system dictionary table can be queried in the following manner to determine the corresponding first type fields and second type fields: according to the target table name and target field name in the preset detection record table, the corresponding second SQL query instruction is spliced ​​to obtain; by executing the second SQL query instruction, the corresponding data value is queried and obtained from the second system dictionary table to obtain the corresponding first type fields and second type fields.

[0193] In some embodiments, when the above-mentioned processing module 805 is implemented, corresponding conversion processing can be performed according to preset processing rules in the following manner: obtaining a target execution plan for the stored procedure of the target database; determining a standard type field and a target type field in the first type field and the second type field in the second system dictionary table according to preset processing rules and the target execution plan; and converting the target type field in the second dictionary table into a corresponding standard type field.

[0194] In some embodiments, after performing corresponding conversion processing according to preset processing rules, the device is further used in specific implementation to: perform business data processing involving target database storage procedures according to the converted target database.

[0195] It should be noted that the units, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions divided into various modules. Of course, when implementing this specification, the functions of each module can be implemented in the same or more software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0196] As can be seen from the above, the data processing device based on the database provided in the embodiment of this specification can automatically detect and identify the implicit conversion in the database after the migration and conversion of the first type of database to the second type of database more efficiently and accurately; and process the implicit conversion in a timely manner to improve the performance of the database, and then based on the converted database, it can complete the business data processing involving the database more efficiently and accurately.

[0197] In a specific scenario example, the database data processing method provided in this specification can be applied to implement Gaussian database execution plan implicit conversion detection. The specific implementation process can be found in the following content.

[0198] In this scenario, the platform previously used an Oracle database. During the business transformation process, the stored procedures were migrated from the Oracle database to the Gaussian database. At this time, it is necessary to perform implicit conversion detection on the Gaussian database (i.e., the target database) obtained after the conversion at the performance level.

[0199] Among them, the above-mentioned stored procedures can specifically be programs on the database. During the business transformation process, it is necessary to migrate the stored procedures from the Oracle database to the Gaussian database (using the ugo automatic migration tool). Since ugo can only perform syntax conversion to ensure functional consistency, it cannot guarantee performance. Therefore, in the table association query scenario, if the types defined by the two fields are inconsistent, the implicit conversion function of the database will be triggered and automatically converted to the same type. Oracle's stored procedure execution efficiency for this scenario is much higher than that of the Gaussian database. To prevent performance problems, based on the existing method, these programs need to be manually found and manually rewritten.

[0200] In this scenario example, see Fig. 9As shown, the data processing method of the database provided in this specification is used to construct a Gaussian database implicit conversion detection device, and the device is used to pull the stored procedure source code and regularly match the table associated part sql. The field structure is obtained for comparison to determine whether an implicit conversion process will occur.

[0201] The device is mainly divided into two parts: a program detection module 1 and a table structure detection module 2.

[0202] Specifically, the program detection module 1 can be a module for pulling the stored procedure source code and searching for the table association part sql by regular expression. In specific implementation, the source code of the stored procedure (or stored procedure source code), the stored procedure name pkgname and the stored procedure body part pkgbodydeclsrc field can be obtained from the Gaussian system dictionary table gs_package (for example, the first system dictionary table) by connecting to the database. Regular expression matching is performed on each program package body, and the rule is: in each package body, the semicolon ";" (first feature identifier) ​​is used as a stage, and the table name and table alias after from (first feature field) in each stage are recorded. If "(" (second feature identifier) ​​is after from, it is not recorded, and then the equal sign "=" (third feature identifier) ​​in the following where (second feature field) is searched for matching. When the right end of the equal sign is not a single quotation mark and the left end is not a colon, the field names on both sides of the equal sign are obtained and recorded.

[0203] When a record appears, the table structure detection module 2 searches the Gaussian dictionary table adm_tab_columns (for example, the second system dictionary table) by table_name (target table name) and column_name (target field name) to see whether the data_type field (for example, type field) is equal. If they are equal, the record is 0, indicating no implicit conversion; otherwise, the record is 1, indicating implicit conversion.

[0204] In specific implementation, for example, a part of the stored procedure source code can be obtained from gs_package. For another example, it can be divided by semicolons, for example, lines 83-85 are a stage, lines 86-109 are a stage, lines 110-111 are a stage, and lines 112-114 are a stage (multiple stage codes are obtained). Next, for example, lines 86-109 have from, and the first character after the first 91 lines is (, then ignore and continue to match the regular expression downward; after line 99, record the table name mag_func_info alias a, and the table name sys_dict_data alias b; then search for where, and match where from line 100; then start searching for =; record line 100, record the field func_code of table a, the field dict_code of table b, and record line number 100.

[0205] When the above method is used, a test record table sqlanalyze (for example, a preset test record table) is created and the test results are recorded. The fields in the table include: pkg, pkgnum, table, col, type. Their meanings are: stored name, stored body code line number, table name, field name, and whether implicit conversion is performed.

[0206] In specific implementation, whether implicit conversion occurs can be determined by comparing the above two results to see if they are equal. If they are equal, the type in the table is recorded as 0.

[0207] For specific implementation, see Fig.10 As shown, the program detection module 1 may include: a detection and recording module 21 , a program acquisition module 22 and a regularization module 23 .

[0208] Among them, the detection record module 21 is used to create and maintain a detection record table with the table name sqlanalyze and record the detection results. The fields in the table include: pkg, pkgnum, table, col, type; their meanings are: stored name, stored body code line number, table name, field name, and whether implicit conversion is performed.

[0209] Program acquisition module 22: This module first obtains the required information by connecting to the Gaussian database and executing the SQL command select pkgname,pkgbodydeclsrc from gs_package. Pkgname is the name of the stored procedure, and the content of the pkgbodydeclsrc column is the source code part of the stored procedure. Then, each stored source code part is traversed.

[0210] The specific traversal includes the following steps:

[0211] The traversal steps are:

[0212] 1 First, the regular module 23 is called to use the semicolon (;) as the regular character, traverse the source code, and obtain the line number position where the semicolon appears.

[0213] 2 Divide the source code by adjacent line numbers, and each semicolon is called a stage.

[0214] 3 Call the regular module 23 to traverse each stage according to the character from. When it matches, determine whether the next character is (. If it matches, ignore it. If not, continue.

[0215] 4 Call the regular expression module 23 to continue matching backward according to the character where, and continue from the current line number position if a match is found.

[0216] 5 Call the regular expression module 23 to continue matching backward according to the character =. When it matches =, if the previous character is a colon (:) or the next character is a single quotation mark ('), it is ignored, otherwise it is recorded.

[0217] For specific recording rules, please refer to the following examples:

[0218] 1 Write Pkgname to the pkg field of the sqlanalyze table.

[0219] 2 Write the current row number (the equal sign position) to the pkgnum field of the sqlanalyze table.

[0220] 3. Write the contents between from and where into the table field of the sqlanalyze table, and record them by key:value. For example, if:

[0221] FROM mag_func_info a,sys_dict_data b Where

[0222] The record is mag_func_info: a, sys_dict_data: b.

[0223] 4Record the contents around the equal sign to the col field of the sqlanalyze table, for example:

[0224] a.func_code=b.dict_code

[0225] The record is a.func_code, b.dict_code.

[0226] Regular module 23: has the function of regular matching function, the input parameter is a string or character, indicating the content to be matched, and the output parameter is 0 or 1. 0 means no match, and 1 means match.

[0227] For specific implementation, see Fig.11 As shown, the table structure detection module 2 may include: a table structure acquisition module 31 and a judgment and comparison module 32 .

[0228] Among them, the table structure acquisition module 31 is used to obtain the content of type being empty in the sqlanalyze table, and to splice the sql statement according to the table field and the col field. The splicing rules refer to the following example:

[0229] 1Get the col field, split it by comma, and get the content around the dot (.) of each part. The left side is the table alias, and the right side is the field name.

[0230] 2 Use the table alias in 1 to match the value in the table to obtain the key value.

[0231] 3 Splice out the sql:

[0232] select data_type from adm_tab_columns where table_name = (key value) and COLUMN_name = (field name).

[0233] By executing the above SQL, you can get two character type results respectively.

[0234] The judgment comparison module 32 updates the type field of the sqlanalyze table by comparing the results of the two character types to see whether they are consistent, and updates it to 0 if they are consistent, and updates it to 1 if they are inconsistent.

[0235] Through the above scenario examples, the database data processing method provided in this specification is verified. After the stored procedure is migrated from the Oracle database to the Gaussian database, in the scenario where the implicit conversion sql is not efficient, it can automatically detect, identify and discover implicit conversions, and improve the work quality and efficiency of the business transformation process. Among them, by obtaining dictionary tables such as gs_package and adm_tab_columns. The judgment is completed through source code analysis rules, regular matching rules, etc. A detection record table is established to record the detection scenarios and detection results through the table.

[0236] Although the present specification provides method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent a unique execution order. When the device or client product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. The first, second, etc. words are used to represent the name, and do not represent any particular order.

[0237] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.

[0238] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer-readable storage media including storage devices.

[0239] Through the description of the above embodiments, it can be known that those skilled in the art can clearly understand that the present specification can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present specification can essentially be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in each embodiment of the present specification or some parts of the embodiments.

[0240] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. This specification can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0241] Although the present specification is described through embodiments, those skilled in the art will appreciate that there are many modifications and changes to the present specification without departing from the spirit of the present specification, and it is intended that the appended claims include these modifications and changes without departing from the spirit of the present specification.

Claims

1. A method for processing data in a database, characterized in that: include: Acquire a first system dictionary table of a target database; wherein the target database is a business database that is migrated from a first type database to a second type database through an automatic migration tool; the first system dictionary table is used to record stored procedure information of the target database; According to the preset matching rules and the first system dictionary table, the corresponding target field is obtained through regular matching; and the target field is stored in the preset detection record table; Acquire a second system dictionary table of the target database; wherein the second system dictionary table is used to record field information of the target database; According to the preset detection rules, using the preset detection record table and the second system dictionary table, detect whether there is implicit conversion in the target database; When it is determined that the target database has implicit conversion, corresponding conversion processing is performed according to preset processing rules.

2. The method according to claim 1, characterized in that Get the first system dictionary table of the target database, including: Connect to the target database; and query and obtain the first system dictionary table of the target database by executing the corresponding first SQL query instruction.

3. The method according to claim 1, characterized in that The target field includes at least: a stored procedure name, a target table name, and a target field name.

4. The method according to claim 3, characterized in that According to the preset matching rules and the first system dictionary table, the corresponding target fields are obtained through regular matching, including: According to the first system dictionary table, obtaining the stored procedure source code of the target database; According to the stored procedure source code of the target database, the corresponding stored procedure name and the stored procedure body code are extracted; According to the main code of the stored procedure, determine the corresponding target program package body; According to the preset matching rules, the corresponding target table name and target field name are obtained by performing regular matching on the target package body.

5. The method according to claim 4, characterized in that According to the preset matching rules, the corresponding target table name and target field name are obtained by performing regular matching on the target package body, including: Retrieving the first characteristic identifier in the target program package body according to a preset matching rule; Dividing the target program package body into a plurality of stage codes according to the first feature identifier; The corresponding target table name and target field name are retrieved and determined according to the first characteristic field and the second characteristic identifier of each stage code in the plurality of stage codes.

6. The method according to claim 5, characterized in that Retrieving and determining the corresponding target table name and target field name according to the first characteristic field and the second characteristic identifier of each stage code in the plurality of stage codes, including: Determine the target table name and target field name corresponding to the current stage code among multiple stage codes in the following manner: In the current stage code, retrieve and locate the first feature field; Detecting whether there is a second feature identifier at a position adjacent to the rear of the first feature field; When it is determined that there is no second feature identifier at a position adjacent to the rear of the first feature field, the second feature field is retrieved and located in the area code behind the first feature field; The corresponding target table name and target field name are obtained and determined according to the characters between the first characteristic field and the second characteristic field.

7. The method according to claim 6, characterized in that After detecting whether there is a second feature identifier at a position adjacent to the rear of the first feature field, the method further includes: When it is determined that there is a second feature identifier at a position adjacent to the rear of the first feature field, the second feature field is retrieved and located in the area code behind the first feature field; According to the second characteristic field, obtaining a characteristic code segment in a vicinity of the second characteristic field; Retrieving and determining, based on a third feature identifier in the feature code segment, whether the feature code segment meets a preset condition; When it is determined that the characteristic code segment meets the preset condition, the corresponding target table name and target field name are obtained and determined according to the characters at both ends of the third characteristic identifier.

8. The method according to claim 2, characterized in that: According to the preset detection rules, using the preset detection record table and the second system dictionary table, detect whether there is implicit conversion in the target database, including: According to the preset detection rules, using the target table name and target field name in the preset detection record table, querying the second system dictionary table to determine the corresponding first type field and second type field; Calculate the field difference value between the first type field and the second type field; When it is determined that the field difference value is greater than or equal to the preset difference threshold, it is determined that implicit conversion exists in the target database.

9. The method according to claim 8, characterized in that The second system dictionary table is queried to determine corresponding first type fields and second type fields, including: According to the target table name and target field name in the preset detection record table, a corresponding second SQL query instruction is obtained by splicing; By executing the second SQL query instruction, the corresponding data value is queried and acquired from the second system dictionary table to obtain the corresponding first type field and second type field.

10. The method according to claim 1, characterized in that According to the preset processing rules, corresponding conversion processing is performed, including: Get the target execution plan of the stored procedure on the target database; According to the preset processing rules and the target execution plan, in the first type field and the second type field of the second system dictionary table, a standard type field and a target type field are determined; Convert the target type field in the second dictionary table to the corresponding standard type field.

11. The method according to claim 1, characterized in that: After performing corresponding conversion processing according to the preset processing rules, the method further includes: Based on the converted target database, business data processing involving the target database stored procedures is performed.

12. A data processing device for a database, characterized in that: include: A first acquisition module is used to acquire a first system dictionary table of a target database; wherein the target database is a business database that is migrated from a first type database to a second type database through an automatic migration tool; the first system dictionary table is used to record stored procedure information of the target database; A matching module, used to obtain the corresponding target field through regular matching according to the preset matching rules and the first system dictionary table; and store the target field in a preset detection record table; A second acquisition module is used to acquire a second system dictionary table of the target database; wherein the second system dictionary table is used to record field information of the target database; A detection module, used to detect whether there is an implicit conversion in the target database according to a preset detection rule, using a preset detection record table and a second system dictionary table; The processing module is used to perform corresponding conversion processing according to preset processing rules when it is determined that the target database has implicit conversion.

13. A server, characterized in that: The method comprises a processor and a memory for storing processor-executable instructions, wherein the processor implements the steps of the method according to any one of claims 1 to 11 when executing the instructions.

14. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

15. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 11 when being executed by a processor.