Database management method, device, electronic equipment, program element, and storage medium

By displaying test environment controls on the target interface and obtaining and executing the target script, the problem of non-database administrators being unable to operate the database and the inconsistency between the test environment was solved, thereby improving database operation efficiency and software development efficiency.

CN116701403BActive Publication Date: 2026-06-09CHINA CONSTRUCTION BANK +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2023-06-27
Publication Date
2026-06-09

Smart Images

  • Figure CN116701403B_ABST
    Figure CN116701403B_ABST
Patent Text Reader

Abstract

This application provides a database management method, apparatus, electronic device, program unit, and storage medium. The method includes: receiving input from a target test environment control among multiple test environment controls in a target interface; responding to the input from the target test environment control, obtaining a database language target script corresponding to the target test environment control from the cloud corresponding to the distributed version control, the target script including a database identifier of the target database; and sending the target script to a server, the server running the target script to operate on the target database, the target script including a script for handling the consistency of database tables in multiple test environments. This application solves the problems of non-database administrators being unable to execute SQL operations, difficulties in tracing the source, and low software development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of databases, specifically to database management methods, apparatus, electronic devices, program units, and storage media. Background Technology

[0002] As system business grows, the early monolithic architecture is insufficient to meet the demands of rapid development and deployment, leading to the emergence of large-scale systems such as microservice architectures. Large systems typically have multiple databases. For example, a microservice architecture includes many microservices, and each microservice has its own independent database for later data maintenance. Due to the large number of databases, database security is a concern, and database operation permissions for some developers are restricted. Only designated database administrators can perform large-scale SQL operations such as adding, deleting, and modifying data, and altering table structures. Non-database administrators cannot perform these SQL operations. Since most database operations are performed by database administrators, it is difficult to identify the specific person responsible for each SQL operation, making attribution difficult.

[0003] Furthermore, in order to meet the software development and testing needs of large-scale systems, multiple test environments are often used in parallel. Each developer needs to modify the database table structure of the test environment when conducting tests. As a result, the database table structures of multiple test environments will be inconsistent, leading to low software development efficiency. Summary of the Invention

[0004] This application provides a database operation method, apparatus, electronic device, program product, and storage medium to solve the problems in the prior art where non-database administrators cannot perform SQL operations, tracing is difficult, and software development efficiency is low.

[0005] Firstly, this application provides a database operation method, including:

[0006] Receives input for the target test environment control among multiple test environment controls in the target interface;

[0007] In response to input from the target test environment control, a database language target script corresponding to the target test environment control is obtained from the cloud corresponding to the distributed version control system. The target script includes the database identifier of the target database.

[0008] The target script is sent to a server, which runs the target script and operates on the target database. The target script includes a target script for handling the consistency of database tables in the multiple test environments.

[0009] Secondly, embodiments of this application provide a database operation apparatus, including:

[0010] The receiving module is used to receive input from the target test environment control among multiple test environment controls in the target interface;

[0011] The acquisition module is used to, in response to the input of the target test environment control, acquire the database language target script corresponding to the target test environment control from the cloud corresponding to the distributed version control system, wherein the target script includes the database identifier of the target database;

[0012] A sending module is used to send the target script to a server, the server being used to run the target script and operate on the target database, the target script including a target script for processing the consistency of database tables in the multiple test environments.

[0013] Thirdly, embodiments of this application provide an electronic device, including a processing component, a storage component, and a display component.

[0014] The storage component stores one or more computer instructions, which are invoked and executed by the processing component to implement the database operation method described in the first aspect.

[0015] Fourthly, embodiments of this application provide a computer storage medium storing a computer program, which, when executed by a computer, implements the database operation method as described in the first aspect.

[0016] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the database operation method as described in the first aspect.

[0017] This application provides a database management method, apparatus, electronic device, program unit, and storage medium. It displays multiple test environment controls on a target interface; in response to input to the target test environment controls, it obtains a target script corresponding to the entry environment option; by receiving user input, it allows developers who are not database administrators to operate the database using the target script, and it can obtain the user operating the target script on the target interface, thereby achieving script tracing. Furthermore, by displaying different entry options on the target interface, it can receive user selections for changing data table structures, thereby sending the corresponding target script to the server for execution. Since the target script includes scripts for handling the consistency of database tables in the multiple test environments, it can achieve the unification of data table structures across multiple test environments.

[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.

[0020] Figure 1 This is a schematic diagram illustrating an application scenario of a database operation method provided in an embodiment of this application;

[0021] Figure 2 A flowchart illustrating a database operation method provided in an embodiment of this application;

[0022] Figure 3 This is a schematic diagram illustrating an application scenario of another database operation method provided in an embodiment of this application.

[0023] Figure 4 This is a schematic diagram of the structure of a database operation device provided in an embodiment of this application;

[0024] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0026] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples consistent with some aspects of this application as detailed in the appended claims.

[0027] Before introducing the solution of this application, let me first give an overview of the invention:

[0028] The inventors discovered that large systems typically have multiple databases. Due to the large number of databases, and considering database security issues, database operation permissions for some developers are restricted. Only designated database administrators can execute SQL operations with a significant impact, such as adding, deleting, and modifying data, or altering table structures. Non-database administrators cannot execute these SQL operations and can only perform operations that do not affect the database data, such as querying data. This leads to low efficiency in database operation and data management. Furthermore, since most database operations are performed by database administrators, it is difficult to identify the specific developer associated with each SQL operation, making tracing the source difficult.

[0029] In order to meet the software development and testing needs of large-scale systems, multiple test environments are often used in parallel. Each developer needs to modify the database table structure of the test environment when conducting tests. As a result, the database table structures of multiple test environments will be inconsistent, leading to low software development efficiency.

[0030] Therefore, in large systems with multiple databases, improving database operation efficiency, tracing the source of data, and increasing software development efficiency are urgent problems to be solved during software development.

[0031] To address the aforementioned needs, this disclosure proposes a method for large-scale systems that involves displaying multiple test environment controls on a target interface; responding to input to the target test environment controls to obtain the target script corresponding to the entry environment option; and allowing non-database administrator developers to manipulate the database using the target script by receiving user input. Furthermore, the target interface can identify the user operating the target script, thus achieving script tracing. The display of different entry options on the target interface allows for receiving user selections regarding changes to the data table structure, thereby sending the corresponding target script to the server for execution. Since the target script includes scripts for handling consistency of database tables across multiple test environments, it enables the unification of data table structures across multiple test environments.

[0032] Furthermore, the database operation method provided in this application can be applied to any system that has multiple databases.

[0033] The database operation methods described above can be performed by a continuous integration tool, such as Jenkins, Bamboo, and CircleCI.

[0034] Figure 1 This is a schematic diagram illustrating an application scenario of a database operation method provided in an embodiment of this application, such as... Figure 1 As shown, this application scenario includes distributed version control systems, cloud computing, continuous integration tools, and server-side applications.

[0035] The distributed version control system can be Git, VSS, HG, etc., used to receive scripts sent by various developers. The scripts can perform operations such as adding, deleting, modifying, and querying data in the database, or adding or modifying the database table structure of the test environment in a large system, and then send the scripts to the cloud.

[0036] The cloud is used to store scripts sent by the distributed version control system. The cloud can be a server, multiple servers, a server cluster, a cloud computing platform, etc. Optionally, the computing device can also be other types of devices. This disclosure does not limit the type of computing device.

[0037] The continuous integration tool displays the options for each test environment and operation data table corresponding to a large system. Upon receiving the user's selection of a target option, it retrieves the script corresponding to that target option from the cloud and sends the script to the corresponding directory on the server.

[0038] The server is used to run scripts to manipulate the database. The server can be a single server, multiple servers, a server cluster, a cloud computing platform, etc.

[0039] It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of this disclosure, and the implementation of this disclosure is not limited in any way. On the contrary, the implementation of this disclosure can be applied to any applicable scenario.

[0040] To address the problems of the prior art, embodiments of this application provide a database operation method, apparatus, electronic device, program product, and storage medium. The database operation method provided in this application embodiment will be described first below.

[0041] Figure 2 A schematic flowchart of a database operation method provided in one embodiment of this application is shown. Figure 2 As shown, the execution device of this method can be a continuous integration tool, and the method can include:

[0042] S201, Receive input for the target test environment control among multiple test environment controls in the target interface.

[0043] The target interface can be the interface provided by the client of the continuous integration tool. This target interface can display multiple test environment controls. These multiple test environments are... Figure 1 The application scenarios shown correspond to multiple test environments for large-scale systems.

[0044] The target interface can also receive input for multiple test environment controls, which can be selection operations, confirmation operations, etc.

[0045] S202. In response to input from the target test environment control, retrieve the target script corresponding to the target test environment control from the cloud corresponding to the distributed version control system.

[0046] The target script includes the database identifier of the target database; the target script can be an SQL script or other script used to manipulate the database.

[0047] Understandably, after developing a script, the user knows clearly the test environment in which the script operates and the function of the script. Therefore, the system can receive user input for the target test environment control, which corresponds to the user's script. This allows the system to retrieve the target script corresponding to the target test environment control from the cloud within the distributed version control system.

[0048] Among them, users can be R&D personnel.

[0049] A distributed version control system can receive scripts sent by users and send them to the cloud for storage. The storage location will be notified to the continuous integration tool, so that the continuous integration tool can retrieve the target script corresponding to the target test environment control from the storage location.

[0050] In some embodiments, the script may include a test environment identifier. After receiving input for a target test environment control, the target test environment identifier corresponding to the target test environment control can be obtained. The script corresponding to the target test environment identifier can be obtained from a storage location and identified as the target script.

[0051] In other embodiments, the script may also include a script type, which may be a Data Manipulation Language (DML) or a Data Definition Language (DDL). DML scripts are used to specify a dedicated test environment configuration, allowing different test data in the database for different test environments. DDL scripts are used to handle the consistency of database tables in multiple test environments to ensure that the data table structure is consistent across different test environments. The target script type corresponding to the target test environment control is determined, and the script corresponding to the target script type can be retrieved from the storage location and identified as the target script.

[0052] In addition, the corresponding target script can be determined by combining the test environment identifier corresponding to the target test environment control and the script type.

[0053] S203. The target script is sent to the server, which runs the target script and operates on the target database.

[0054] The server can run the target script, or the reader can have a third-party program installed that runs the target script, and the server runs the target script to operate on the target database.

[0055] According to S202, the script can include DDL type scripts. DDL type scripts are used for the integration and prototyping of a script that can be applied to the entire test environment to ensure the consistency of data table structure in different test environments. Thus, the target script includes scripts that handle the consistency of database tables in multiple test environments.

[0056] This application provides a database management method, apparatus, electronic device, program unit, and storage medium. It displays multiple test environment controls on a target interface; in response to input to the target test environment controls, it obtains a target script corresponding to the entry environment option; by receiving user input, it allows developers who are not database administrators to operate the database using the target script, and it can obtain the user operating the target script on the target interface, thereby achieving script tracing. Furthermore, by displaying different entry options on the target interface, it can receive user selections for changing data table structures, thereby sending the corresponding target script to the server for execution. Since the target script includes scripts for handling the consistency of database tables in multiple test environments, it can achieve the unification of data table structures across multiple test environments.

[0057] In some embodiments, the target script includes a data definition language script and a data manipulation language script. In response to input from the target test environment control, S202 retrieves the target database language script corresponding to the target test environment control from the cloud corresponding to the distributed version control system, including:

[0058] In response to input from the target test environment control, if the script type corresponding to the target test environment control is Data Definition Language, the Data Definition Language script is retrieved from the cloud corresponding to the distributed version control system.

[0059] Alternatively, in response to input from the target test environment control, if the script type corresponding to the target test environment control is Data Manipulation Language (DML), the DML script can be retrieved from the cloud corresponding to the distributed version control system.

[0060] Data Definition Language (DDL) scripts are suitable for processing data in a target database across multiple test environments.

[0061] Data manipulation language scripts are suitable for processing data in a target database within a target testing environment.

[0062] The script can also include script types, which can be DML or DDL. DML scripts are used to specify a dedicated test environment configuration, allowing different test data in the database for different test environments. DDL scripts are used to handle the consistency of database tables in multiple test environments to ensure that the data table structure is consistent across different test environments.

[0063] Since DML-type scripts are used to specify a dedicated test environment configuration, and different test environments allow different test data in the database, DML-type scripts can correspond to a specified test environment in a large system, and the number of specified test environments can be one or more; since DDL-type scripts are used to handle the consistency of database tables in multiple test environments, DML-type scripts will correspond to all test environments in a large system.

[0064] Each test environment control corresponds to a script type. In response to the input of the target test environment control, the script type corresponding to the target test environment control is obtained. If the script type corresponding to the target test environment control is Data Manipulation Language (DML), the DML script is obtained from the cloud of the distributed version control system.

[0065] In this embodiment of the application, by distinguishing between DDL and DML scripts, the consistency of table structure across all test environments is guaranteed to the greatest extent possible, while allowing each test environment to freely manipulate table data content.

[0066] In some embodiments, multiple scripts are stored in the cloud, each script including a test environment identifier. In response to input from a target test environment control, if the script type corresponding to the target test environment control is Data Manipulation Language (DML), a DML script is retrieved from the cloud corresponding to the distributed version control system, including:

[0067] In response to input from the target test environment controls, at least one script of type Data Manipulation Language is identified from multiple scripts in the cloud.

[0068] At least one script identifies a target script that includes a target test environment identifier.

[0069] It is understandable that DML-type scripts can correspond to a specific test environment in a large system, and the number of such test environments can be one or more. Therefore, it is necessary to identify the DML-type scripts that include the target test environment identifier.

[0070] In some embodiments, in response to input from a target test environment control, at least one script of type Data Manipulation Language can be identified among multiple scripts, and a target script including a target test environment identifier can be further identified among the at least one script, thereby determining a script type that matches the target test environment control and a target script including a target test environment identifier.

[0071] In some examples, the target interface includes three test environment controls: a first DML test environment control, a second DML test environment control, and a DDL test environment control. When the first DML test environment control receives user input, it first identifies at least one script of type DML in the cloud, and then identifies a target script within that script that includes the test environment identifier corresponding to the first DML test environment control. When the second DML test environment control receives user input, it first identifies at least one script of type DML in the cloud, and then identifies a target script within that script that includes the test environment identifier corresponding to the second DML test environment control. When the DDL test environment control receives user input, it identifies a target script of type DDL in the cloud.

[0072] In this embodiment of the application, when the script type corresponding to the target test environment control is a data manipulation language, at least one script determines a target script that includes a target test environment identifier, thereby determining a target script that conforms to the script type corresponding to the target test environment control and includes a target test environment identifier.

[0073] In some embodiments, to avoid erroneous script extraction, the method further includes the following steps before sending the target script to the server in S203:

[0074] Retrieve keywords from the target script;

[0075] If the target script is a Data Definition Language script, check whether the keyword includes the first target keyword; if the keyword does not include the first target keyword, send the target script to the server.

[0076] Alternatively, if the target script is a data manipulation language, check whether the keyword includes the second target keyword; if the keyword does not include the second target keyword, send the target script to the server.

[0077] The first target keyword can include database languages ​​such as CREATE and ALTER, while the second target keyword can include database languages ​​such as INSERT and UPDATE.

[0078] Since DML scripts can correspond to one or more test environments in a large system, and DML scripts can correspond to all test environments in a large system, it is important to prevent developers from mistakenly converting DML scripts into DDL scripts and applying them to all test environments, or converting DDL scripts into DML scripts and applying them to only one or more test environments.

[0079] Generally, both DML and DDL type scripts contain database keywords that cannot appear. After obtaining the target script from the cloud, the script type of the target script is determined, and keywords that do not conform to the current script type are identified based on the script type. For example, DML type scripts cannot contain database languages ​​such as INSERT and UPDATE, and DDL type scripts cannot contain database languages ​​such as CREATE and ALTER.

[0080] This application embodiment avoids developers from mistakenly extracting scripts by performing keyword verification on the obtained target scripts, converting DML scripts into DDL scripts and applying them to all test environments, or converting DDL scripts into DML scripts and applying them to only one or more test environments.

[0081] In some embodiments, the server includes a version control tool, which includes multiple directories, each directory corresponding to a test environment identifier and a database identifier; S203 sends the target script to the server, including:

[0082] Parse the target script to obtain the target test environment identifier and target database identifier corresponding to the target script;

[0083] Store the target script in the directory corresponding to the target test environment identifier and the target database identifier in the server's version control tool.

[0084] Version control tools can include Migration, Flyway, etc.

[0085] Typically, version control tools include multiple directories, each configured with corresponding test environment identifiers and database identifiers. For example, a system may correspond to three databases, namely database 1, database 2, and database 3, and have three test environments, namely test environment 1, test environment 2, and test environment 3.

[0086] After the continuous integration tool obtains the target script, it parses the target script to obtain the target test environment identifier and target database identifier corresponding to the target script. Furthermore, it can obtain the directory corresponding to the target test environment identifier and target database identifier in multiple directories, and then store the target script in that directory.

[0087] The target script can be one or more. Furthermore, a single target script can correspond to multiple test environments or include multiple database identifiers. For example, if a script corresponds to test environment 1 and test environment 2, and includes database identifiers for database 1 and database 2, then this target script can be segmented into multiple sub-target scripts. Corresponding to the above script, it can be segmented into four sub-target scripts: the sub-target script corresponding to test environment 1 and database 1; the sub-target script corresponding to test environment 1 and database 2; the sub-target script corresponding to test environment 2 and database 1; and the sub-target script corresponding to test environment 2 and database 2. Each sub-target script is then sent to its corresponding directory on the server.

[0088] In some embodiments, for traceability, i.e., determining the script's execution time and developers, after storing the target script in the directory corresponding to the target test environment identifier and the target database identifier in the server's version control tool, the method further includes:

[0089] Receive the execution time of the target script sent by the version control tool.

[0090] Obtain the user identifier corresponding to the target script.

[0091] In some embodiments, after running the target script, the version control tool can send the corresponding runtime to the continuous integration tool so that the continuous integration tool can trace the runtime of the target script.

[0092] It is understandable that the user's input in the target test environment control is to obtain the script developed by the user. Before the user inputs, they will log in with their own user ID to access the target interface. Therefore, after obtaining the target script of the database language corresponding to the target test environment control from the cloud corresponding to the distributed version control system, the user ID corresponding to the target script can be obtained, that is, the user ID of the user who logged in to the target interface, thus realizing the traceability of the target script.

[0093] In addition, to describe the above database operation method, this application embodiment also provides an application scenario diagram of another database operation method, such as... Figure 3As shown, this application scenario includes a distributed version control system, which receives scripts submitted by users and stores them in the cloud. The scenario also includes a continuous integration tool, which has a client configured with multiple test environment controls on its target page. By receiving user input for these controls, the tool retrieves the target script corresponding to each control from the cloud and validates it based on its script type and keywords. If validation is successful, it determines the target test environment identifier and target database identifier for the target script.

[0094] Furthermore, this application scenario also includes a server-side component configured with multiple databases and a version control tool that operates on these databases. This version control tool comprises multiple directories. Each directory is configured with a corresponding test environment identifier and database identifier. The continuous integration tool can obtain the test environment identifier and database identifier for each directory, identify the directory corresponding to the target test environment identifier and target database identifier, and send the target script to that directory.

[0095] Based on the database operation method provided in the above embodiments, this application also provides a database operation apparatus, such as... Figure 4 As shown.

[0096] like Figure 4 As shown, the database operation device provided in this application embodiment may include a receiving module 401, an acquisition module 402, and a sending module 403.

[0097] The receiving module 401 is used to receive input for the target test environment control among multiple test environment controls in the target interface;

[0098] The acquisition module 402 is used to, in response to the input of the target test environment control, acquire the database language target script corresponding to the target test environment control from the cloud corresponding to the distributed version control system, wherein the target script includes the database identifier of the target database;

[0099] The sending module 403 is used to send the target script to the server, the server is used to run the target script and operate on the target database, the target script includes a target script for processing the consistency of database tables in the multiple test environments.

[0100] This application provides a database management device that displays multiple test environment controls on a target interface; in response to input to the target test environment controls, it obtains a target script corresponding to the entry environment option; by receiving user input operations, it allows developers who are not database administrators to operate the database using the target script, and it can obtain the user operating the target script on the target interface, thereby achieving the purpose of script tracing; and by displaying different entry options on the target interface, it can receive user selection operations for changing the data table structure, thereby sending the corresponding target script to the server so that the server can execute the target script. Since the target script includes a script for handling the consistency of database tables in the multiple test environments, it can achieve the unification of data table structures in multiple test environments.

[0101] In some embodiments, the target script includes a data definition language script and a data manipulation language script, and the acquisition module 402 is specifically used for:

[0102] In response to the input of the target test environment control, if the script type corresponding to the target test environment control is Data Definition Language, the Data Definition Language script is obtained from the cloud corresponding to the distributed version control system. The Data Definition Language script is suitable for processing data in the target database in multiple test environments.

[0103] Alternatively, in response to input from the target test environment control, if the script type corresponding to the target test environment control is Data Manipulation Language (DML), a DML script is obtained from the cloud corresponding to the distributed version control system. The DML script is suitable for processing data in the target database within the target test environment.

[0104] In some embodiments, the cloud storage contains multiple scripts, each script including a test environment identifier. The acquisition module 402 is further specifically used for:

[0105] In response to input from the target test environment control, at least one script of type Data Manipulation Language is identified from among multiple scripts in the cloud.

[0106] The at least one script identifies a target script that includes a target test environment identifier.

[0107] In some embodiments, to prevent users from accidentally submitting scripts, the acquisition module 402 is also used to acquire the keywords of the target script.

[0108] The above-mentioned device also includes: a detection module, used for:

[0109] If the target script is a Data Definition Language script, detect whether the keyword includes the first target keyword; if the keyword does not include the first target keyword, store the target script in the target database.

[0110] Alternatively, if the target script is a data manipulation language, detect whether the keyword includes a second target keyword; if the keyword does not include the second target keyword, store the target script in the target database.

[0111] In some embodiments, the server includes a version control tool, which includes multiple directories, each directory corresponding to a test environment identifier and a database identifier. The sending module 403 is specifically used for:

[0112] Parse the target script to obtain the target test environment identifier and target database identifier corresponding to the target script;

[0113] The target script is stored in the directory corresponding to the target test environment identifier and the target database identifier in the version control tool of the server.

[0114] In some embodiments, script tracing is also required, and the receiving module 401 is further configured to:

[0115] Receive the execution time of the target script sent by the version control tool;

[0116] Obtain the user identifier corresponding to the target script.

[0117] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 5 As shown, the electronic device may include a processor 501 and a memory 502 storing computer programs or instructions.

[0118] Specifically, the processor 501 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.

[0119] Memory 502 may include mass storage for data or instructions. For example, and not limitingly, memory 502 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 502 may include removable or non-removable (or fixed) media. Where appropriate, memory 502 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 502 is non-volatile solid-state memory. Memory may include read-only memory (ROM), random-access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, a memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described in the database operation methods provided in the above embodiments.

[0120] The processor 501 implements any of the database operation methods described in the above embodiments by reading and executing computer program instructions stored in the memory 502.

[0121] In one example, the electronic device may also include a communication interface 503 and a bus 504. For example, Figure 5 As shown, the processor 501, memory 502, and communication interface 503 are connected through bus 504 and complete communication with each other.

[0122] The communication interface 503 is mainly used to realize communication between various modules, devices, units and / or devices in the embodiments of the present invention.

[0123] Bus 504 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 504 may include one or more buses. Although specific buses are described and illustrated in embodiments of the invention, the invention contemplates any suitable bus or interconnect.

[0124] The electronic device can execute the database operation method in the embodiments of the present invention, thereby realizing the database operation method described in the above embodiments.

[0125] Furthermore, in conjunction with the database operation methods in the above embodiments, this invention can be implemented using a readable storage medium. This readable storage medium stores program instructions, which, when executed by a processor, implement any of the database operation methods described in the above embodiments.

[0126] Furthermore, in conjunction with the database operation methods in the above embodiments, this application provides a computer program product. When the instructions in the computer program product are executed by the processor of an electronic device, the electronic device is able to execute any one of the database operation methods in the above embodiments.

[0127] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0128] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the required tasks. The programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0129] It should also be noted that the exemplary embodiments mentioned in this invention describe methods or systems based on a series of steps or apparatus. However, this invention is not limited to the order of the steps described above; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0130] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0131] The above description is merely a specific embodiment of the present invention. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. A database operation method characterized by, include: Receives input for the target test environment control among multiple test environment controls in the target interface; In response to input from the target test environment control, a target script corresponding to the target test environment control is obtained from the cloud corresponding to the distributed version control system. The target script includes the database identifier of the target database. The target script is sent to a server, which runs the target script and operates on the target database. The target script includes a script for handling the consistency of database tables in the multiple test environments. The server includes a version control tool, which includes multiple directories, each directory corresponding to a test environment identifier and a database identifier; Sending the target script to the server includes: Parse the target script to obtain the target test environment identifier and target database identifier corresponding to the target script; The target script is stored in the directory corresponding to the target test environment identifier and the target database identifier in the version control tool of the server; When the target script corresponds to multiple target test environment identifiers or multiple target database identifiers, storing the target script in the directory corresponding to the target test environment identifier and the target database identifier in the version control tool of the server includes: The target script is divided into multiple sub-target scripts; each sub-target script corresponds to a target test environment identifier or a target database identifier. For each sub-target script, store it in the directory corresponding to its target test environment identifier or target database identifier.

2. The method according to claim 1, characterized in that, The target script includes a data definition language script and a data manipulation language script; the step of retrieving the target script corresponding to the target test environment control from the cloud corresponding to the distributed version control in response to input from the target test environment control includes: In response to the input of the target test environment control, if the script type corresponding to the target test environment control is Data Definition Language, the Data Definition Language script is obtained from the cloud corresponding to the distributed version control system. The Data Definition Language script is suitable for processing data in the target database in multiple test environments. Alternatively, in response to input from the target test environment control, if the script type corresponding to the target test environment control is Data Manipulation Language (DML), a DML script is obtained from the cloud corresponding to the distributed version control system. The DML script is suitable for processing data in the target database within the target test environment.

3. The method according to claim 2, characterized in that, The cloud storage contains multiple scripts, each script including a test environment identifier. In response to input from the target test environment control, if the script type corresponding to the target test environment control is Data Manipulation Language (DML), the DML script is retrieved from the cloud corresponding to the distributed version control system, including: In response to input from the target test environment control, at least one script of type Data Manipulation Language is identified from among multiple scripts in the cloud. The at least one script identifies a target script that includes a target test environment identifier.

4. The method according to any one of claims 1 to 3, characterized in that, Before sending the target script to the server, the method further includes: Obtain the keywords of the target script; If the target script is a Data Definition Language script, check whether the keyword includes the first target keyword; if the keyword does not include the first target keyword, send the target script to the server. Alternatively, if the target script is a data manipulation language, detect whether the keyword includes a second target keyword; if the keyword does not include the second target keyword, send the target script to the server.

5. The method according to claim 1, characterized in that, The method further includes: Receive the execution time of the target script sent by the version control tool; Obtain the user identifier corresponding to the target script.

6. A database operation device, characterized in that, include: The receiving module is used to receive input from the target test environment control among multiple test environment controls in the target interface; The acquisition module is used to, in response to the input of the target test environment control, acquire the database language target script corresponding to the target test environment control from the cloud corresponding to the distributed version control system, wherein the target script includes the database identifier of the target database; A sending module is used to send the target script to a server, the server is used to run the target script and operate on the target database, the target script includes a target script for processing the consistency of database tables in the multiple test environments; The server includes a version control tool, which includes multiple directories, each directory corresponding to a test environment identifier and a database identifier; The sending module specifically includes: Parse the target script to obtain the target test environment identifier and target database identifier corresponding to the target script; The target script is stored in the directory corresponding to the target test environment identifier and the target database identifier in the version control tool of the server; When the target script corresponds to multiple target test environment identifiers or multiple target database identifiers, storing the target script in the directory corresponding to the target test environment identifier and the target database identifier in the version control tool of the server includes: The target script is divided into multiple sub-target scripts; each sub-target script corresponds to a target test environment identifier or a target database identifier. For each sub-target script, store it in the directory corresponding to its target test environment identifier or target database identifier.

7. An electronic device, characterized in that, This includes the processor and the memory that stores computer program instructions; The processor executes the database operation method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the database operation method as described in any one of claims 1-5.

9. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device is able to perform the database operation method as described in any one of claims 1-5.