Synchronization method, device and equipment for low-code multi-environment database structure

Through the synchronization method of low-code multi-environment database structure, the problems of data synchronization complexity and error risk in software development are solved, automatic data synchronization is realized, and efficiency and security are improved.

CN118626561AInactive Publication Date: 2024-09-10杭州云为科技有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410757616.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the software development process, data synchronization between the test environment and the production environment often requires manual creation of SQL scripts, which easily leads to human errors and increases the workload of developers, and is complicated to maintain, especially when multiple data synchronization tasks pass over time. becomes more complex.

Method used

Provides a low-code multi-environment database structure synchronization method. By filtering the table structure in the test environment database, generating corresponding SQL statements, and executing them in the production environment database, it simplifies the synchronization process and reduces human intervention and potential errors.

Benefits of technology

Data synchronization without human intervention is achieved, improving efficiency, reducing the risk of errors, reducing developer workload, and reducing the risk of sensitive data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626561A
    Figure CN118626561A
Patent Text Reader

Abstract

The invention relates to the technical field of low codes, and provides a synchronization method for a low-code multi-environment database structure, a table structure is newly created in a test environment database and synchronized to a production environment database, the synchronization method comprises the following steps: screening the table structure needing to be synchronized in the test environment database; table names of all the table structures needing to be synchronized are transmitted to a page; according to the page selected by the user, table names needing to be synchronized are transmitted to a server; generating SQL statements corresponding to the table structures needing to be synchronized through a preset template in the server; synchronizing the generated SQL statement to a production environment database; and starting the production environment server, obtaining the SQL statement synchronized by the production database, and executing the SQL statement. Manual intervention is not needed in the synchronization process, the data synchronization operation is simplified, the efficiency is improved, the potential human error risk is reduced, and errors of a manually created SQL during manual data synchronization are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of low-code technology, and in particular to a synchronization method, device and equipment for a low-code multi-environment database structure. Background Art

[0002] Generally, software development provides a test environment and a production environment. The test environment is used to test the designed functions, while the production environment is used to actually release these modules for users to use. However, sometimes after multiple tests and changes in the test environment, some data needs to be synchronized to the production environment to ensure that users can use the data directly. Usually, this process involves contacting developers, who will manually create SQL scripts and then copy them from the test environment database to the production environment database to synchronize the data. Since developers manually synchronize data, there may be human errors that cause data confusion or failure to synchronize data, and it increases the workload of developers and is not conducive to long-term maintenance. If there are multiple data synchronization tasks, maintaining and updating these tasks may become more complicated over time. Summary of the invention

[0003] In order to solve the above problems, the present invention provides the following technical solutions:

[0004] The present invention provides a synchronization method for a multi-environment database structure for low-code, which creates a new table structure in a test environment database and synchronizes it to a production environment database. The synchronization method includes:

[0005] (1) Filter out the table structure that needs to be synchronized in the test environment database;

[0006] (2) Pass the table names of all table structures that need to be synchronized to the page;

[0007] (3) Pass the table name that needs to be synchronized to the server based on the page selected by the user;

[0008] (4) Generate the corresponding SQL statement for the table structure to be synchronized through the preset template in the server;

[0009] (5) Synchronize the generated SQL statements to the production environment database;

[0010] (6) Start the production environment server, obtain the SQL statement after synchronization with the production database, and execute it.

[0011] Furthermore, the table structure is displayed on the page in the form of a list.

[0012] Furthermore, in step (2), the table name is passed to the page through the interface.

[0013] Furthermore, the preset template is a sentence template with placeholders.

[0014] Furthermore, the specific method of step (4) is: replacing the placeholders in the server preset template with the table name and table field information of the corresponding synchronization table.

[0015] The present invention provides a synchronization device for a low-code multi-environment database structure.

[0016] include:

[0017] The query module is used to query the table names and table structures that need to be synchronized in the test environment database;

[0018] The transfer module is used to transfer the table name of the table structure that needs to be synchronized to the page through the interface;

[0019] A generation module is used to generate corresponding SQL statements for the table structure that needs to be synchronized using a preset template;

[0020] The synchronization module is used to synchronize the generated corresponding SQL statements to the production environment database;

[0021] The execution module is used to execute SQL statements in the production environment database.

[0022] The present invention provides an electronic device, comprising:

[0023] at least one processor;

[0024] as well as

[0025] a memory communicatively connected to the at least one processor; wherein,

[0026] The memory stores one or more computer programs that can be executed by the at least one processor. The one or more computer programs are executed by the at least one processor so that the at least one processor can perform the above synchronization method.

[0027] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above-mentioned synchronization method when executed by a processor.

[0028] The present invention has the following beneficial effects:

[0029] (1) The synchronization process of the present invention does not require manual intervention, which simplifies data synchronization operations, improves efficiency, reduces potential human error risks, and avoids errors in manually created SQL when synchronizing data, resulting in data synchronization failure or other abnormal situations. At the same time, it also takes into account potential errors and data inconsistency risks;

[0030] (2) The present invention does not require developers to manually create and execute SQL as before, thereby improving work efficiency and allowing developers to devote more time and energy to more valuable tasks.

[0031] (3) The present invention does not require users to rely on developers when synchronizing data, and users can manually complete tedious data synchronization anytime and anywhere.

[0032] (4) The present invention reduces the risk of direct exposure of the database to developers and avoids the risk of leakage of some sensitive data of users. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a flow chart of the synchronization method in Example 1. DETAILED DESCRIPTION

[0034] The specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. It should be pointed out that the embodiments are only specific explanations of the invention and should not be regarded as limitations of the invention. The purpose of the embodiments is to enable those skilled in the art to better understand and reproduce the technical solutions of the present invention. The protection scope of the present invention shall still be based on the scope defined by the claims.

[0035] Example 1

[0036] like Figure 1 As shown, this embodiment provides a synchronization method for a low-code multi-environment database structure, and the steps for synchronizing data in a test environment to a production environment are:

[0037] S1, create a new table structure in the test environment database;

[0038] S2, filter out the table structure that needs to be synchronized in the environment database;

[0039] S3, passing the table names of all table structures that need to be synchronized to the page through the interface, wherein the table structures are displayed on the page in the form of a list; preferably, the user can easily select multiple tables through the page;

[0040] S4, passing the table name to be synchronized to the server according to the page selected by the user;

[0041] S5, replace the placeholders in the preset template in the server with the table name and table field information of the corresponding synchronization table to form a corresponding SQL statement; wherein the preset template is a statement template with a placeholder, and the placeholder is a special marking character that will be pre-written in the statement, for example: {name}, and replaced with the actual value at runtime.

[0042] S6, synchronize the generated SQL statements to the production environment database;

[0043] S7, start the production environment server, obtain the SQL statement after the production database is synchronized, and execute it.

[0044] The synchronization process of the present invention does not require manual intervention, which simplifies data synchronization operations, improves efficiency, reduces potential human error risks, avoids errors in manually created SQL when manually synchronizing data, resulting in data synchronization failure or other abnormal situations, and also takes into account potential errors and data inconsistency risks.

[0045] Example 2

[0046] This embodiment provides a synchronization device for a low-code multi-environment database structure.

[0047] include:

[0048] The query module is used to query the table names and table structures that need to be synchronized in the test environment database;

[0049] The transfer module is used to transfer the table name of the table structure that needs to be synchronized to the page through the interface;

[0050] A generation module is used to generate corresponding SQL statements for the table structure that needs to be synchronized using a preset template;

[0051] The synchronization module is used to synchronize the generated corresponding SQL statements to the production environment database;

[0052] The execution module is used to execute SQL statements in the production environment database.

[0053] Example 3

[0054] This embodiment provides an electronic device, including:

[0055] at least one processor;

[0056] as well as

[0057] a memory communicatively connected to the at least one processor; wherein,

[0058] The memory stores one or more computer programs that can be executed by the at least one processor. The one or more computer programs are executed by the at least one processor so that the at least one processor can perform the above synchronization method.

[0059] Example 4

[0060] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above synchronization method when executed by a processor.

[0061] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0062] It should be noted that the technical features not described in detail in the present invention can be implemented by any existing technology.

Claims

1. A synchronization method for a low-code multi-environment database structure, characterized in that: A new table structure is created in the test environment database and synchronized with the production environment database. The synchronization method includes: (1) Filter out the table structure that needs to be synchronized in the test environment database; (2) Pass the table names of all table structures that need to be synchronized to the page; (3) Pass the table name that needs to be synchronized to the server based on the page selected by the user; (4) Generate the corresponding SQL statement for the table structure to be synchronized through the preset template in the server; (5) Synchronize the generated SQL statements to the production environment database; (6) Start the production environment server, obtain the SQL statement after synchronization with the production database, and execute it.

2. A synchronization method for low-code multi-environment database structure according to claim 1, characterized in that: The table structure is displayed on the page in the form of a list.

3. A synchronization method for low-code multi-environment database structure according to claim 1, characterized in that: In step (2), the table name is passed to the page through the interface.

4. A synchronization method for low-code multi-environment database structure according to claim 1, characterized in that: The preset template is a sentence template with placeholders.

5. A synchronization method for low-code multi-environment database structure according to claim 4, characterized in that: The specific method of step (4) is: replace the placeholders in the server preset template with the table name and table field information of the corresponding synchronization table.

6. A synchronization device for a low-code multi-environment database structure, characterized in that: include: The query module is used to query the table names and table structures that need to be synchronized in the test environment database; The transfer module is used to transfer the table name of the table structure that needs to be synchronized to the page through the interface; A generation module is used to generate corresponding SQL statements for the table structure that needs to be synchronized using a preset template; The synchronization module is used to synchronize the generated corresponding SQL statements to the production environment database; The execution module is used to execute SQL statements in the production environment database.

7. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the synchronization method according to any one of claims 1 to 5.

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 computer program implements the synchronization method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Rapid database-system-across data increment migration method

    CN105373621A

  • MySQL-based sub-library and sub-table synchronization method and device, electronic equipment and computer readable storage medium

    CN113360470A

  • Database data synchronization method and device, computer equipment and medium

    CN113486119A

  • Database table generation method and device, storage medium and electronic device

    CN115687349A

  • Structural synchronization method, device and equipment of multi-environment database and medium

    CN115994189A