Database migration security testing method and device, storage medium and electronic equipment

By determining the capacity and function security control conditions of both the database to be migrated and the target database before migration, the security of database migration is ensured, solving the problems of insufficient capacity and function mismatch, and achieving safe and efficient data migration.

CN116483805BActive Publication Date: 2025-12-12INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310458053.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-25
Publication Date
2025-12-12
Estimated Expiration
2043-04-25

AI Technical Summary

Technical Problem

In existing technologies, the problem of database migration failure due to insufficient capacity of the target database to store migration data or mismatch between the migration data and the functions of the target database has not been effectively solved.

Method used

By obtaining the capacity of each data type and the security control conditions of functions in the database to be migrated and the target database, it is determined whether the capacity of the same type of data type is less than or equal to the capacity of the target database, and whether the security control conditions of the functions include the conditions of the database to be migrated. Database migration is only performed when all conditions are met.

Benefits of technology

This ensures the security of database migration, avoids migration failures due to insufficient capacity or function incompatibility, and improves the security and efficiency of data migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116483805B_ABST
    Figure CN116483805B_ABST
Patent Text Reader

Abstract

The application discloses a database migration security test method and device, a storage medium and an electronic device. It relates to the field of cloud computing, and comprises the following steps: obtaining the capacity configured for each data type in a database to be migrated to obtain a first capacity, and obtaining the first security control condition of each function; obtaining the capacity configured for each data type in a target database to obtain a second capacity, and obtaining the second security control condition of each function; determining whether the first capacity is less than or equal to the second capacity and whether the second security control condition contains the first security control condition; in the case that the first capacity is less than or equal to the second capacity and the second control condition contains the first control condition, determining that the security test is passed, and performing a data migration operation. Through the application, the problem that database migration fails due to the security problems that the capacity of the target database for storing the migrated data is insufficient or the functions of the migrated data and the target database do not match in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of cloud computing, in particular to a database migration security testing method and device, a storage medium and an electronic device. BACKGROUND

[0002] With the continuous development of the field of cloud computing, the amount of data is increasing, and the security problems generated by some enterprises when migrating databases in the enterprise are also increasing. In related technologies, there is usually no targeted security testing method for database migration and transformation. Instead, it mainly tests the interaction between the front end and the user. The database as part of the back end is not directly exposed to the user, so the database migration is usually only functionally tested, and no security testing is carried out. Although the database migration transformation only affects the database layer of the back end, improper migration process may still cause security problems, resulting in database migration failure.

[0003] In view of the problem that the database migration fails due to the insufficient capacity of the target database for storing migrated data or the mismatch between the migrated data and the functions of the target database in the related art, there is currently no effective solution. SUMMARY

[0004] The main purpose of the present application is to provide a database migration security testing method, device, storage medium and electronic device to solve the problem of database migration failure due to insufficient capacity of the target database for storing migrated data or mismatch between the migrated data and the functions of the target database in the related art.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a database migration security testing method is provided. The method comprises: obtaining the capacity configured for each data type in the database to be migrated to obtain the first capacity, and obtaining the first security control condition of each function for processing data in the database to be migrated, wherein the security control condition is the condition for limiting the function to process data in the database to be migrated; obtaining the capacity configured for each data type in the target database to obtain the second capacity, and obtaining the second security control condition of each function for processing data in the target database, wherein the target database is the database to which the data in the database to be migrated is migrated; determining whether the first capacity of the same type of data is less than or equal to the second capacity, and determining whether the second security control condition of the same type of function contains the first security control condition; in the case that the first capacity of all the same type of data is less than or equal to the second capacity, and the second control condition of all the same type of function contains the first control condition, it is determined that the security testing of the database migration is passed, and the operation of migrating the data in the database to be migrated to the target database is performed.

[0006] Optionally, determining whether the second security control condition of the same type of function contains the first security control condition comprises: obtaining a first parameter of a text type function and a second parameter of a time type function in the database to be migrated, wherein the text type function is a function for processing text type data, and the time type function is a function for processing time type data; obtaining a third parameter of a text type function and a fourth parameter of a time type function in the target database; determining whether the third parameter contains the first parameter and whether the fourth parameter contains the second parameter; in the case that the third parameter contains the first parameter and the fourth parameter contains the second parameter, determining that the second control condition of all the same type of functions contains the first control condition; in the case that the third parameter does not contain the first parameter and / or the fourth parameter does not contain the second parameter, determining that the second control condition of at least one type of function does not contain the first control condition.

[0007] Optionally, determining whether the first capacity of the same type of data is less than or equal to the second capacity comprises: determining the capacity of first data of a number type, the capacity of second data of a text type, and the capacity of third data of a time type in the database to be migrated; determining the capacity of fourth data of a number type, the capacity of fifth data of a text type, and the capacity of sixth data of a time type in the target database; determining whether the capacity of the first data is less than or equal to the capacity of the third data, whether the capacity of the second data is less than or equal to the capacity of the fourth data, and whether the capacity of the third data is less than or equal to the capacity of the sixth data; in the case that the capacity of the first data is less than or equal to the capacity of the fourth data, the capacity of the second data is less than or equal to the capacity of the fourth data, and the capacity of the third data is less than or equal to the capacity of the sixth data, determining that the first capacity of all the same type of data is less than or equal to the second capacity; in the case that the capacity of the first data is greater than the capacity of the fourth data, and / or the capacity of the second data is greater than the capacity of the fifth data, and / or the capacity of the third data is greater than the capacity of the sixth data, determining that the first capacity of at least one type of data is greater than the second capacity.

[0008] Optionally, after determining whether the first capacity of the same type of data is less than or equal to the second capacity and determining whether the second security control condition of the same type of function contains the first security control condition, the method further comprises: in the case that the second security control condition of at least one type of function does not contain the first security control condition, and / or the first capacity of at least one type of data is greater than the second capacity, determining that the security test of the database migration fails; issuing an alarm information prompting that the security test fails, and adjusting the migration process of the database migration.

[0009] Optionally, the migration process of the database migration is adjusted, including: determining a function whose second security control condition does not contain the first security control condition in a case that the second security control condition does not contain the first security control condition, obtaining an adjusted function, determining a target function type of the adjusted function, wherein the target function type at least includes a text type function and a time type function; determining a target function in the target database, and replacing the adjusted function with the target function, wherein a target parameter of the target function contains the first parameter or the second parameter; determining data whose first capacity is greater than a second capacity in a case that the first capacity of at least one type of data is greater than the second capacity, obtaining adjusted data, and determining a target data type of the adjusted data; determining a target data in the target database, and replacing the adjusted data with the target data, wherein a capacity of the target data is greater than or equal to a capacity of the first data, a capacity of the second data, or a capacity of the third data.

[0010] Optionally, before obtaining the first capacity configured for each data type in the database to be migrated, and obtaining the first security control condition of each function for processing data in the database to be migrated, the method further comprises: determining a plurality of databases that need to be migrated, determining a plurality of functions and a plurality of data types contained in each database, determining the security control condition of each function and the capacity of each data type; constructing a security test table based on the security control condition of each function and the capacity of each data type; and executing a security test method of the database migration based on the security test table.

[0011] Optionally, the operation of migrating the data in the database to be migrated to the target database comprises: migrating a database middleware of the database to be migrated to the target database; and replacing a data structure of the database to be migrated with a data structure of the target database.

[0012] In order to achieve the above object, according to another aspect of the present application, a device for security testing of database migration is provided. The device comprises: a first obtaining unit configured to obtain a capacity configured for each data type in a database to be migrated, to obtain a first capacity, and to obtain a first security control condition of each function for processing data in the database to be migrated, wherein the security control condition is a condition for limiting the function to process data in the database to be migrated; a second obtaining unit configured to obtain a capacity configured for each data type in a target database, to obtain a second capacity, and to obtain a second security control condition of each function for processing data in the target database, wherein the target database is a database to which data in the database to be migrated is migrated; a judging unit configured to judge whether the first capacity of the same type of data is less than or equal to the second capacity, and to judge whether the second security control condition of the same type of function contains the first security control condition; and an executing unit configured to determine that the security testing of the database migration is passed, and to execute an operation of migrating data in the database to be migrated to the target database, in a case that the first capacity of all the same type of data is less than or equal to the second capacity, and the second control condition of all the same type of function contains the first control condition.

[0013] By the present application, the following steps are adopted: obtaining a capacity configured for each data type in a database to be migrated, to obtain a first capacity, and obtaining a first security control condition of each function for processing data in the database to be migrated, wherein the security control condition is a condition for limiting the function to process data in the database to be migrated; obtaining a capacity configured for each data type in a target database, to obtain a second capacity, and obtaining a second security control condition of each function for processing data in the target database, wherein the target database is a database to which data in the database to be migrated is migrated; judging whether the first capacity of the same type of data is less than or equal to the second capacity, and judging whether the second security control condition of the same type of function contains the first security control condition; and determining that the security testing of the database migration is passed, and executing an operation of migrating data in the database to be migrated to the target database, in a case that the first capacity of all the same type of data is less than or equal to the second capacity, and the second control condition of all the same type of function contains the first control condition, thereby solving the problem of database migration failure due to the security problem that the capacity of the target database for storing the migrated data is insufficient, or the migrated data does not match the function of the target database. By performing the security testing on the database to be migrated, the security of the data migration is ensured. BRIEF DESCRIPTION OF DRAWINGS

[0014] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application and are incorporated herein for a purpose of explanations. The illustrative embodiments of the present application, together with their description, are introduced to explain the present application and are not intended to limit the present application unduly:

[0015] Figure 1is a flowchart of a method for testing the security of database migration according to an embodiment of the present application;

[0016] Figure 2 is a flowchart of a method for judging a security control condition according to an embodiment of the present application;

[0017] Figure 3 is a schematic diagram of a device for testing the security of database migration according to an embodiment of the present application;

[0018] Figure 4 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0019] It should be noted that the embodiments and features of the embodiments in the present application can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0020] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0021] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units need not be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0022] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties.

[0023] The present application will be described below in conjunction with the preferred implementation steps, Figure 1 is a flowchart of a method for testing the security of database migration according to an embodiment of the present application, as Figure 1 shown, the method comprises the following steps:

[0024] In step S101, the capacity configured for each data type in the database to be migrated is obtained to obtain a first capacity, and a first security control condition of each function processing data in the database to be migrated is obtained, wherein the security control condition is a condition for limiting the function to process data in the database to be migrated.

[0025] Specifically, the database to be migrated can be an Oracle database. For example, a financial institution needs to migrate data in an Oracle database to a target database Mysql to meet system requirements. Each database is configured with a capacity of different data types, for example, the Oracle database is configured with a capacity of storing 5 bytes of Number data for the Number data type. The capacity of the same data type configured in different databases can not be the same. In addition, each database is configured with different types of functions processing data, and each function is configured with a security control condition when processing data in the database. The function of the database needs to meet the security control condition to normally call data for processing. To ensure the normal migration of the database, security testing methods need to be tested in advance. There are two main categories of security problems caused by database migration. One is that the capacity of a certain data type configured in the target database is insufficient, and the other is that the security control condition of the function processing data in the target database is not suitable for the migrated data. Therefore, when performing security testing on database migration, the first capacity of each data type configured in the database to be migrated and the first security control condition of each function need to be obtained.

[0026] In step S102, the capacity configured for each data type in the target database is obtained to obtain a second capacity, and a second security control condition of each function processing data in the target database is obtained, wherein the target database is the database to which the data in the database to be migrated is migrated.

[0027] Specifically, after determining the first capacity of each data type configured in the database to be migrated and the first security control condition of each function, the second capacity of each data type configured in the target database to which the data is migrated needs to be determined, for example, the Mysql database is configured with a capacity of storing 10 bytes of Decimal data for the Decimal data type, and the second security control condition of each function needs to be determined.

[0028] In step S103, it is determined whether the first capacity of the same type of data is less than or equal to the second capacity, and whether the second security control condition of the same type of function contains the first security control condition.

[0029] Specifically, in order to ensure that the database migration is carried out normally, the target database and the database to be migrated need to avoid the security test problem, and therefore it is necessary to determine whether the first capacity of the same type of data is less than or equal to the second capacity and whether the second security control condition of the same type of function contains the first security control condition when the security test is carried out.

[0030] In step S104, in the case that the first capacity of all the same types of data is less than or equal to the second capacity and the second control condition of all the same types of functions contains the first control condition, it is determined that the security test of the database migration is passed, and an operation of migrating the data in the database to be migrated to the target database is performed.

[0031] Specifically, only when the second capacity configured for the same type of data in the target database is greater than the first capacity configured in the database to be migrated, the security problem of insufficient capacity of a certain type of data configured in the target database does not occur, and only when the second control condition set for the same type of function in the target database contains the first control condition set in the database to be migrated, the security problem of the security control condition of the function processing data in the target database not matching the migrated data does not occur. Therefore, when the first capacity of all the same types of data is less than or equal to the second capacity and the second control condition of all the same types of functions contains the first control condition, it is determined that the security test of the database migration is passed, and the operation of migrating the data in the database to be migrated to the target database can be performed.

[0032] The security test method for database migration provided by the embodiment of the present application obtains the capacity configured for each type of data in the database to be migrated to obtain the first capacity, and obtains the first security control condition of each type of function processing data in the database to be migrated, wherein the security control condition is a condition for limiting the function to process data in the database to be migrated. The capacity configured for each type of data in the target database is obtained to obtain the second capacity, and the second security control condition of each type of function processing data in the target database is obtained, wherein the target database is a database to which the data in the database to be migrated is migrated. It is determined whether the first capacity of the same type of data is less than or equal to the second capacity and whether the second security control condition of the same type of function contains the first security control condition. In the case that the first capacity of all the same types of data is less than or equal to the second capacity and the second control condition of all the same types of functions contains the first control condition, it is determined that the security test of the database migration is passed, and an operation of migrating the data in the database to be migrated to the target database is performed, thereby solving the problem that the database migration fails due to the security problem that the capacity of the target database for storing the migrated data is insufficient or the migrated data does not match the function of the target database. Through the security test on the database to be migrated, the effect of ensuring the security of data migration is achieved.

[0033] To avoid the security problem that the security control condition is not adapted to the migrated data, the parameters of various functions in the database to be migrated and the target database need to be compared. Optionally, in the security testing method for database migration provided in the embodiments of the present application, Figure 2 is a flowchart of the judgment method of the security control condition according to the embodiments of the present application, as shown in Figure 2 the judgment of whether the second security control condition of the same type of function contains the first security control condition includes:

[0034] In step S201, the first parameter of a text type function and the second parameter of a time type function in the database to be migrated are obtained, wherein the text type function is a function for processing text type data, and the time type function is a function for processing time type data.

[0035] In step S202, the third parameter of a text type function and the fourth parameter of a time type function in the target database are obtained.

[0036] In step S203, it is judged whether the third parameter contains the first parameter, and whether the fourth parameter contains the second parameter.

[0037] In step S204, in the case that the third parameter contains the first parameter and the fourth parameter contains the second parameter, it is determined that the second control condition of all the same type of functions contains the first control condition.

[0038] In step S205, in the case that the third parameter does not contain the first parameter and / or the fourth parameter does not contain the second parameter, it is determined that the second control condition of at least one type of function does not contain the first control condition.

[0039] Specifically, by scanning the programs in the database to be migrated and the target database, the program root directories of the database to be migrated and the target database are obtained. The parameters of various types of functions are extracted from the program root directories of the database to be migrated and the target database respectively, and it is judged whether the second control condition of each type of function contains the first control condition through the extracted parameters. The types of functions contained in the database are generally divided into two categories, one is a text type function for processing text type data, such as a concat function, and the other is a time type function for processing time type data, such as a datediff function. The security control conditions of the same type of function in different databases may be different. By judging whether the second control condition of the same type of function contains the first control condition, it is determined whether there is a security problem that the security control condition of the target database is not adapted to the migrated data in this database migration.

[0040] For example, the database to be migrated is Oracle, the target database is Mysql, the text type function in Oracle is the concat function, the security control condition (i.e., the first parameter) is that only two strings can be concatenated, the time type function in Oracle is the minus function, and the security control condition (i.e., the second parameter) is that a character type date cannot be converted. The text type function in Mysql is also the concat function, but the security control condition (i.e., the third parameter) of the concat function of Mysql is that multiple strings can be concatenated, the time type function in Mysql is the datediff function, and the security control condition (i.e., the fourth parameter) is that a character type date can be converted. At this time, it is indicated that the third parameter of Mysql contains the first parameter of Oracle, and the fourth parameter of Mysql contains the second parameter of Oracle, the second control condition of all similar functions contains the first control condition, and if the database to be migrated is Mysql and the target database is Oracle, then the third parameter of Oracle does not contain the first parameter of Mysql, the fourth parameter of Oracle does not contain the second parameter of Mysql, and the second control condition of all similar functions does not contain the first control condition.

[0041] To avoid the security problem of insufficient capacity of a certain data type configuration in the target database, the capacity of various data type configurations in the database to be migrated and the target database needs to be compared. Optionally, in the security testing method for database migration provided in the embodiments of the present application, determining whether the first capacity of the same type of data is less than or equal to the second capacity includes: determining the capacity of the first data of the number type, the capacity of the second data of the text type, and the capacity of the third data of the time type configured in the database to be migrated; determining the capacity of the fourth data of the number type, the capacity of the fifth data of the text type, and the capacity of the sixth data of the time type configured in the target database; determining whether the capacity of the first data is less than or equal to the capacity of the third data, whether the capacity of the second data is less than or equal to the capacity of the fourth data, and whether the capacity of the third data is less than or equal to the capacity of the sixth data; in the case that the capacity of the first data is less than or equal to the capacity of the fourth data, the capacity of the second data is less than or equal to the capacity of the fourth data, and the capacity of the third data is less than or equal to the capacity of the sixth data, it is determined that the first capacity of all similar data types is less than or equal to the second capacity; in the case that the capacity of the first data is greater than the capacity of the fourth data, and / or the capacity of the second data is greater than the capacity of the fifth data, and / or the capacity of the third data is greater than the capacity of the sixth data, it is determined that the first capacity of at least one type of data is greater than the second capacity.

[0042] Specifically, the capacity of various data type configurations in the to-be-migrated database and the target database is determined by scanning the data connection, the mapping relationship between tables and fields of the to-be-migrated database and the target database. By comparing the capacity of different data of the same type of data type configured in the to-be-migrated database and the target database, it is determined whether the first capacity of the same type of data type is less than or equal to the second capacity. The data types contained in the database generally include numerical types, text types and time types. The corresponding data of each data type in different databases may be different, for example, the data of the numerical type in Oracle is Number, and the data of the numerical type in Mysql is Decimal. By comparing the capacity of Number and Decimal, it is determined whether the first capacity of the numerical type configuration is less than or equal to the second capacity. By judging whether the first capacity of the same type of data type is less than or equal to the second capacity, it is determined whether there is a security problem of insufficient capacity of a certain data type configuration in the target database in this database migration.

[0043] For example, the to-be-migrated database is Oracle, the target database is Mysql, the first data is Number, the capacity of the first data is 5 bytes, the second data is varchar2, the capacity of the second data is 10 bytes, the third data is date, the capacity of the third data is 8 bytes, the fourth data is Decimal, the capacity of the fourth data is also 5 bytes, the fifth data is varchar, the capacity of the fifth data is 15 bytes, and the sixth data is timestamp, the capacity of the sixth data is 10 bytes. Since the capacity of the first data 5 bytes is equal to the capacity of the fourth data 5 bytes, the capacity of the second data 10 bytes is less than the capacity of the fifth data 15 bytes, and the capacity of the third data 8 bytes is less than the capacity of the sixth data 10 bytes, it is indicated that the first capacity of all the same type of data is less than or equal to the second capacity. If the to-be-migrated database is Mysql and the target database is Oracle, then at least there is a type of data whose first capacity is greater than the second capacity.

[0044] It should be noted that the data of the numerical type is further divided into scientific type, integer type and floating point type, and the data of the text type is further divided into fixed length type, variable length type and super long type. The data of the time type is further divided into time type and date type. When comparing the capacities of the same type of data, the comparison is based on the most fine same type of data.

[0045] The security test of the data migration also fails. Optionally, in the method for testing the security of database migration provided in the embodiments of the present application, after judging whether the first capacity of the same type of data is less than or equal to the second capacity and whether the second security control condition of the same type of function contains the first security control condition, the method further includes: determining that the security test of the database migration fails, in the case that the second security control condition of at least one type of function does not contain the first security control condition and / or the first capacity of at least one type of data is greater than the second capacity; issuing an alarm information prompting that the security test fails, and adjusting the migration process of the database migration.

[0046] Specifically, if the security test of the current database migration detects that the second security control condition of at least one type of function does not contain the first security control condition and / or the first capacity of at least one type of data is greater than the second capacity, an alarm information prompting that the security test fails needs to be issued to the operation and maintenance personnel, so as to prompt the operation and maintenance personnel to adjust the migration process of the database migration, thereby avoiding the migration loss caused by directly performing the database migration without solving the security problem.

[0047] After determining that the current database migration has a security problem, the migration process is adjusted according to different problems. Optionally, in the method for testing the security of database migration provided in the embodiments of the present application, adjusting the migration process of the database migration includes: in the case that the second security control condition of at least one type of function does not contain the first security control condition, determining the function whose second security control condition does not contain the first security control condition to obtain a function to be adjusted, and determining a target function type of the function to be adjusted, wherein the target function type at least includes a text type function and a time type function; determining a target function in the target database, and replacing the function to be adjusted with the target function, wherein a target parameter of the target function contains the first parameter or the second parameter; in the case that the first capacity of at least one type of data is greater than the second capacity, determining the data whose first capacity is greater than the second capacity to obtain data to be adjusted, and determining a target data type of the data to be adjusted; determining a target data in the target database, and replacing the data to be adjusted with the target data, wherein the capacity of the target data is greater than or equal to the capacity of the first data, the capacity of the second data or the capacity of the third data.

[0048] Specifically, if the second security control condition of at least one type of function does not contain the first security control condition, that is, there is a security problem that the security control condition of the target database does not match the migrated data, only the function to be adjusted in the target database that does not match needs to be adjusted to the target function that matches. If the first capacity of at least one type of data is greater than the second capacity, that is, there is a security problem that the capacity of a certain type of data configured in the target database is insufficient. Only the data to be adjusted with insufficient capacity needs to be adjusted to the target data with sufficient capacity. The target function and the target data can be obtained by querying the security test table. By adjusting the migration process of the database migration that has a security problem in time, the safety of the database migration is ensured, the time cost of directly migrating data and causing a security problem is avoided, and the migration efficiency is improved.

[0049] The specific judgment standard of the database migration security test method can be executed based on the pre-constructed security test table. Optionally, in the database migration security test method provided in the embodiments of the present application, before obtaining the capacity configured for each type of data in the database to be migrated to obtain the first capacity, and obtaining the first security control condition of each function for processing data in the database to be migrated, the method further comprises: determining a plurality of databases that need to be migrated, determining a plurality of functions and a plurality of data types contained in each database, determining the security control condition of each function and the capacity of each data type; constructing a security test table based on the security control condition of each function and the capacity of each data type; and executing the database migration security test method based on the security test table.

[0050] Specifically, the capacity of each type of data and the security control condition of each function of each database are manually pre-established to establish the order of the included relationship of the security test execution table, and then the database migration security test method is executed based on the security test table. For example, Table 1 is the security test table in the embodiments of the present application.

[0051] Table 1

[0052]

[0053]

[0054] After the security test is passed, the operation of performing database migration is executed. Optionally, in the database migration security test method provided in the embodiments of the present application, the operation of migrating the data in the database to be migrated to the target database comprises: migrating the database middleware of the database to be migrated to the target database; and replacing the data structure of the database to be migrated with the data structure of the target database.

[0055] Specifically, database migration is mainly divided into two categories: one is the migration of database middleware, such as migrating the database middleware of Oracle to Mysql, and the other is the migration of the data structure in the database, such as the data structure in Oracle is a table, and the data structure in Mysql is multiple tables, and the data in the table in Oracle needs to be split into multiple tables in Mysql.

[0056] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.

[0057] The embodiment of the present application also provides a database migration security testing device. It should be noted that the database migration security testing device of the embodiment of the present application can be used to execute the security testing method for database migration provided by the embodiment of the present application. The database migration security testing device provided by the embodiment of the present application is introduced as follows.

[0058] Figure 3 is a schematic diagram of the database migration security testing device provided by the embodiment of the present application. As shown in Figure 3 the device comprises:

[0059] The first acquisition unit 10 is configured to acquire the capacity configured for each data type in the database to be migrated to obtain a first capacity, and acquire a first security control condition of each function for processing data in the database to be migrated, wherein the security control condition is a condition for limiting the function to process data in the database to be migrated.

[0060] The second acquisition unit 20 is configured to acquire the capacity configured for each data type in the target database to obtain a second capacity, and acquire a second security control condition of each function for processing data in the target database, wherein the target database is a database to which the data in the database to be migrated is migrated.

[0061] The judgment unit 30 is configured to judge whether the first capacity of the same type of data is less than or equal to the second capacity, and judge whether the second security control condition of the same type of function contains the first security control condition.

[0062] The execution unit 40 is configured to determine that the security test of the database migration is passed and execute the operation of migrating the data in the database to be migrated to the target database in the case that the first capacity of all the same type of data is less than or equal to the second capacity, and the second control condition of all the same type of function contains the first control condition.

[0063] The database migration security testing device provided in the embodiments of the present application obtains the capacity configured for each data type in the to-be-migrated database through the first obtaining unit 10 to obtain a first capacity, and obtains a first security control condition of each function for processing data in the to-be-migrated database, wherein the security control condition is a condition for limiting the function to process data in the to-be-migrated database; the second obtaining unit 20 obtains the capacity configured for each data type in the target database to obtain a second capacity, and obtains a second security control condition of each function for processing data in the target database, wherein the target database is a database to which the data in the to-be-migrated database is migrated; the judging unit 30 judges whether the first capacity of the same type of data is less than or equal to the second capacity, and judges whether the second security control condition of the same type of function contains the first security control condition; the executing unit 40 determines that the security test of the database migration is passed and performs the operation of migrating the data in the to-be-migrated database to the target database in the case that the first capacity of all the same types of data is less than or equal to the second capacity and the second control condition of all the same types of functions contains the first control condition, thereby solving the problem that the database migration fails due to the insufficient capacity of the target database for storing the migrated data or the security problem that the migrated data does not match the function of the target database, and further achieving the effect of guaranteeing the security of the data migration by performing the security test on the database that needs to be migrated.

[0064] Optionally, in the database migration security testing device provided in the embodiments of the present application, the judging unit 30 comprises: a first obtaining module, configured to obtain the first parameter of the text type function and the second parameter of the time type function in the to-be-migrated database, wherein the text type function is a function for processing text type data, and the time type function is a function for processing time type data; a second obtaining module, configured to obtain the third parameter of the text type function and the fourth parameter of the time type function in the target database; a first judging module, configured to judge whether the third parameter contains the first parameter and whether the fourth parameter contains the second parameter; a first determining module, configured to determine that the second control condition of all the same types of functions contains the first control condition in the case that the third parameter contains the first parameter and the fourth parameter contains the second parameter; and a second determining module, configured to determine that the second control condition of at least one type of function does not contain the first control condition in the case that the third parameter does not contain the first parameter and / or the fourth parameter does not contain the second parameter.

[0065] Optionally, in the database migration security testing device provided by the embodiment of the present application, the judging unit 30 comprises: a third determining module, configured to determine the capacity of the first data of the digital type, the capacity of the second data of the text type, and the capacity of the third data of the time type configured in the database to be migrated; a fourth determining module, configured to determine the capacity of the fourth data of the digital type, the capacity of the fifth data of the text type, and the capacity of the sixth data of the time type configured in the target database; a second judging module, configured to judge whether the capacity of the first data is less than or equal to the capacity of the third data, whether the capacity of the second data is less than or equal to the capacity of the fourth data, and whether the capacity of the third data is less than or equal to the capacity of the sixth data; a fifth determining module, configured to determine that the first capacity of all the same data types is less than or equal to the second capacity in the case that the capacity of the first data is less than or equal to the capacity of the fourth data, the capacity of the second data is less than or equal to the capacity of the fourth data, and the capacity of the third data is less than or equal to the capacity of the sixth data; and a sixth determining module, configured to determine that the first capacity of at least one type of data is greater than the second capacity in the case that the capacity of the first data is greater than the capacity of the fourth data, and / or the capacity of the second data is greater than the capacity of the fifth data, and / or the capacity of the third data is greater than the capacity of the sixth data.

[0066] Optionally, in the database migration security testing device provided by the embodiment of the present application, the device further comprises: a first determining unit, configured to determine that the database migration security testing fails in the case that the second security control condition of at least one type of function does not contain the first security control condition, and / or the first capacity of at least one type of data is greater than the second capacity; and an adjusting unit, configured to issue an alarm information prompting that the security testing fails, and adjust the migration process of the database migration.

[0067] Optionally, in the database migration security testing device provided by the embodiment of the present application, the adjusting unit comprises: a seventh determining module, configured to determine the function whose second security control condition does not contain the first security control condition in the case that the second security control condition of at least one type of function does not contain the first security control condition, to obtain the function to be adjusted, and determine the target function type of the function to be adjusted, wherein the target function type at least comprises a text type function and a time type function; a first replacing module, configured to determine the target function in the target database, and replace the function to be adjusted with the target function, wherein the target parameter of the target function contains the first parameter or the second parameter; an eighth determining module, configured to determine the data whose first capacity is greater than the second capacity in the case that the first capacity of at least one type of data is greater than the second capacity, to obtain the data to be adjusted, and determine the target data type of the data to be adjusted; and a second replacing module, configured to determine the target data in the target database, and replace the data to be adjusted with the target data, wherein the capacity of the target data is greater than or equal to the capacity of the first data, the capacity of the second data, or the capacity of the third data.

[0068] Optionally, in the database migration security testing device provided by the embodiment of the application, the device further comprises a second determination unit configured to determine a plurality of databases requiring database migration, determine a plurality of functions and a plurality of data types contained in each database, determine a security control condition of each function and a capacity of each data type; a construction unit configured to construct a security testing table based on the security control condition of each function and the capacity of each data type; and a security testing execution unit configured to execute a database migration security testing method based on the security testing table.

[0069] Optionally, in the database migration security testing device provided by the embodiment of the application, the execution unit 40 comprises a first migration module configured to migrate a database middleware of a database to be migrated to a target database; and a second migration module configured to replace a data structure of the database to be migrated with a data structure of the target database.

[0070] The database migration security testing device comprises a processor and a memory, and the first acquisition unit 10, the second acquisition unit 20, the judgment unit 30 and the execution unit 40 are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.

[0071] The processor comprises a core, and the core retrieves the corresponding program units from the memory. The core can be one or more, and the safety of data migration is ensured by adjusting the core parameters.

[0072] The memory can include a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory comprises at least one memory chip.

[0073] The embodiment of the application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to realize the database migration security testing method.

[0074] The embodiment of the application provides a processor, which is used to run a program, and the program is executed to realize the database migration security testing method.

[0075] Figure 4 is a schematic diagram of an electronic device provided by the embodiment of the application. As shown in Figure 4 The electronic device 401 comprises a processor, a memory and a program stored in the memory and executable on the processor, and the processor executes the program to realize the following steps: the database migration security testing method. The device herein can be a server, a PC, a PAD, a mobile phone or the like.

[0076] The present application also provides a computer program product adapted to perform, when implemented on a data processing device, the steps of a method for security testing of database migration.

[0077] It is appreciated that embodiments of the present application can be implemented by various means, for example in hardware, software, or a combination thereof. In this regard, embodiments of the present application can be implemented by one or more computer programs or one or more programs of instructions configured to carry out the procedures of embodiments of the present application on various system components, such as a computer memory. Program instructions can be software programming code, routines, functions, objects, data structures, and / or the like. The embodiments of the present application can also be implemented by programmable logic and / or electrical circuits or hardware, for example as opposed to software implemented instructions.

[0078] The present application is described in reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present application. It is understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing device or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, create means for implementing the functions specified in the flowcharts and / or block diagrams block or blocks. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the function specified by the flow or flows and / or block or blocks.

[0079] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flowcharts and / or block diagrams flow or flows and / or block or blocks. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the function specified by the flow or flows and / or block or blocks.

[0080] These computer program instructions can also be loaded onto a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the flowcharts and / or block diagrams flow or flows and / or block or blocks. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the function specified by the flow or flows and / or block or blocks.

[0081] In one typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0082] Memory can include non-persistent memory, Random Access Memory (RAM), and / or non-volatile memory, such as read only memory (ROM) or flash memory, etc., in a computer readable medium. Memory is an example of computer readable media.

[0083] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.

[0084] It should also be noted that the terms "comprising," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements in the list, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0085] Those skilled in the art will understand that embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product embodied in one or more computer usable storage medium (including but not limited to disk memory, CD-ROM, optical storage etc.) having computer usable program code embodied therein.

[0086] The above merely provides an example of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.

Claims

1. A method of security testing of database migration, characterized in that, The method comprises the following steps: obtaining a first capacity configured for each data type in a to-be-migrated database, and obtaining a first security control condition of each function for processing data in the to-be-migrated database, wherein the security control condition is a condition for limiting the function to process data in the to-be-migrated database; obtaining a second capacity configured for each data type in a target database, and obtaining a second security control condition of each function for processing data in the target database, wherein the target database is a database to which data in the to-be-migrated database is migrated; determining whether the first capacity of the same type of data is less than or equal to the second capacity, and determining whether the second security control condition of the same type of function contains the first security control condition; in the case that the first capacity of all the same types of data is less than or equal to the second capacity, and the second control condition of all the same types of functions contains the first control condition, determining that the safety test of the database migration is passed, and performing an operation of migrating data in the to-be-migrated database to the target database; in the case that at least one type of function has a second security control condition that does not contain the first security control condition, and / or at least one type of data has a first capacity that is greater than the second capacity, determining that the safety test of the database migration is not passed; issuing an alarm information prompting that the safety test is not passed, and adjusting the migration process of the database migration; wherein adjusting the migration process of the database migration comprises: in the case that at least one type of function has a second security control condition that does not contain the first security control condition, determining the function whose second security control condition does not contain the first security control condition to obtain a to-be-adjusted function, and determining a target function type of the to-be-adjusted function, wherein the target function type at least includes a text type function and a time type function; determining a target function in the target database, and replacing the to-be-adjusted function with the target function, wherein a target parameter of the target function contains a first parameter or a second parameter, the first parameter is a parameter of a text type function, and the second parameter is a parameter of a time type function; in the case that at least one type of data has a first capacity that is greater than the second capacity, determining the data whose first capacity is greater than the second capacity to obtain to-be-adjusted data, and determining a target data type of the to-be-adjusted data; determining a target data in the target database, and replacing the to-be-adjusted data with the target data, wherein the capacity of the target data is greater than or equal to the capacity of the first data, the capacity of the second data or the capacity of the third data, the capacity of the first data is the capacity of the data of the number type in the to-be-migrated database, the capacity of the second data is the capacity of the data of the text type in the to-be-migrated database, and the capacity of the third data is the capacity of the data of the time type in the to-be-migrated database.

2. The method of claim 1, wherein, determining whether the second security control condition of the same type of function contains the first security control condition comprises: obtaining a first parameter of a text type function and a second parameter of a time type function in the to-be-migrated database, wherein the text type function is a function for processing text type data, and the time type function is a function for processing time type data; obtaining a third parameter of a text type function and a fourth parameter of a time type function in the target database; determining whether the third parameter contains the first parameter and whether the fourth parameter contains the second parameter; in a case where the third parameter contains the first parameter and the fourth parameter contains the second parameter, determining that the second control condition of all functions of the same type contains the first control condition; in a case where the third parameter does not contain the first parameter and / or the fourth parameter does not contain the second parameter, determining that the second control condition of at least one type of function does not contain the first control condition.

3. The method of claim 1, wherein, determining whether the first capacity of the same type of data is less than or equal to the second capacity comprises: determining a capacity of first data of a number type, a capacity of second data of a text type, and a capacity of third data of a time type in the to-be-migrated database; determining a capacity of fourth data of a number type, a capacity of fifth data of a text type, and a capacity of sixth data of a time type in the target database; determining whether the capacity of the first data is less than or equal to the capacity of the third data, whether the capacity of the second data is less than or equal to the capacity of the fourth data, and whether the capacity of the third data is less than or equal to the capacity of the sixth data; in a case where the capacity of the first data is less than or equal to the capacity of the fourth data, the capacity of the second data is less than or equal to the capacity of the fourth data, and the capacity of the third data is less than or equal to the capacity of the sixth data, determining that the first capacity of all the same types of data is less than or equal to the second capacity; in a case where the capacity of the first data is greater than the capacity of the fourth data, and / or the capacity of the second data is greater than the capacity of the fifth data, and / or the capacity of the third data is greater than the capacity of the sixth data, determining that the first capacity of at least one type of data is greater than the second capacity.

4. The method of claim 1, wherein, Before obtaining the first capacity of the capacity configured for each type of data in the to-be-migrated database, and obtaining the first security control condition of each function for processing data in the to-be-migrated database, the method further comprises: determining a plurality of databases that need to be migrated, determining a plurality of functions and a plurality of data types contained in each database, determining the security control condition of each function and the capacity of each data type; constructing a security test table based on the security control condition of each function and the capacity of each data type; performing a security test method for database migration based on the security test table.

5. The method of claim 1, wherein, performing the operation of migrating the data in the to-be-migrated database to the target database comprises: migrating the database middleware of the to-be-migrated database to the target database; replacing the data structure of the to-be-migrated database with the data structure of the target database.

6. An apparatus for security testing of database migration, characterized by comprises: The first obtaining unit is configured to obtain a capacity configured for each data type in a to-be-migrated database to obtain a first capacity, and obtain a first security control condition of each function for processing data in the to-be-migrated database, wherein the security control condition is a condition for limiting the function to process data in the to-be-migrated database; The second obtaining unit is configured to obtain a capacity configured for each data type in a target database to obtain a second capacity, and obtain a second security control condition of each function for processing data in the target database, wherein the target database is a database to which data in the to-be-migrated database is migrated; The judging unit is configured to judge whether the first capacity of the same type of data is less than or equal to the second capacity, and judge whether the second security control condition of the same type of function contains the first security control condition; The executing unit is configured to determine that a security test of database migration is passed, and perform an operation of migrating data in the to-be-migrated database to the target database, in a case that the first capacity of all the same types of data is less than or equal to the second capacity, and the second control condition of all the same types of functions contains the first control condition; The first determining unit is configured to determine that the security test of database migration is not passed, in a case that the second security control condition of at least one type of function does not contain the first security control condition, and / or the first capacity of at least one type of data is greater than the second capacity; and the adjusting unit is configured to issue alarm information prompting that the security test is not passed, and adjust a migration process of the database migration. The adjusting unit includes: a seventh determining module configured to determine a function whose second security control condition does not contain the first security control condition, to obtain a to-be-adjusted function, and determine a target function type of the to-be-adjusted function, in a case that the second security control condition of at least one type of function does not contain the first security control condition, wherein the target function type at least includes a text type function and a time type function; a first replacing module configured to determine a target function in the target database, and replace the to-be-adjusted function with the target function, wherein a target parameter of the target function contains a first parameter or a second parameter, the first parameter is a parameter of the text type function, and the second parameter is a parameter of the time type function; an eighth determining module configured to determine data whose first capacity is greater than the second capacity to obtain to-be-adjusted data, and determine a target data type of the to-be-adjusted data, in a case that the first capacity of at least one type of data is greater than the second capacity; and a second replacing module configured to determine a target data in the target database, and replace the to-be-adjusted data with the target data, wherein a capacity of the target data is greater than or equal to a capacity of first data, a capacity of second data or a capacity of third data, the capacity of the first data is a capacity of numerical type data in the to-be-migrated database, the capacity of the second data is a capacity of text type data in the to-be-migrated database, and the capacity of the third data is a capacity of time type data in the to-be-migrated database.

7. A non-volatile storage medium, characterized by The non-volatile storage medium comprises a stored program, wherein the program controls a device in which the non-volatile storage medium is located to perform the database migration security testing method of any one of claims 1 to 5 when the program is executed.

8. An electronic device, comprising: The device comprises one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the database migration security testing method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data migration method and device, computer equipment and storage medium

    CN110297813A

  • Data conversion method and device, server and storage medium

    CN114416847A