[go: up one dir, main page]

CN118394736A - Database replacement method, device, medium and computing equipment - Google Patents

Database replacement method, device, medium and computing equipment Download PDF

Info

Publication number
CN118394736A
CN118394736A CN202410458492.2A CN202410458492A CN118394736A CN 118394736 A CN118394736 A CN 118394736A CN 202410458492 A CN202410458492 A CN 202410458492A CN 118394736 A CN118394736 A CN 118394736A
Authority
CN
China
Prior art keywords
database
target
replacement
layer
test environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410458492.2A
Other languages
Chinese (zh)
Inventor
王晋
李逢雪
陈洪钢
王海龙
冯志龙
陶艺
梅杰
郭强
汤健
吴亮
刘旭
张嘉荣
索郎旺杰
虞润泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Civil Aviation Electronic Technology Co ltd
Original Assignee
Civil Aviation Electronic Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Civil Aviation Electronic Technology Co ltd filed Critical Civil Aviation Electronic Technology Co ltd
Publication of CN118394736A publication Critical patent/CN118394736A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/214Database migration support
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3698Environments for analysis, debugging or testing of software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a database replacement method, a device, a medium and a computing device, wherein the method comprises the following steps: based on the user requirements and the application scene of the source database, constructing a test environment; performing function verification and system verification on a pre-established target database based on the built test environment; in the process of performing function verification and system verification on the target database, adjusting a database layer and an interface layer of the target database to obtain a target replacement database; and replacing the source database with the target replacement database. The application aims to solve the technical problem of low database replacement efficiency.

Description

一种数据库替换方法、装置、介质和计算设备A database replacement method, device, medium and computing equipment

技术领域Technical Field

本申请涉及数据库技术领域,尤其涉及一种数据库替换方法、装置、介质和计算设备。The present application relates to the field of database technology, and in particular to a database replacement method, apparatus, medium and computing device.

背景技术Background technique

随着信息技术不断发展,很多企业都在数据库中存储了海量数据。这些数据给企业的发展带来便利的同时,也出现了一些挑战,比如数据的存储、管理、日常运维等。出于对数据库的性能、存储空间、稳定性等各方面的考虑,往往需要进行数据库替换,即,将源端数据库从第一服务器系统迁移到第二服务器系统。在数据库替换的过程中,通常要长时间的暂停连接源端数据库的生产应用,导致数据库替换效率低,给用户的正常使用带来较大影响。With the continuous development of information technology, many companies have stored massive amounts of data in their databases. While these data bring convenience to the development of enterprises, they also present some challenges, such as data storage, management, and daily operation and maintenance. Considering the performance, storage space, and stability of the database, it is often necessary to replace the database, that is, to migrate the source database from the first server system to the second server system. During the database replacement process, production applications connected to the source database are usually suspended for a long time, resulting in low database replacement efficiency and a significant impact on the normal use of users.

上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art.

发明内容Summary of the invention

本申请的主要目的在于提供一种数据库替换方法、装置、介质和计算设备,旨在解决数据库替换效率低的技术问题。The main purpose of the present application is to provide a database replacement method, apparatus, medium and computing device, aiming to solve the technical problem of low database replacement efficiency.

为实现上述目的,本申请提供一种数据库替换方法,所述方法包括:基于用户需求以及源数据库的应用场景,搭建测试环境;基于搭建的所述测试环境,对预先创建的目标数据库进行功能验证和系统验证;在对所述目标数据库进行功能验证和系统验证的过程中,对所述目标数据库的数据库层与接口层进行调整,得到目标替换数据库;将所述源数据库替换成所述目标替换数据库。To achieve the above-mentioned purpose, the present application provides a database replacement method, which includes: building a test environment based on user needs and application scenarios of a source database; performing functional verification and system verification on a pre-created target database based on the built test environment; in the process of performing functional verification and system verification on the target database, adjusting the database layer and interface layer of the target database to obtain a target replacement database; and replacing the source database with the target replacement database.

可选地,所述基于搭建的所述测试环境,对预先创建的目标数据库进行功能验证和系统验证,包括:将所述源数据库迁移到所述目标数据库的数据库层;在搭建的所述测试环境中对迁移完成后的所述目标数据库的数据库层和业务层的功能进行验证;在搭建的所述测试环境中对迁移完成后的所述目标数据库的性能以及备份数据进行验证。Optionally, based on the constructed test environment, functional verification and system verification are performed on the pre-created target database, including: migrating the source database to the database layer of the target database; verifying the functions of the database layer and business layer of the target database after the migration is completed in the constructed test environment; verifying the performance and backup data of the target database after the migration is completed in the constructed test environment.

可选地,所述在搭建的所述测试环境中对迁移完成后的所述目标数据库的数据库层和业务层的功能进行验证,包括:采用预设工具抓取所述源数据库的第一预设语句;在搭建的所述测试环境内,基于所述第一预设语句对所述目标数据库的数据库层和业务层的兼容性进行验证。Optionally, the functions of the database layer and the business layer of the target database after the migration are verified in the constructed test environment, including: using a preset tool to capture a first preset statement of the source database; and in the constructed test environment, verifying the compatibility of the database layer and the business layer of the target database based on the first preset statement.

可选地,所述在搭建的所述测试环境中对迁移完成后的所述目标数据库的性能以及备份数据进行验证包括:在搭建的所述测试环境内,对执行所述第一预设语句的耗时进行验证统计;采用预设压测工具对所述目标数据库的响应速度进行验证;对用户操作权限以及基于用户操作产生的数据包进行安全性验证;在不停止服务状态下,接入预配置的设备对所述目标数据库的可扩展性进行验证;在预设备份周期内,对所述目标数据库的备份数据进行验证。Optionally, the verification of the performance and backup data of the target database after the migration is completed in the constructed test environment includes: verifying and counting the time consumed in executing the first preset statement in the constructed test environment; verifying the response speed of the target database by using a preset stress testing tool; performing security verification on user operation permissions and data packets generated based on user operations; verifying the scalability of the target database by connecting to a pre-configured device without stopping service; and verifying the backup data of the target database within a preset backup cycle.

可选地,在所述将所述源数据库替换成所述目标替换数据库之后,所述方法还包括:对替换后的所述目标替换数据库的实际运行进行监测以及评估。Optionally, after replacing the source database with the target replacement database, the method further comprises: monitoring and evaluating actual operation of the replaced target replacement database.

可选地,所述对替换后的所述目标替换数据库的实际运行进行监测以及评估,包括:设置数据库监控软件;基于所述数据库监控软件,对替换后的所述目标替换数据库的运行进行实时监测,得到各项监控指标;间隔预设时间段对所述各项监控指标进行分析,生成系统运行报告。Optionally, the monitoring and evaluation of the actual operation of the target replacement database after replacement includes: setting up database monitoring software; based on the database monitoring software, monitoring the operation of the target replacement database after replacement in real time to obtain various monitoring indicators; analyzing the various monitoring indicators at preset time intervals to generate a system operation report.

可选地,所述目标数据库的创建方法包括:基于所述源数据库底座的数据库层、数据库访问接口层、业务数据库调度层,得到业务替换技术点;基于所述业务替换技术点,创建目标数据库。Optionally, the method for creating the target database includes: obtaining a business replacement technical point based on the database layer, database access interface layer, and business database scheduling layer of the source database base; and creating the target database based on the business replacement technical point.

此外,为实现上述目的,本申请还提供一种数据库替换装置,所述装置包括:搭建模块,用于基于用户需求以及源数据库的应用场景,搭建测试环境;验证模块,用于基于搭建的所述测试环境,对预先创建的目标数据库进行功能验证和系统验证;调整模块,用于在对所述目标数据库进行功能验证和系统验证的过程中,对所述目标数据库的数据库层与接口层进行调整,得到目标替换数据库;替换模块,用于将所述源数据库替换成所述目标替换数据库。In addition, to achieve the above-mentioned purpose, the present application also provides a database replacement device, which includes: a construction module, which is used to build a test environment based on user needs and application scenarios of the source database; a verification module, which is used to perform functional verification and system verification on a pre-created target database based on the constructed test environment; an adjustment module, which is used to adjust the database layer and interface layer of the target database during the process of performing functional verification and system verification on the target database to obtain a target replacement database; a replacement module, which is used to replace the source database with the target replacement database.

此外,本申请还提供了一种计算设备,所述计算设备包括:至少一个处理器、存储器和输入输出单元;其中,所述存储器用于存储计算机程序,所述处理器用于调用所述存储器中存储的计算机程序来执行上述中任一项所述的方法。In addition, the present application also provides a computing device, which includes: at least one processor, a memory and an input and output unit; wherein the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute any of the methods described above.

此外,本申请还提供了一种计算机可读存储介质,其包括指令,当其在计算机上运行时,使得计算机执行上述中任一项所述的方法。In addition, the present application also provides a computer-readable storage medium, which includes instructions, and when the instructions are executed on a computer, the computer executes any one of the above methods.

本申请实施例提出的一种数据库替换方法、装置、介质和计算设备,通过用户需求以及源数据库的应用场景,搭建测试环境;通过搭建的测试环境,对预先创建的目标数据库进行功能验证和系统验证;通过对目标数据库进行功能验证和系统验证,方便对目标数据库的数据库层与接口层进行调整,以得到目标替换数据库;目标替换数据库经过功能验证、系统验证以及数据库层与接口层的调整后,不会出现与源数据库的系统不兼容的问题,能够实现在快速切换后代替源数据库工作,不需要长时间的暂停进行替换,能够有效提高数据库替换的效率,减少给用户的正常使用带来的不便。The embodiments of the present application propose a database replacement method, apparatus, medium and computing device, which build a test environment according to user needs and application scenarios of a source database; perform function verification and system verification on a pre-created target database through the built test environment; perform function verification and system verification on the target database to facilitate adjustment of the database layer and interface layer of the target database to obtain a target replacement database; after the function verification, system verification and adjustment of the database layer and interface layer of the target replacement database, there will be no system incompatibility issues with the source database, and the target replacement database can replace the source database after rapid switching without long pauses for replacement, which can effectively improve the efficiency of database replacement and reduce the inconvenience caused to the normal use of users.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本申请一实施例提供的一种数据库替换方法的流程示意图;FIG1 is a schematic diagram of a flow chart of a database replacement method provided in an embodiment of the present application;

图2为本申请一实施例提供的一种数据库替换装置的功能模块示意图;FIG2 is a functional module diagram of a database replacement device provided by an embodiment of the present application;

图3为本申请一实施例提供的一种介质的结构示意图;FIG3 is a schematic diagram of the structure of a medium provided by an embodiment of the present application;

图4为本申请一实施例提供的一种计算设备的结构示意图。FIG. 4 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application.

本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings.

具体实施方式Detailed ways

应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。相反,提供这些实施方式是为了使本公开更加透彻和完整,并且能够将本公开的范围完整地传达给本领域的技术人员。It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

本领域技术人员知道,本申请的实施方式可以实现为一种系统、装置、设备、方法或计算机程序产品。因此,本申请可以具体实现为以下形式,即:完全的硬件、完全的软件(包括固件、驻留软件、微代码等),或者硬件和软件结合的形式。Those skilled in the art know that the embodiments of the present application can be implemented as a system, device, equipment, method or computer program product. Therefore, the present application can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

随着信息技术不断发展,很多企业都在数据库中存储了海量数据。这些数据给企业的发展带来便利的同时,也出现了一些挑战,比如数据的存储、管理、日常运维等。出于对数据库的性能、存储空间、稳定性等各方面的考虑,往往需要进行数据库替换,即,将源端数据库从第一服务器系统迁移到第二服务器系统。在数据库替换的过程中,通常要长时间的暂停连接源端数据库的生产应用,给用户的正常使用带来较大影响。With the continuous development of information technology, many companies have stored massive amounts of data in their databases. While these data bring convenience to the development of enterprises, they also bring some challenges, such as data storage, management, and daily operation and maintenance. Considering the performance, storage space, stability, and other aspects of the database, it is often necessary to replace the database, that is, migrate the source database from the first server system to the second server system. During the database replacement process, production applications connected to the source database are usually suspended for a long time, which has a significant impact on the normal use of users.

本申请实施例的主要解决方案是:基于用户需求以及源数据库的应用场景,搭建测试环境;基于搭建的所述测试环境,对预先创建的目标数据库进行功能验证和系统验证;在对所述目标数据库进行功能验证和系统验证的过程中,对所述目标数据库的数据库层与接口层进行调整,得到目标替换数据库;将所述源数据库替换成所述目标替换数据库。The main solution of the embodiment of the present application is: based on user needs and application scenarios of the source database, a test environment is built; based on the built test environment, a pre-created target database is functionally verified and a system is verified; in the process of functionally verifying and a system is verified on the target database, the database layer and the interface layer of the target database are adjusted to obtain a target replacement database; and the source database is replaced with the target replacement database.

本申请提供一种解决方案,通过用户需求以及源数据库的应用场景,搭建测试环境;通过搭建的测试环境,对预先创建的目标数据库进行功能验证和系统验证;通过对目标数据库进行功能验证和系统验证,方便对目标数据库的数据库层与接口层进行调整,以得到目标替换数据库;目标替换数据库经过功能验证、系统验证以及数据库层与接口层的调整后,不会出现与源数据库的系统不兼容的问题,能够实现在快速切换后代替源数据库工作,不需要长时间的暂停进行替换,能够有效提高数据库替换的效率,减少给用户的正常使用带来的不便。The present application provides a solution, which builds a test environment according to user needs and application scenarios of a source database; performs function verification and system verification on a pre-created target database through the built test environment; facilitates adjustment of the database layer and the interface layer of the target database by performing function verification and system verification on the target database to obtain a target replacement database; after the function verification, the system verification and the adjustment of the database layer and the interface layer of the target replacement database, there will be no system incompatibility problem with the source database, and the target replacement database can replace the source database after rapid switching, without the need for long-term pauses for replacement, which can effectively improve the efficiency of database replacement and reduce the inconvenience caused to the normal use of users.

需要说明的是,附图中的任何元素数量均用于示例而非限制,以及任何命名都仅用于区分,而不具有任何限制含义。It should be noted that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.

下面参考本申请的若干代表性实施方式,详细阐释本申请的原理。The principles of the present application are explained in detail below with reference to several representative implementations of the present application.

参照图1,本申请一实施例提供的一种数据库替换方法,该方法包括:Referring to FIG. 1 , an embodiment of the present application provides a database replacement method, the method comprising:

步骤S110,基于用户需求以及源数据库的应用场景,搭建测试环境。Step S110: Building a test environment based on user needs and application scenarios of the source database.

在示例实施例,源数据库的应用场景为采用源数据库的系统运行场景,例如,采用源数据库的业务应用系统对飞机的飞行进行监控。用户需求可以是用户对于实现数据库替换后,业务应用系统在运行过程中所达到的效果要求,例如,采用源数据库的业务应用系统运行时,源数据库无法满足系统的吞吐量,则在搭建测试环境时,添加用户对于数据库的吞吐量的评估参数。搭建测试环境可以为,例如,将业务应用系统整体复制拷贝一份至新的服务器设备并启动提供服务,复制后的业务应用系统即是测试验证环境。In the example embodiment, the application scenario of the source database is a system operation scenario using the source database, for example, a business application system using the source database is used to monitor the flight of an aircraft. User requirements can be user requirements for the effect achieved by the business application system during operation after the database replacement is implemented. For example, when the business application system using the source database is running, the source database cannot meet the system throughput. In this case, when setting up the test environment, the user's evaluation parameters for the database throughput are added. Setting up the test environment can be, for example, copying the entire business application system to a new server device and starting to provide services. The copied business application system is the test verification environment.

步骤S120,基于搭建的测试环境,对预先创建的目标数据库进行功能验证和系统验证。Step S120: Based on the constructed test environment, function verification and system verification are performed on the pre-created target database.

在示例实施例,目标数据库为根据用户需求预先设计的用于替代源数据库的数据库。功能验证为针对目标数据库涉及的技术点进行功能验证,功能验证可以包括在测试环境中对目标数据库的数据库层和业务层的功能进行验证;系统验证为在测试环境中对目标数据库的响应速度、安全性、稳定性等进行验证。In an example embodiment, the target database is a database pre-designed according to user requirements to replace the source database. Functional verification is to perform functional verification on the technical points involved in the target database, which may include verifying the functions of the database layer and business layer of the target database in a test environment; system verification is to verify the response speed, security, stability, etc. of the target database in a test environment.

在一具体的实施例,目标数据库的创建方法包括:基于源数据库底座的数据库层、数据库访问接口层、业务数据库调度层,得到业务替换技术点;基于业务替换技术点,创建目标数据库。In a specific embodiment, a method for creating a target database includes: obtaining a business replacement technical point based on a database layer, a database access interface layer, and a business database scheduling layer of a source database base; and creating a target database based on the business replacement technical point.

在示例实施例,例如,源数据库为MySQL数据库,需要创建的目标数据库为ACEDB数据库;则使用迁移工具完成MySQL数据库到ACEDB数据库的数据库对象迁移;使用数据对比校验工具完成MySQL数据库与ACEDB数据库的元信息及数据一致性比对,得到业务替换技术点;其中,业务替换技术点中的元信息及数据一致性比对,涉及到ACEDB数据库与MySQL数据库底座的数据库层、数据库访问接口层、业务数据库调度层对比。数据库访问接口层内嵌在业务系统的程序配置文件中,只需替换连接数据库的URL地址串,设计人员根据业务需要修改配置文件参数;获取修改后的配置文件参数,用以创建目标数据库。In the example embodiment, for example, the source database is a MySQL database, and the target database to be created is an ACEDB database; the migration tool is used to complete the database object migration from the MySQL database to the ACEDB database; the data comparison and verification tool is used to complete the meta information and data consistency comparison between the MySQL database and the ACEDB database, and obtain the business replacement technical point; wherein, the meta information and data consistency comparison in the business replacement technical point involves the comparison of the database layer, database access interface layer, and business database scheduling layer between the ACEDB database and the MySQL database base. The database access interface layer is embedded in the program configuration file of the business system, and only the URL address string for connecting to the database needs to be replaced, and the designer modifies the configuration file parameters according to business needs; the modified configuration file parameters are obtained to create the target database.

在一具体的实施例,上述步骤S120可以包括:In a specific embodiment, the above step S120 may include:

步骤S1201,将源数据库迁移到目标数据库的数据库层;Step S1201, migrating the source database to the database layer of the target database;

步骤S1202,在搭建的测试环境中对迁移完成后的目标数据库的数据库层和业务层的功能进行验证;Step S1202, verifying the functions of the database layer and the business layer of the target database after the migration is completed in the constructed test environment;

步骤S1203,在搭建的测试环境中对迁移完成后的目标数据库的性能以及备份数据进行验证。Step S1203: Verify the performance and backup data of the target database after the migration is completed in the constructed test environment.

在示例实施例,目标数据库的性能包括目标数据库的响应速度、安全性、可扩展性;其中,目标数据库的响应速度为目标数据库在测试环境中响应测试指令对数据库中的数据进行查询、更新和删除等操作的耗时时间。In an example embodiment, the performance of the target database includes the response speed, security, and scalability of the target database; wherein the response speed of the target database is the time taken for the target database to respond to test instructions in a test environment to query, update, delete, and other operations on data in the database.

目标数据库的扩展性是指目标数据库随着数据量、用户数量或业务需求增长而能够灵活调整其规模、性能的能力。具体来说,目标数据库的扩展性体现在以下几个方面:横向扩展:通过增加更多的数据库实例或节点来分担负载,提高整体的处理能力。这种扩展方式可以有效应对数据量的快速增长和并发访问的增加。纵向扩展:通过升级硬件资源,如使用更高性能的CPU、增加内存和存储空间等,来提升单个数据库实例的性能。这种方式适用于数据量较大且对性能有较高要求的场景。功能扩展:随着业务的发展,可能需要添加新的功能或模块到数据库中,以便满足不断变化的业务需求。The scalability of the target database refers to the ability of the target database to flexibly adjust its scale and performance as the amount of data, number of users or business needs grow. Specifically, the scalability of the target database is reflected in the following aspects: Horizontal expansion: By adding more database instances or nodes to share the load and improve the overall processing capacity. This expansion method can effectively cope with the rapid growth of data volume and the increase in concurrent access. Vertical expansion: By upgrading hardware resources, such as using higher-performance CPUs, increasing memory and storage space, the performance of a single database instance can be improved. This method is suitable for scenarios with large data volumes and high performance requirements. Functional expansion: As the business develops, it may be necessary to add new functions or modules to the database to meet changing business needs.

可理解的,将源数据库的数据库层迁移到目标数据库的数据库层,即,将源数据库中的数据库对象,例如表、视图、约束等数据库对象及数据需全部无差别的迁移至目标数据库,迁移的目的是确保所有的源数据库信息全部完整且一致性的迁移到目标数据库上,业务应用系统的运行是基于数据库中的对象及数据,这一步是实现数据库移植的前提与基础,在一定程度上可以确保在替换过程中实现平滑迁移,不要业务应用系统对目标数据库进行大量改造,进而可以实现在数据库替换过程中无需长时间暂停生产应用,极大的减少了对生产应用的影响。It can be understood that the database layer of the source database is migrated to the database layer of the target database, that is, the database objects in the source database, such as tables, views, constraints and other database objects and data, must all be migrated to the target database without distinction. The purpose of the migration is to ensure that all source database information is completely and consistently migrated to the target database. The operation of the business application system is based on the objects and data in the database. This step is the premise and basis for realizing database migration. To a certain extent, it can ensure smooth migration during the replacement process, and the business application system does not need to make a large number of modifications to the target database, so that the production application does not need to be suspended for a long time during the database replacement process, which greatly reduces the impact on the production application.

在迁移完成后,在搭建的测试环境中,对完成数据库层迁移的目标数据库所涉及的技术点进行功能验证,以及对目标数据库的性能,例如目标数据库的响应速度、安全性、稳定性、可扩展性、ROSE备份数据进行系统性验证,验证过程中进行数据库层与接口层的调整,直至实现全部所有功能,以确保在实际替换过程中能实现新旧系统之间的平滑过渡。After the migration is completed, in the established test environment, the technical points involved in the target database that has completed the database layer migration are functionally verified, as well as the performance of the target database, such as the response speed, security, stability, scalability, and ROSE backup data of the target database. During the verification process, adjustments are made to the database layer and the interface layer until all functions are implemented to ensure a smooth transition between the old and new systems during the actual replacement process.

进一步地,上述步骤S1202可以包括:采用预设工具抓取源数据库的第一预设语句;在搭建的测试环境内,基于第一预设语句对目标数据库的数据库层和业务层的兼容性进行验证。Furthermore, the above step S1202 may include: using a preset tool to capture a first preset statement of the source database; and verifying the compatibility of the database layer and the business layer of the target database based on the first preset statement in the constructed test environment.

在示例实施例,第一预设语句可以是SQL语句,SQL(Structured Query Language,结构化查询语言)是用于管理关系数据库的标准编程语言。使用SQL可以执行各种数据库操作,如查询、插入、更新和删除数据。In an exemplary embodiment, the first preset statement may be an SQL statement, where SQL (Structured Query Language) is a standard programming language for managing relational databases. SQL can be used to perform various database operations, such as querying, inserting, updating, and deleting data.

例如,源数据库MySQL数据库,目标数据库为ACEDB数据库;采用MySQL抓取工具抓取业务应用系统使用端内嵌的MySQL数据库SQL语句,抓取的SQL语句用于在测试环境中进行SQL语法兼容性的评估与验证,确保不会出现SQL语法兼容性问题导致替换后业务应用系统业执行报错。For example, the source database is a MySQL database, and the target database is an ACEDB database. A MySQL crawler tool is used to crawl the SQL statements of the MySQL database embedded in the business application system. The crawled SQL statements are used to evaluate and verify the SQL syntax compatibility in a test environment to ensure that there will be no SQL syntax compatibility issues that cause execution errors in the business application system after replacement.

进一步地,上述步骤S1203可以包括,在搭建的测试环境内,对执行第一预设语句的耗时进行验证统计;采用预设压测工具对目标数据库的响应速度进行验证;对用户操作权限以及基于用户操作产生的数据包进行安全性验证;在不停止服务状态下,接入预配置的设备对目标数据库的可扩展性进行验证;在预设备份周期内,对目标数据库的备份数据进行验证。Furthermore, the above-mentioned step S1203 may include, in the constructed test environment, verifying statistics on the time consumed in executing the first preset statement; using a preset stress testing tool to verify the response speed of the target database; performing security verification on user operation permissions and data packets generated based on user operations; without stopping the service, connecting to a pre-configured device to verify the scalability of the target database; and verifying the backup data of the target database within a preset backup cycle.

在示例实施例,第一预设语句可以为SQL语句;预设压测工具为JMeter压测工具;在现有技术中在进行切换时,有短暂的对外服务中断,时间大概在10分钟以内。而在本实施例中,不停止服务状态的情况为业务应用系统各组件的在线状态,例如,数据库在线,即,可以体现在提供数据库访问或操作功能,可通过数据库的系统表SYS_CLUSTERS获取状态标志、业务服务在线,例如,具体体现在前端页面,操作用户可以正常的进行数据操作、保存及功能流程运转。In the example embodiment, the first preset statement can be an SQL statement; the preset stress testing tool is a JMeter stress testing tool; in the prior art, when switching, there is a short external service interruption, which lasts for about 10 minutes. In this embodiment, the situation where the service status is not stopped is the online status of each component of the business application system, for example, the database is online, that is, it can be reflected in providing database access or operation functions, and the status flag can be obtained through the database system table SYS_CLUSTERS. Business services are online, for example, specifically reflected in the front-end page, and the operating user can normally perform data operations, save and function process operations.

可理解的,例如,在采用源数据库的业务应用系统和测试环境中,同时使用SQL语句执行耗时统计,观测测试结果是否一致;使用JMeter压测工具在同等条件下源数据库和目标数据库的响应速度进行对比。Understandable, for example, in the business application system and test environment using the source database, use SQL statements to execute time statistics at the same time to observe whether the test results are consistent; use the JMeter stress testing tool to compare the response speed of the source database and the target database under the same conditions.

在对目标数据库的安全性进行测试时,例如,针对系统用户及操作权限进行功能对比验证,并在数据传输加密、数据存储加密等数据安全性上进行数据抓包进行分析;When testing the security of the target database, for example, perform functional comparison and verification on system users and operation permissions, and perform data capture and analysis on data security such as data transmission encryption and data storage encryption;

在对目标数据库的可扩展性进行测试时,例如,在搭建的测试环境内不停止服务状态的情况下,添加同等配置新服务器接入测试环境,测试是否可正常对外服务;When testing the scalability of the target database, for example, without stopping the service in the built test environment, add a new server with the same configuration to the test environment to test whether it can provide external services normally;

在对目标数据库的ROSE备份数据进行测试时,例如,在备份周期内,在测试环境中验证通过ROSE备份的主目标数据库的数据和备用目标数据库的数据是否一致;以及在主目标数据库宕机情况下,切换至备用目标数据库是否可正常对外服务。When testing the ROSE backup data of the target database, for example, during the backup cycle, verify in the test environment whether the data of the primary target database backed up by ROSE is consistent with the data of the standby target database; and when the primary target database goes down, whether switching to the standby target database can provide normal external services.

通过在测试环境中对目标数据库的数据库层与接口层进行调整,可以确保后续替换后的目标数据库在业务应用系统的运行时的稳定性,减少切换失败的风险。By adjusting the database layer and interface layer of the target database in the test environment, the stability of the target database after subsequent replacement during the operation of the business application system can be ensured, reducing the risk of switching failure.

步骤S130,在对目标数据库进行功能验证和系统验证的过程中,对目标数据库的数据库层与接口层进行调整,得到目标替换数据库。Step S130 , in the process of performing function verification and system verification on the target database, adjusting the database layer and the interface layer of the target database to obtain a target replacement database.

在示例实施例,在测试环境中对完成迁移后的目标数据库的性能以及ROSE备份数据进行系统性验证,验证过程中对目标数据库的数据库层与接口层的进行调整,直至实现测试环境中的所有功能,确保后续实际替换过程能实现采用源数据库的业务应用系统与采用目标数据库的业务应用系统之间的平滑过渡。In the example embodiment, the performance of the target database after the migration and the ROSE backup data are systematically verified in a test environment. During the verification process, the database layer and interface layer of the target database are adjusted until all functions in the test environment are implemented, ensuring that the subsequent actual replacement process can achieve a smooth transition between the business application system using the source database and the business application system using the target database.

需要说明的是,本申请实施例所涉及的业务应用系统采用双机热备部署模型,即业务应用系统中包括有主数据库和备用数据库。原有的MySQL数据库为双机热备,其中主数据库和备用数据库均为MySQL数据库。为符合原有的双机热备部署模型,在测试环境中也需要创建主ACEDB数据库和备用ACEDB数据库。因此需要首先完成ROSE与目标数据库之间的技术适配,确保使用ROSE进行目标数据库的数据同步复制功能均正常,并达到使用要求。It should be noted that the business application system involved in the embodiment of the present application adopts a dual-machine hot standby deployment model, that is, the business application system includes a main database and a backup database. The original MySQL database is a dual-machine hot standby, in which the main database and the backup database are both MySQL databases. In order to comply with the original dual-machine hot standby deployment model, it is also necessary to create a main ACEDB database and a backup ACEDB database in the test environment. Therefore, it is necessary to first complete the technical adaptation between ROSE and the target database to ensure that the data synchronization and replication functions of the target database using ROSE are normal and meet the usage requirements.

通过在测试环境中对目标数据库的数据库层与接口层进行调整,可以确保后续替换后的目标数据库与业务应用系统的兼容性,进而实现实际切换过程中的平滑迁移,减少切换所需的时间。By adjusting the database layer and interface layer of the target database in the test environment, the compatibility of the target database and the business application system after subsequent replacement can be ensured, thereby achieving smooth migration in the actual switching process and reducing the time required for switching.

步骤S140,将源数据库替换成目标替换数据库。Step S140: Replace the source database with the target replacement database.

通过执行步骤S110-步骤S130,完成了在数据库替换之前的兼容性和稳定性测试评估,使得执行切换人员能够清晰的掌握不同数据库类型之间的兼容度以及替换工作量,不仅保证了在进行数据库切换时的成功率;而且节省了切换所要花费的时间,不需要长时间暂停生产应用,极大的减少了对生产应用的影响。By executing steps S110 to S130, the compatibility and stability test evaluation is completed before the database is replaced, so that the personnel performing the switch can clearly understand the compatibility between different database types and the replacement workload, which not only ensures the success rate of database switching; but also saves the time spent on switching, does not require long-term suspension of production applications, and greatly reduces the impact on production applications.

在步骤S140之后,方法还包括:对替换后的目标替换数据库的实际运行进行监测以及评估。After step S140 , the method further includes: monitoring and evaluating the actual operation of the replaced target replacement database.

在示例实施例中,例如,可以对采用目标替换数据库的业务应用系统的稳定性进行监测和评估;以及对在业务应用系统运行时,替换后的目标替换数据库的稳定性进行监测和评估。In an example embodiment, for example, the stability of a business application system using a target replacement database may be monitored and evaluated; and the stability of a replaced target replacement database may be monitored and evaluated when the business application system is running.

通过对替换后的目标替换数据库的实际运行进行监测以及评估,可以实现在后续业务应用系统运行过程出现问题,可以通过该监测过程进行问题定位、问题分析;进而提高解决问题的效率。By monitoring and evaluating the actual operation of the target replacement database after replacement, it can be realized that if problems arise during the operation of the subsequent business application system, the problem can be located and analyzed through this monitoring process, thereby improving the efficiency of problem solving.

在一具体的实施例中,上述方法可以具体包括:设置数据库监控软件;基于数据库监控软件,对替换后的目标替换数据库的运行进行实时监测,得到各项监控指标;间隔预设时间段对各项监控指标进行分析,生成系统运行报告。In a specific embodiment, the above method may specifically include: setting up database monitoring software; based on the database monitoring software, real-time monitoring of the operation of the replaced target replacement database to obtain various monitoring indicators; analyzing various monitoring indicators at preset time intervals to generate a system operation report.

在示例实施例中,监控指标包括目标数据库的吞吐量、执行时间、并发连接数、利用率、利用率、缓存命中率以及IOPS(Input/Output Per Second):衡量数据库处理请求的能力,包括读取、写入、服务器端和客户端等类型的请求。通过监控吞吐量,可以了解数据库的整体负载情况。系统运行报告包括:数据读写速度、硬件服务器名称、操作系统、数据库软件的资源消耗参数、参数状态、数据库运行状态信息。数据库监控软件为独立部署在另外一台服务器上的监控软件,数据库监控软件可以通过服务器操作系统的SNMP协议以及数据库系统表抓取硬件服务器、操作系统、数据库软件的资源消耗、参数状态、数据库运行状态信息,并记入监控日志作为报表统计及分析。数据库系统表,也被称为系统目录或系统表,是数据库系统中一种特殊的表格。这些表格主要用于存储数据库中各种对象的元数据信息,包括列、索引、视图、存储过程、触发器等。In the example embodiment, the monitoring indicators include the throughput, execution time, number of concurrent connections, utilization, utilization, cache hit rate and IOPS (Input/Output Per Second) of the target database: a measure of the database's ability to process requests, including read, write, server-side and client-side requests. By monitoring the throughput, the overall load of the database can be understood. The system operation report includes: data read and write speed, hardware server name, operating system, resource consumption parameters of the database software, parameter status, and database operation status information. The database monitoring software is a monitoring software independently deployed on another server. The database monitoring software can capture the resource consumption, parameter status, and database operation status information of the hardware server, operating system, and database software through the SNMP protocol of the server operating system and the database system table, and record it in the monitoring log as a report statistics and analysis. The database system table, also known as the system catalog or system table, is a special table in the database system. These tables are mainly used to store metadata information of various objects in the database, including columns, indexes, views, stored procedures, triggers, etc.

结合上述实施例可理解的,本申请实施例是在替换底层数据库类型之前,通过分析业务应用系统对源数据库的使用方式与方法,通过技术手段或工具,将不同数据库类型之间使用方式的差异及兼容性直观的展现出来,作为目标数据库替换前的评估验证依据,从而将数据库评估替换工作由现有的复杂的、模糊的状态变为直观的、可量化评估状态,有效的控制风险,降低替换失败几率。As can be understood from the above embodiments, the embodiments of the present application analyze the usage modes and methods of the source database by the business application system before replacing the underlying database type, and intuitively display the differences in usage modes and compatibility between different database types through technical means or tools, which serves as a basis for evaluation and verification before replacing the target database, thereby changing the database evaluation and replacement work from the existing complex and ambiguous state to an intuitive and quantifiable evaluation state, effectively controlling risks and reducing the probability of replacement failure.

例如,使用迁移工具完成MySQL数据库到ACEDB数据库的数据库对象迁移;使用数据对比校验工具完成MySQL数据与ACEDB数据库的元信息及数据一致性比对;通过网络抓包工具抓取业务系统内嵌MySQL数据库执行SQL语句;构建试验验证测试环境,在测试环境完成业务应用系统与替换后目标数据库的业务功能验证;部署数据库监控软件,可用于监控目标数据库所在服务器及目标数据库本身状态、资源消耗、运行稳定性等监测。通过业务访问压测工具,如LoadRunner对业务并发访问进行持续性测试,并观测响应时延、系统稳定性情况;通过数据库测试工具,如BenchmarkSQL、Sysbench工具对数据库进行持续性并发压力测试,并观测响应时延及目标数据库运行稳定性情况;替换原有业务应用系统访问数据库的接口地址信息,正式切换底层数据库类型;持续监控业务应用系统运行稳定性以及替换后目标数据库的运行稳定性,可以实现在后续业务应用系统运行过程出现问题,可以通过该监测过程进行问题定位、问题分析;进而提高解决问题的效率。For example, use the migration tool to complete the database object migration from MySQL database to ACEDB database; use the data comparison and verification tool to complete the metadata and data consistency comparison between MySQL data and ACEDB database; use the network packet capture tool to capture the SQL statement executed by the embedded MySQL database in the business system; build a test environment for experimental verification, and complete the business function verification of the business application system and the target database after replacement in the test environment; deploy database monitoring software, which can be used to monitor the status, resource consumption, and operation stability of the server where the target database is located and the target database itself. Use business access stress testing tools such as LoadRunner to continuously test business concurrent access and observe response delay and system stability; use database testing tools such as BenchmarkSQL and Sysbench to continuously test the database concurrently and observe response delay and target database operation stability; replace the interface address information of the original business application system to access the database and officially switch the underlying database type; continuously monitor the operation stability of the business application system and the operation stability of the target database after replacement, so that if there are problems in the subsequent business application system operation process, the monitoring process can be used to locate and analyze the problems, thereby improving the efficiency of problem solving.

实施上述的步骤S110~步骤S140,通过用户需求以及源数据库的应用场景,搭建测试环境;通过搭建的测试环境,对预先创建的目标数据库进行功能验证和系统验证;通过对目标数据库进行功能验证和系统验证,方便对目标数据库的数据库层与接口层进行调整,以得到目标替换数据库;目标替换数据库经过功能验证、系统验证以及数据库层与接口层的调整后,不会出现与源数据库的系统不兼容的问题,能够实现在快速切换后代替源数据库工作,不需要长时间的暂停进行替换,能够有效提高数据库替换的效率,减少给用户的正常使用带来的不便。The above-mentioned steps S110 to S140 are implemented to build a test environment according to user needs and application scenarios of the source database; through the built test environment, function verification and system verification are performed on the pre-created target database; through the function verification and system verification of the target database, the database layer and the interface layer of the target database are adjusted to obtain the target replacement database; after the function verification, system verification and adjustment of the database layer and the interface layer of the target replacement database, there will be no system incompatibility problem with the source database, and it can be realized that it can replace the source database after rapid switching, and there is no need to pause for replacement for a long time, which can effectively improve the efficiency of database replacement and reduce the inconvenience caused to the normal use of users.

在介绍了本申请示例性实施方式的方法之后,接下来,参考图2对本申请示例性实施方式的一种数据库替换装置进行说明,该数据库替换装置200包括:搭建模块210、验证模块220、调整模块230以及替换模块240;其中,After introducing the method of the exemplary embodiment of the present application, a database replacement device of the exemplary embodiment of the present application is described below with reference to FIG. 2 . The database replacement device 200 includes: a building module 210, a verification module 220, an adjustment module 230, and a replacement module 240; wherein,

搭建模块210用于基于用户需求以及源数据库的应用场景,搭建测试环境;The building module 210 is used to build a test environment based on user needs and application scenarios of the source database;

验证模块220用于基于搭建的测试环境,对预先创建的目标数据库进行功能验证和系统验证;The verification module 220 is used to perform functional verification and system verification on the pre-created target database based on the constructed test environment;

调整模块230用于在对目标数据库进行功能验证和系统验证的过程中,对目标数据库的数据库层与接口层进行调整,得到目标替换数据库;The adjustment module 230 is used to adjust the database layer and the interface layer of the target database during the process of functional verification and system verification of the target database to obtain a target replacement database;

替换模块240用于将源数据库替换成目标替换数据库。The replacement module 240 is used to replace the source database with a target replacement database.

作为一种可选的实施方式,验证模块220还用于将源数据库迁移到目标数据库的数据库层;在搭建的测试环境中对迁移完成后的目标数据库的数据库层和业务层的功能进行验证;在搭建的测试环境中对迁移完成后的目标数据库的性能以及备份数据进行验证。As an optional implementation, the verification module 220 is also used to migrate the source database to the database layer of the target database; verify the functions of the database layer and business layer of the target database after the migration is completed in the established test environment; and verify the performance and backup data of the target database after the migration is completed in the established test environment.

作为一种可选的实施方式,验证模块220还用于采用预设工具抓取源数据库的第一预设语句;在搭建的测试环境内,基于第一预设语句对目标数据库的数据库层和业务层的兼容性进行验证。As an optional implementation, the verification module 220 is also used to capture a first preset statement of the source database using a preset tool; in the constructed test environment, the compatibility of the database layer and the business layer of the target database is verified based on the first preset statement.

作为一种可选的实施方式,验证模块220还用于在搭建的测试环境内,对执行第一预设语句的耗时进行验证统计;采用预设压测工具对目标数据库的响应速度进行验证;对用户操作权限以及基于用户操作产生的数据包进行安全性验证;在不停止服务状态下,接入预配置的设备对目标数据库的可扩展性进行验证;在预设备份周期内,对目标数据库的备份数据进行验证。As an optional implementation, the verification module 220 is also used to verify and count the time consumed in executing the first preset statement in the constructed test environment; to verify the response speed of the target database using a preset stress testing tool; to perform security verification on user operation permissions and data packets generated based on user operations; to verify the scalability of the target database by connecting to a pre-configured device without stopping service; and to verify the backup data of the target database within a preset backup cycle.

作为一种可选的实施方式,数据库替换装置200还用于对替换后的目标替换数据库的实际运行进行监测以及评估。As an optional implementation, the database replacement device 200 is further configured to monitor and evaluate the actual operation of the replaced target replacement database.

作为一种可选的实施方式,数据库替换装置200还用于设置数据库监控软件;基于数据库监控软件,对替换后的目标替换数据库的运行进行实时监测,得到各项监控指标;间隔预设时间段对各项监控指标进行分析,生成系统运行报告。As an optional implementation, the database replacement device 200 is also used to set up database monitoring software; based on the database monitoring software, the operation of the replaced target replacement database is monitored in real time to obtain various monitoring indicators; the various monitoring indicators are analyzed at preset time intervals to generate a system operation report.

作为一种可选的实施方式,搭建模块210还用于基于源数据库底座的数据库层、数据库访问接口层、业务数据库调度层,得到业务替换技术点;基于业务替换技术点,创建目标数据库。As an optional implementation, the building module 210 is also used to obtain business replacement technical points based on the database layer, database access interface layer, and business database scheduling layer of the source database base; and create a target database based on the business replacement technical points.

在介绍了本申请示例性实施方式的方法和装置之后,接下来,参考图3对本申请示例性实施方式的计算机可读存储介质进行说明,请参考图3,其示出的计算机可读存储介质为光盘30,其上存储有计算机程序(即程序产品),所述计算机程序在被处理器运行时,会实现上述方法实施方式中所记载的各步骤,例如,基于用户需求以及源数据库的应用场景,搭建测试环境;基于搭建的测试环境,对预先创建的目标数据库进行功能验证和系统验证;在对目标数据库进行功能验证和系统验证的过程中,对目标数据库的数据库层与接口层进行调整,得到目标替换数据库;将源数据库替换成目标替换数据库;各步骤的具体实现方式在此不再重复说明。After introducing the method and apparatus of the exemplary embodiment of the present application, next, the computer-readable storage medium of the exemplary embodiment of the present application is described with reference to FIG3. Please refer to FIG3, where the computer-readable storage medium shown is a CD 30 on which a computer program (i.e., a program product) is stored. When the computer program is executed by the processor, the steps described in the above method implementation are implemented, for example, a test environment is built based on user needs and application scenarios of the source database; based on the built test environment, functional verification and system verification are performed on a pre-created target database; in the process of functional verification and system verification of the target database, the database layer and the interface layer of the target database are adjusted to obtain a target replacement database; the source database is replaced with the target replacement database; the specific implementation method of each step is not repeated here.

需要说明的是,所述计算机可读存储介质的例子还可以包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他光学、磁性存储介质,在此不再一一赘述。It should be noted that examples of the computer-readable storage medium may also 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 optical or magnetic storage media, which are not listed here one by one.

在介绍了本申请示例性实施方式的方法、装置和介质之后,接下来,参考图4对本申请示例性实施方式的用于模型处理的计算设备。After introducing the method, apparatus and medium according to the exemplary embodiment of the present application, next, a computing device for model processing according to the exemplary embodiment of the present application will be described with reference to FIG. 4 .

图4示出了适于用来实现本申请实施方式的示例性计算设备40的框图,该计算设备40可以是计算机系统或服务器。图4显示的计算设备40仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Fig. 4 shows a block diagram of an exemplary computing device 40 suitable for implementing the embodiments of the present application, and the computing device 40 may be a computer system or a server. The computing device 40 shown in Fig. 4 is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

如图4所示,计算设备40的组件可以包括但不限于:一个或者多个处理器或者处理单元401,系统存储器402,连接不同系统组件(包括系统存储器402和处理单元401)的总线403。As shown in FIG. 4 , the components of computing device 40 may include, but are not limited to: one or more processors or processing units 401 , system memory 402 , and a bus 403 connecting different system components (including system memory 402 and processing unit 401 ).

计算设备40典型地包括多种计算机系统可读介质。这些介质可以是任何能够被计算设备40访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。The computing device 40 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computing device 40, including volatile and non-volatile media, removable and non-removable media.

系统存储器402可以包括易失性存储器形式的计算机系统可读介质,例如RAM4021和/或高速缓存存储器4022,其中RAM为随机存取存储器。计算设备40可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,ROM4023可以用于读写不可移动的、非易失性磁介质(图4中未显示,通常称为“硬盘驱动器”)。尽管未在图4中示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线403相连。系统存储器402中可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本申请各实施例的功能。The system memory 402 may include a computer system readable medium in the form of a volatile memory, such as RAM 4021 and/or a cache memory 4022, wherein the RAM is a random access memory. The computing device 40 may further include other removable/non-removable, volatile/non-volatile computer system storage media. As an example only, ROM 4023 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 4, commonly referred to as "hard disk drive"). Although not shown in FIG. 4, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium) may be provided. In these cases, each drive may be connected to the bus 403 via one or more data medium interfaces. The system memory 402 may include at least one program product having a set (such as at least one) of program modules, which are configured to perform the functions of the various embodiments of the present application.

具有一组(至少一个)程序模块4024的程序/实用工具4025,可以存储在例如系统存储器402中,且这样的程序模块4024包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块4024通常执行本申请所描述的实施例中的功能和/或方法。A program/utility 4025 having a set (at least one) of program modules 4024 may be stored, for example, in system memory 402, and such program modules 4024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 4024 generally perform the functions and/or methods of the embodiments described herein.

计算设备40也可以与一个或多个外部设备404(如键盘、指向设备、显示器等)通信。这种通信可以通过I/O接口405进行,其中I/O接口为输入/输出接口。并且,计算设备40还可以通过网络适配器406与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图4所示,网络适配器406通过总线403与计算设备40的其它模块(如处理单元401等)通信。应当明白,尽管图4中未示出,可以结合计算设备40使用其它硬件和/或软件模块。The computing device 40 may also communicate with one or more external devices 404 (such as keyboards, pointing devices, displays, etc.). This communication may be performed via an I/O interface 405, which is an input/output interface. In addition, the computing device 40 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and/or a public network, such as the Internet) via a network adapter 406. As shown in Figure 4, the network adapter 406 communicates with other modules (such as a processing unit 401, etc.) of the computing device 40 via a bus 403. It should be understood that, although not shown in Figure 4, other hardware and/or software modules may be used in conjunction with the computing device 40.

处理单元401通过运行存储在系统存储器402中的程序,从而执行各种功能应用以及数据处理,例如,基于用户需求以及源数据库的应用场景,搭建测试环境;基于搭建的测试环境,对预先创建的目标数据库进行功能验证和系统验证;在对目标数据库进行功能验证和系统验证的过程中,对目标数据库的数据库层与接口层进行调整,得到目标替换数据库;将源数据库替换成目标替换数据库。各步骤的具体实现方式在此不再重复说明。应当注意,尽管在上文详细描述中提及了数据库替换装置的若干单元/模块或子单元/子模块,但是这种划分仅仅是示例性的并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多单元/模块的特征和功能可以在一个单元/模块中具体化。反之,上文描述的一个单元/模块的特征和功能可以进一步划分为由多个单元/模块来具体化。The processing unit 401 executes various functional applications and data processing by running the program stored in the system memory 402, for example, based on user needs and the application scenario of the source database, a test environment is built; based on the built test environment, a pre-created target database is functionally verified and a system is verified; in the process of functionally verifying and system verifying the target database, the database layer and the interface layer of the target database are adjusted to obtain a target replacement database; and the source database is replaced with the target replacement database. The specific implementation method of each step is not repeated here. It should be noted that although several units/modules or sub-units/sub-modules of the database replacement device are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units/modules described above can be concretized in one unit/module. Conversely, the features and functions of one unit/module described above can be further divided into multiple units/modules to be concretized.

在本申请的描述中,需要说明的是,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。In the description of the present application, it should be noted that the terms "first", "second" and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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 communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

最后应说明的是:以上所述实施例,仅为本申请的具体实施方式,用以说明本申请的技术方案,而非对其限制,本申请的保护范围并不局限于此,尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本申请实施例技术方案的精神和范围,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

此外,尽管在附图中以特定顺序描述了本申请方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and/or one step may be decomposed into multiple steps.

Claims (10)

1. A database replacement method, the method comprising:
based on the user requirements and the application scene of the source database, constructing a test environment;
performing function verification and system verification on a pre-established target database based on the built test environment;
In the process of performing function verification and system verification on the target database, adjusting a database layer and an interface layer of the target database to obtain a target replacement database;
And replacing the source database with the target replacement database.
2. The method of claim 1, wherein the performing functional verification and system verification on the pre-created target database based on the built test environment comprises:
migrating the source database to a database layer of the target database;
verifying the functions of a database layer and a business layer of the target database after migration is completed in the built test environment;
And verifying the performance of the target database and the backup data after the migration is completed in the built test environment.
3. The method of claim 2, wherein verifying the functions of the database layer and the business layer of the target database after the migration is completed in the built test environment comprises:
grabbing a first preset sentence of the source database by using a preset tool;
and verifying the compatibility of the database layer and the business layer of the target database based on the first preset statement in the built test environment.
4. The method of claim 3, wherein verifying the performance of the target database and the backup data after migration in the built test environment comprises:
in the built test environment, verifying and counting the time consumption of executing the first preset statement;
Verifying the response speed of the target database by adopting a preset pressure measuring tool;
Carrying out security verification on the user operation authority and the data packet generated based on the user operation;
In the state of not stopping service, accessing preconfigured equipment to verify the expandability of the target database;
and verifying the backup data of the target database in a preset backup period.
5. The method of claim 1, wherein after said replacing the source database with the target replacement database, the method further comprises:
and monitoring and evaluating the actual operation of the replaced target replacement database.
6. The method of claim 5, wherein the monitoring and evaluating the actual operation of the replaced target replacement database comprises:
setting database monitoring software;
Based on the database monitoring software, monitoring the operation of the replaced target replacement database in real time to obtain various monitoring indexes;
and analyzing each monitoring index at intervals of a preset time period to generate a system operation report.
7. The method according to claim 1, wherein the method of creating the target database comprises:
obtaining a service replacement technical point based on a database layer, a database access interface layer and a service database scheduling layer of the source database base;
and creating a target database based on the service replacement technical point.
8. A database replacement apparatus, the apparatus comprising:
The building module is used for building a test environment based on the user requirements and the application scene of the source database;
The verification module is used for carrying out function verification and system verification on a pre-established target database based on the built test environment;
The adjusting module is used for adjusting the database layer and the interface layer of the target database in the process of performing function verification and system verification on the target database to obtain a target replacement database;
And the replacing module is used for replacing the source database with the target replacing database.
9. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any of claims 1 to 7.
10. A computing device, the computing device comprising:
At least one processor, memory, and input output unit;
Wherein the memory is for storing a computer program and the processor is for invoking the computer program stored in the memory to perform the method of any of claims 1-7.
CN202410458492.2A 2024-03-15 2024-04-17 Database replacement method, device, medium and computing equipment Pending CN118394736A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410295132 2024-03-15
CN2024102951325 2024-03-15

Publications (1)

Publication Number Publication Date
CN118394736A true CN118394736A (en) 2024-07-26

Family

ID=91988396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410458492.2A Pending CN118394736A (en) 2024-03-15 2024-04-17 Database replacement method, device, medium and computing equipment

Country Status (1)

Country Link
CN (1) CN118394736A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120265726A1 (en) * 2011-04-18 2012-10-18 Infosys Limited Automated data warehouse migration
US20140136512A1 (en) * 2012-11-09 2014-05-15 International Business Machines Corporation Relative performance prediction of a replacement database management system (dbms)
CN112800034A (en) * 2021-03-23 2021-05-14 杭州沃趣科技股份有限公司 Database replacement method, device, medium and equipment based on grammar compatible conversion
CN113127312A (en) * 2019-12-30 2021-07-16 北京金山云网络技术有限公司 Method and device for testing database performance, electronic equipment and storage medium
CN115374081A (en) * 2022-07-15 2022-11-22 广东电力通信科技有限公司 Oracle database and Dameng database data migration method based on power system
CN116450610A (en) * 2023-04-11 2023-07-18 平安壹钱包电子商务有限公司 Database replacement method, device, equipment and computer readable medium
CN116450616A (en) * 2023-04-21 2023-07-18 南京邮电大学 General heterogeneous relational database SQL migration method based on parse tree
CN116974928A (en) * 2023-07-31 2023-10-31 平安银行股份有限公司 Dynamic test method, device, terminal equipment and medium based on data migration

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120265726A1 (en) * 2011-04-18 2012-10-18 Infosys Limited Automated data warehouse migration
US20140136512A1 (en) * 2012-11-09 2014-05-15 International Business Machines Corporation Relative performance prediction of a replacement database management system (dbms)
CN113127312A (en) * 2019-12-30 2021-07-16 北京金山云网络技术有限公司 Method and device for testing database performance, electronic equipment and storage medium
CN112800034A (en) * 2021-03-23 2021-05-14 杭州沃趣科技股份有限公司 Database replacement method, device, medium and equipment based on grammar compatible conversion
CN115374081A (en) * 2022-07-15 2022-11-22 广东电力通信科技有限公司 Oracle database and Dameng database data migration method based on power system
CN116450610A (en) * 2023-04-11 2023-07-18 平安壹钱包电子商务有限公司 Database replacement method, device, equipment and computer readable medium
CN116450616A (en) * 2023-04-21 2023-07-18 南京邮电大学 General heterogeneous relational database SQL migration method based on parse tree
CN116974928A (en) * 2023-07-31 2023-10-31 平安银行股份有限公司 Dynamic test method, device, terminal equipment and medium based on data migration

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
梅琳MARLIN: "数据库切换:关键步骤与策略", pages 1 - 2, Retrieved from the Internet <URL:https://cloud.baidu.com/article/2065879> *
殷圣忠: "数据库容灾系统可行性测试", 网络安全信息化, 28 February 2017 (2017-02-28), pages 60 - 63 *
赵艳妮;郭华磊;: "一种异构信息系统数据迁移技术研究", 现代计算机(专业版), no. 24, 25 August 2015 (2015-08-25) *
霍卓群;: "基于Oracle DSG+ADG技术的数据库平滑升级方案", 佳木斯职业学院学报, no. 04, 15 April 2015 (2015-04-15) *

Similar Documents

Publication Publication Date Title
CN111966677B (en) Data report processing method and device, electronic equipment and storage medium
CN103605698A (en) Cloud database system used for distributed heterogeneous data resource integration
CN105468473A (en) Data migration method and data migration apparatus
CN107145432B (en) A method for establishing a model database and a client
CN102272751B (en) Data integrity in a database environment through background synchronization
US11860892B2 (en) Offline index builds for database tables
CN107734066A (en) A kind of data center&#39;s total management system services administering method
CN108121782A (en) Distribution method, database middleware system and the electronic equipment of inquiry request
CN108921728B (en) Distributed real-time library system based on power grid dispatching system
CN102708158B (en) PostgreSQL (postgres structured query language) cloud storage filing and scheduling system
CN117951119B (en) Database performance optimization method based on cloud computing
CN114218193A (en) Data migration method, apparatus, computer equipment and readable storage medium
CN112685499A (en) Method, device and equipment for synchronizing process data of work service flow
CN107967122A (en) A kind of method for writing data of block device, device and medium
CN115982101B (en) Machine room data migration method and device based on multi-machine room copy placement strategy
CN115587118A (en) Task data dimension table association processing method and device and electronic equipment
CN113849341B (en) Performance optimization method, system and equipment for NAS snapshot and readable storage medium
CN112925770B (en) A database expansion method, device, equipment and medium
CN110413565A (en) Method, device and medium for synchronizing snapshots of multiple storage devices
CN117851163A (en) A service inspection tool based on the self-developed openstack platform
CN110647423A (en) A method, device and readable medium for creating a storage volume image based on an application
CN114968920A (en) Data migration method, device and equipment and readable storage medium
CN112434050B (en) Data synchronization method and device of power grid business processing system and business processing system
CN118394736A (en) Database replacement method, device, medium and computing equipment
CN118709612A (en) Quantum chip automatic simulation method, terminal and storage medium

Legal Events

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