Database version processing method and system

By monitoring database version changes and automating processing, generating and assigning tasks, efficient monitoring and deployment of database versions is achieved, and the problems of low efficiency and high repetition of database changes in the existing technology are solved, and deployment efficiency and consistency are improved.

CN112579568BActive Publication Date: 2024-12-20CHINA CONSTRUCTION BANK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011473856.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-15
Publication Date
2024-12-20
Estimated Expiration
2040-12-15

AI Technical Summary

Technical Problem

The existing technology cannot effectively monitor and deploy database versions, resulting in a lot of manual processing when database changes are required, with high repetition and low efficiency, especially in the case of multiple environments and database sub-tables, and lack of automation solutions.

Method used

A database version processing method and system is designed to monitor database version changes, generate change history, split tasks and allocate them to cluster slave nodes, and use multi-threading to process the structural changes of multiple database and sub-tables in parallel to realize automated deployment. and monitoring.

Benefits of technology

It improves the monitoring and deployment efficiency of database versions, reduces manual intervention, ensures the consistency and controllability of the version, reduces the subjective influence of deployment personnel, and simplifies operation and maintenance operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112579568B_ABST
    Figure CN112579568B_ABST
Patent Text Reader

Abstract

The present invention discloses a database version processing method and system, wherein the method comprises: when a change in the database version is monitored, the database version information is changed; according to each change processing of the database version information, a database version change history operation record is obtained; according to the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the database version change history operation record, a main change task is generated, and the main change task is sent to the cluster master node; the cluster master node splits the main change task into multiple sub-change tasks, and according to a preset allocation strategy, the multiple sub-change tasks are allocated to multiple cluster slave nodes; each cluster slave node that receives the task starts multi-threading according to the sub-change tasks to perform structural change processing on multiple sub-tables in parallel in multiple sub-libraries of multiple test database environments. The present invention can efficiently monitor and process the database version and efficiently deploy it.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database processing, and in particular to a database version processing method and system. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] Large-scale application systems will undergo comprehensive testing before going into production, and generally there will be more than a dozen test environments. In daily development and testing, it is necessary to ensure that the changes made to these environment databases remain consistent, controllable, testable, and reproducible, and consistent with the application version. Therefore, the database needs to be versioned accordingly.

[0004] However, it is not easy to process database versions. Unlike software code versions, which can be processed directly using CC, Git, SVN and other version management software, the database itself is not a collection of files. It is a container for storing the most important business data of an enterprise, and version management software cannot be directly applied. Therefore, a more appropriate solution needs to be designed to process database versions.

[0005] In addition, the database corresponding to the application system usually contains a large number of tables, stored procedures and other objects. During the development and testing process, the structure of these objects changes frequently. In order to avoid hot spots in a single database and disperse operational risks, most of them adopt a data sharding strategy to divide the database into sub-libraries and tables. This requires that when the database is changed, all sub-tables of all sub-libraries must be changed synchronously. Therefore, the workload of database deployment is large, the degree of repetition is high, and the quality and efficiency are greatly affected by the subjective influence of the deployment personnel. In addition, the database connection string information and database version information of each environment are different, the changes are not recorded, and the burden of manual processing is heavy. Therefore, it is urgent to improve deployment efficiency and simplify operation and maintenance operations by executing changes in parallel through automated means. Summary of the invention

[0006] An embodiment of the present invention provides a database version processing method for efficiently monitoring and processing and efficiently deploying database versions. The method includes:

[0007] When the database version is monitored to have changed, the database version information is changed;

[0008] According to each change processing of the database version information, a historical operation record of the database version change is obtained;

[0009] Generate a master change task based on the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the historical operation record of the database version change, and send the master change task to the cluster master node;

[0010] The cluster master node splits the main change task into multiple sub-change tasks, and distributes the multiple sub-change tasks to multiple cluster slave nodes according to a preset distribution strategy;

[0011] Each cluster slave node that receives the task starts multiple threads to perform structural change processing on multiple sub-tables in multiple sub-databases in multiple test database environments in parallel according to the sub-change task.

[0012] The embodiment of the present invention further provides a database version processing system for efficiently monitoring and processing and efficiently deploying database versions, the system comprising:

[0013] A monitoring processing unit, used to change the database version information when a change in the database version is detected;

[0014] A change history processing unit, used to obtain a database version change history operation record according to each change processing of the database version information;

[0015] A change task generation unit is used to generate a main change task according to the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the historical operation record of the database version change, and send the main change task to the cluster master node;

[0016] The cluster master node is used to split the main change task into multiple sub-change tasks, and allocate the multiple sub-change tasks to multiple cluster slave nodes according to a preset allocation strategy;

[0017] Each cluster slave node that receives the task is used to start multiple threads to perform structural change processing on multiple sub-tables in multiple sub-databases in multiple test database environments in parallel according to the sub-change task.

[0018] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned database version processing method when executing the computer program.

[0019] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above database version processing method.

[0020] In the embodiment of the present invention, the database version processing scheme is compared with the technical scheme in the prior art that cannot efficiently monitor and process the database version and efficiently deploy the database version. The scheme includes: when the database version is monitored to change, the database version information is changed; according to each change process of the database version information, a historical operation record of the database version change is obtained; according to the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the historical operation record of the database version change, a main change task is generated, and the main change task is sent to the cluster master node; the cluster master node splits the main change task into multiple sub-change tasks, and according to a preset allocation strategy, the multiple sub-change tasks are allocated to multiple cluster slave nodes; each cluster slave node that receives the task starts multiple threads according to the sub-change tasks to perform structural change processing on multiple sub-tables in parallel in multiple sub-libraries of multiple test database environments, so that the database version can be efficiently monitored and processed and efficiently deployed. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 Schematic diagram of the process of the database version processing method in the embodiment of the present invention;

[0023] Figure 2 This is a schematic diagram of the principle of database version processing in an embodiment of the present invention;

[0024] Figure 3 It is a flowchart of a method for processing a database version in another embodiment of the present invention;

[0025] Figure 4 It is a structural diagram of a database version processing system in an embodiment of the present invention;

[0026] Figure 5 It is a structural diagram of a database version processing system in another embodiment of the present invention. DETAILED DESCRIPTION

[0027] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0028] Before introducing the embodiments of the present invention, the terms involved in the embodiments of the present invention are first introduced.

[0029] 1. Database objects: including database tables, indexes, views, charts, stored procedures, triggers, functions, etc.

[0030] 2. Database version: In the daily development and testing of the application system, it is necessary to ensure that the structure of database objects such as database tables, indexes, stored procedures, etc. in the test or production environment matches the deployed application and corresponds to the application version. This entire set of database object structures is a database version.

[0031] 3. Database sharding: The reason for database sharding is that when the amount of data in a single table is large, the query speed and efficiency of the database will decrease. At the same time, once a database failure occurs, all the data in the table will face the risk of loss. Therefore, in order to improve the query efficiency of large data tables and the overall high availability and security of data, tables with large data volumes are split into multiple tables with small data volumes according to certain rules and stored in multiple databases. After the database is sharded, changes to the database table structure must ensure consistency across multiple shards.

[0032] The following is an introduction to the technical problems discovered by the inventors and the solutions proposed in the embodiments of the present invention.

[0033] The inventor found that the versioning and automated deployment of a database mainly rely on the automated acquisition of database information, the automated generation of database statements, and the automated execution of database statements. Therefore, the inventor proposed a database versioning solution, which is a solution for implementing database version monitoring and automated deployment.

[0034] Specifically, according to the source of the database, the database can be divided into domestic databases and non-domestic databases. In the field of large-scale commercial databases, Oracle's ORACLE database is a typical representative of non-domestic databases, and Huawei's GAUSS database is a leader among domestic databases. In the process of database version management and automated deployment, the inventor has integrated the SQLPLUS of the ORACLE database and the ZSQL connection tools of GAUSS, and utilized the scripting advantages of the Python language. The automation of the ORACLE database is implemented by calling SQLPLUS, and the automation of the GAUSS database is implemented by calling ZSQL, thereby realizing an automated deployment method that is compatible with both domestic and non-domestic databases.

[0035] Currently, there is no effective database version processing and automatic deployment method. If manual database version processing and deployment is used, a lot of manpower and energy are required. The following is a detailed introduction to the database version processing solution proposed in the embodiment of the present invention.

[0036] Figure 1 FIG. 1 is a flow chart of a method for processing a database version in an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0037] Step 101: When a change in the database version is detected, the database version information is changed;

[0038] Step 102: Obtain a historical operation record of database version change based on each change process of the database version information;

[0039] Step 103: Generate a master change task based on the corresponding application selected by the user, the corresponding database baseline versions before and after the change, and the historical operation records of the database version change, and send the master change task to the cluster master node;

[0040] Step 104: the cluster master node splits the main change task into multiple sub-change tasks, and distributes the multiple sub-change tasks to multiple cluster slave nodes according to a preset distribution strategy;

[0041] Step 105: Each cluster slave node that receives the task starts multiple threads to perform structural change processing on multiple sub-tables in multiple sub-databases in multiple test database environments in parallel according to the sub-change task.

[0042] In the embodiment of the present invention, the database version processing scheme can efficiently monitor and process and efficiently deploy the database version, compared with the technical scheme in the prior art that cannot efficiently monitor and process and efficiently deploy the database version.

[0043] The following is combined with Figure 2 Each step involved in the embodiment of the present invention is introduced in detail.

[0044] In the above steps 101 and 102, the database version processing method in the embodiment of the present invention can provide database version information of different applications and different environments for users to consult, and users can clearly know which month's test version of the database in a certain application and a certain environment is. This function provides users with a clear view of the database version of each application and each environment, reducing the burden of manually recording and maintaining the database version of the environment.

[0045] In one embodiment, when a change in the database version is monitored, the database version information is changed, which may include: when a change in the database version is monitored, adding, deleting and modifying the database version information.

[0046] In specific implementation, the embodiment of the present invention also involves a database baseline version processing solution, which can serialize the database model structure (tables, indexes, views, sequences and other objects) in the specified database into a Schema source, and use the Schema source as the database baseline for version management. Users can query the database baseline version currently being used by the specified application in the system, and create a new baseline version based on the existing baseline version. Users can also query the table information, field information, and index information owned by different version baselines, and support adding, modifying, and deleting this information, and implement operations such as adding tables to the baseline version and adding fields to the table. The system automatically records the above-mentioned modifications to the baseline version, and provides users with the function of querying the baseline version modification history, which is convenient for users to track the changes in the database during the application development process and comprehensively record the historical process of version changes. This function provides a structured and ordered means for database deployment, ensuring version consistency.

[0047] In the above steps 103 to 105, this part (database change deployment) provides a one-click deployment function for database changes, such as Figure 2 As shown, the user selects the application, environment, and two previous and next database baseline versions in the system (or manually submits the SQL file to be executed). The system generates a change task (master change task) and hands it over to the cluster master node. The master node dispatches the change task to the cluster slave node according to the load balancing strategy (preset allocation strategy). After the slave node obtains the change file and database environment configuration information, it starts multi-threading to perform structural changes on multiple sub-tables (or other database objects) in multiple sub-databases in multiple test environments in parallel. After the database change is executed, the slave node returns the execution result to the front-end interface for display. The one-click deployment function greatly liberates the deployment personnel and reduces the subjective requirements for database deployment personnel.

[0048] Specifically, the detailed process of how to generate a change task is introduced below.

[0049] In one embodiment, generating a main change task based on the corresponding application selected by the user, the corresponding database baseline versions before and after the change, and the database version change history operation record may include:

[0050] According to the corresponding application selected by the user and the corresponding database baseline versions before and after the change, the schema source information such as tables, fields, indexes, and sequences of the two corresponding database baseline versions before and after the change are compared to generate incremental SQL statements;

[0051] Identify the reference relationship between the replica table and the original table contained in the database baseline version, and generate a change statement for the replica table when the original table structure changes;

[0052] The main change task is generated according to the incremental SQL statement and the change statement.

[0053] In specific implementation, this function (automatic generation of SQL statements) supports users to select the application and the two versions of the database baseline in the interface. The system automatically generates incremental SQL statements by comparing the tables, fields, indexes, sequences and other Schema information of the two versions of the baseline. The system also supports automatic identification of the reference relationship between the replica table and the original table contained in the baseline. When the structure of the original table changes, the change statement of the replica table is automatically generated to ensure that the replica table is changed synchronously. The system returns the generated statement to the interface for user review. After the user reviews and confirms that there is no problem, he can click to jump to the database change execution interface and directly use the generated incremental statement to execute the change in the test environment.

[0054] In one embodiment, Figure 3 As shown, the above database version processing method may also include the following steps:

[0055] Step 106: receiving a user's query instruction for changing the historical operation record;

[0056] Step 107: According to the query instruction, the database version change history operation record is sent to the user.

[0057] In specific implementation, the embodiment of the present invention can realize database change history query, specifically, realize automatic recording of the change content, execution results, and execution details of each database change. The user can query the change record of the specified module (unit) and the specified environment, click the execution result to view whether the change is successful or the abnormal information that caused the execution failure, and click the execution details to view the execution status of each statement. This function makes the database change traceable. When questioning whether the database change is successfully implemented, the user can quickly view the record to facilitate the location and troubleshooting of the problem.

[0058] In one embodiment, the embodiment of the present invention further relates to an environment DB information processing solution, that is, it may also include: receiving a user's query instruction for database information of all test environments and production environments;

[0059] According to the query instruction, the database information of all the test environments and the production environment is sent to the user.

[0060] In specific implementation, the solution provides database information of all test environments and production environments for users to consult. Users can easily query the database instance, port, IP, user name and password of the specified application and environment through the system, which is more convenient and intuitive.

[0061] In one embodiment, in the above database version processing method, an EXCEL file is used to store database tables, indexes, views, charts, stored procedures, triggers and function data, and JSON is used to store configuration data in the automation process.

[0062] In specific implementation, Excel files and JSON files have powerful structured data storage capabilities, and the information display form is intuitive, vivid, easy to understand, and easy to edit. EXCEL files are used to store database tables, indexes, views, charts, stored procedures, triggers, functions and other data with large amounts of information. JSON is used to store configuration data with relatively small amounts of information in the automation process. The combination of the two provides a visual information input source for the deployment of database versions.

[0063] The following is an introduction to the preferred solution for the adaptation and deployment of heterogeneous databases involved in the embodiment of the present invention.

[0064] The embodiment of the present invention is a deployment scheme based on the source database being an ORACLE database and the target database being a GAUSS database. First, SQLLITE DB is used to obtain source object information of a related database from the source ORACLE database, and a corresponding database baseline SQLLITE DB version is generated. Then, a Python script adaptation tool is used to generate an EXCEL version database baseline from the database baseline SQLITE DB version, and then the ZSQL tool of the GAUSS database is called through a Python script to complete the loading and creation of the target database object information.

[0065] After the target GAUSS database object information is created, use the script tool to call SQLPLUS and ZSQL to perform database object verification on the source and target libraries respectively to ensure the consistency of the source and target library objects, laying a solid foundation for the subsequent successful migration of the target library database data and the stable operation of the application.

[0066] In summary, compared with the existing methods, the database version processing method provided by the embodiment of the present invention has the following advantages:

[0067] 1. Provide users with a clear view of database version and database information, reducing the burden of manual maintenance.

[0068] 2. Database baseline version management provides a structured and ordered means for database deployment, ensuring version consistency.

[0069] 3. Compared with users manually writing SQL statements, this system automatically generates incremental SQL statements based on the database baseline version, and the quality of the statements does not depend on the user's level and experience.

[0070] 4. Automatically identify the reference relationship between the replica table and the original table. When the structure of the original table changes, automatically make the same changes to the replica table without manual identification and intervention.

[0071] 5. One-click deployment effectively reduces the risk of inconsistency in manual deployment of database versions, ensures deployment quality, reduces the subjective influence of deployment personnel, standardizes deployment processes, improves deployment efficiency, and ultimately frees deployment personnel from tedious and repetitive deployment operations.

[0072] 6. The technology proposed in the embodiment of the present invention is implemented based on SQL principles and has strong scalability. Although it currently only supports version management and deployment of ORACLE and GAUSS databases, it can also be easily adapted to commonly used relational databases such as MYSQL and SQLSERVER in the future.

[0073] The present invention also provides a database version processing system, as described in the following embodiments. Since the principle of solving the problem by the system is similar to that of the database version processing method, the implementation of the system can refer to the implementation of the method, and the repeated parts will not be repeated.

[0074] Figure 4 FIG. 1 is a schematic diagram of the structure of a database version processing system in an embodiment of the present invention. Figure 4 As shown, the system includes:

[0075] The monitoring processing unit 01 is used to change the database version information when the database version is monitored to change;

[0076] The change history processing unit 02 is used to obtain a database version change history operation record according to each change processing of the database version information;

[0077] The change task generation unit 03 is used to generate a main change task according to the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the historical operation record of the database version change, and send the main change task to the cluster master node;

[0078] The cluster master node 04 is used to split the main change task into multiple sub-change tasks, and allocate the multiple sub-change tasks to multiple cluster slave nodes according to a preset allocation strategy;

[0079] Each cluster slave node 05 that receives the task is used to start multiple threads to perform structural change processing on multiple sub-tables in multiple sub-databases in multiple test database environments in parallel according to the sub-change task.

[0080] In one embodiment, the monitoring processing unit is specifically used to: when monitoring a change in the database version, perform addition, deletion and modification operations on the database version information.

[0081] In one embodiment, Figure 5 As shown, the above database version processing system may further include:

[0082] Query unit 06, used to receive a user's query instruction for changing the historical operation record;

[0083] Feedback unit 07 is used to send the database version change history operation record to the user according to the query instruction.

[0084] In one embodiment, the change task generation unit is specifically used to:

[0085] According to the corresponding application selected by the user and the corresponding database baseline versions before and after the change, the tables, fields, indexes and sequence information of the two corresponding database baseline versions before and after the change are compared, and incremental SQL statements are generated;

[0086] Identify the reference relationship between the replica table and the original table contained in the database baseline version, and generate a change statement for the replica table when the original table structure changes;

[0087] The main change task is generated according to the incremental SQL statement and the change statement.

[0088] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned database version processing method when executing the computer program.

[0089] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above database version processing method.

[0090] In the embodiment of the present invention, the database version processing scheme is compared with the technical scheme in the prior art that cannot efficiently monitor and process the database version and efficiently deploy the database version. The scheme includes: when the database version is monitored to change, the database version information is changed; according to each change process of the database version information, a historical operation record of the database version change is obtained; according to the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the historical operation record of the database version change, a main change task is generated, and the main change task is sent to the cluster master node; the cluster master node splits the main change task into multiple sub-change tasks, and according to a preset allocation strategy, the multiple sub-change tasks are allocated to multiple cluster slave nodes; each cluster slave node that receives the task starts multiple threads according to the sub-change tasks to perform structural change processing on multiple sub-tables in parallel in multiple sub-libraries of multiple test database environments, so that the database version can be efficiently monitored and processed and efficiently deployed.

[0091] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0093] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0094] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0095] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A database version processing method, characterized in that: include: When the database version is monitored to have changed, the database version information is changed; According to each change processing of the database version information, a historical operation record of the database version change is obtained; Generate a master change task based on the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the historical operation record of the database version change, and send the master change task to the cluster master node; The cluster master node splits the main change task into multiple sub-change tasks, and distributes the multiple sub-change tasks to multiple cluster slave nodes according to a preset distribution strategy; Each cluster slave node that receives the task starts multiple threads to perform structural change processing on multiple sub-tables in multiple sub-databases of multiple test database environments in parallel according to the sub-change task; The method further includes: serializing a database schema structure in a database into a Schema source; using the Schema source as a database baseline version; wherein the database schema structure includes the following objects: tables, indexes, views, and sequences; In this database version processing method: use EXCEL files to store database tables, indexes, views, charts, stored procedures, triggers and function data, and use JSON to store configuration data in the automation process; provide users with a database version and database information view; when the user selects the application, environment, and two database baseline versions, a master change task is generated and handed over to the cluster master node. After the database change is executed, the slave node returns the execution result to the front-end interface for display; Among them, according to the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the historical operation record of the database version change, the main change task is generated, including: According to the corresponding application selected by the user and the corresponding database baseline versions before and after the change, the tables, fields, indexes and sequence information of the two corresponding database baseline versions before and after the change are compared, and incremental SQL statements are generated; Identify the reference relationship between the replica table and the original table contained in the database baseline version, and generate a change statement for the replica table when the original table structure changes; The main change task is generated based on the incremental SQL statement and the change statement; wherein the generated statement is returned to the interface for user review. When the user reviews and confirms that there is no problem, the interface jumps to the database change execution interface based on the user's click, and the generated incremental statement is used to execute the change in the test environment.

2. The database version processing method according to claim 1, characterized in that: When a change in the database version is detected, the database version information is changed, including: when a change in the database version is detected, the database version information is added, deleted, and modified.

3. The database version processing method according to claim 1, characterized in that: Also includes: Receive user's query instruction on the change history operation record; According to the query instruction, the database version change history operation record is sent to the user.

4. A database version processing system, characterized in that: include: A monitoring processing unit, used to change the database version information when a change in the database version is detected; A change history processing unit, used to obtain a database version change history operation record according to each change processing of the database version information; A change task generation unit is used to generate a main change task according to the corresponding application selected by the user, the corresponding database baseline version before and after the change, and the historical operation record of the database version change, and send the main change task to the cluster master node; The cluster master node is used to split the main change task into multiple sub-change tasks, and allocate the multiple sub-change tasks to multiple cluster slave nodes according to a preset allocation strategy; Each cluster slave node that receives the task is used to start multiple threads to perform structural change processing on multiple sub-tables in multiple sub-databases in multiple test database environments in parallel according to the sub-change task; The method further includes: serializing a database schema structure in a database into a Schema source; using the Schema source as a database baseline version; wherein the database schema structure includes the following objects: tables, indexes, views, and sequences; In this database version processing system: EXCEL files are used to store database tables, indexes, views, charts, stored procedures, triggers and function data, and JSON is used to store configuration data in the automation process; a database version and database information view are provided to users; when users select the application, environment, and two database baseline versions, a master change task is generated and handed over to the cluster master node. After the database change is executed, the slave node returns the execution result to the front-end interface for display; The change task generation unit is specifically used for: According to the corresponding application selected by the user and the corresponding database baseline versions before and after the change, the tables, fields, indexes and sequence information of the two corresponding database baseline versions before and after the change are compared, and incremental SQL statements are generated; Identify the reference relationship between the replica table and the original table contained in the database baseline version, and generate a change statement for the replica table when the original table structure changes; The main change task is generated based on the incremental SQL statement and the change statement; wherein the generated statement is returned to the interface for user review. When the user reviews and confirms that there is no problem, the interface jumps to the database change execution interface based on the user's click, and the generated incremental statement is used to execute the change in the test environment.

5. The database version processing system according to claim 4, characterized in that: The monitoring processing unit is specifically used for: when monitoring a change in the database version, performing addition, deletion and modification operations on the database version information.

6. The database version processing system according to claim 4, characterized in that: Also includes: A query unit, used to receive a user's query instruction for changing the historical operation record; A feedback unit is used to send the database version change history operation record to the user according to the query instruction.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Data synchronization method and related device

    CN108833569A

  • Database version control system and method

    CN111857796A