CN115617772A - Change processing method and device and related equipment - Google Patents

Change processing method and device and related equipment Download PDF

Info

Publication number
CN115617772A
CN115617772A CN202110802362.2A CN202110802362A CN115617772A CN 115617772 A CN115617772 A CN 115617772A CN 202110802362 A CN202110802362 A CN 202110802362A CN 115617772 A CN115617772 A CN 115617772A
Authority
CN
China
Prior art keywords
change operation
database model
metadata
condition
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110802362.2A
Other languages
Chinese (zh)
Inventor
何国平
凌云
杨少兵
罗标
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to CN202110802362.2A priority Critical patent/CN115617772A/en
Publication of CN115617772A publication Critical patent/CN115617772A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management

Abstract

The embodiment of the application provides a change processing method, a change processing device and related equipment, and is applied to the technical field of databases. In the embodiment of the application, when the user automatically generates the safe DDL after the database model is changed, the safe DDL cannot report an error or interrupt the execution in the execution process, so that the risk that the database model is damaged is reduced, and the safety and the stability of the system are improved.

Description

Change processing method and device and related equipment
Technical Field
The present application relates to the field of database technologies, and in particular, to a change processing method and apparatus, and a related device.
Background
In the design and deployment process of the database, the database model is usually designed and completed by modifying the database model for many times along with service adjustment and demand change. The Data model may be modified through a Database Definition Language (DDL) statement. For example, when a user creates a database, the change to the database can be realized by the following DDL statements: CREATE DATABASE db _ name. Where "db _ name" is the name of the created database.
However, in scenarios such as automatic upgrade and cross-version upgrade, such DDL is prone to have execution errors and even interrupt execution, which results in low execution efficiency of database modification and affects user experience. For example, if a plurality of databases are upgraded to a target version, the database version to be upgraded may be different, and thus an upgrade DDL needs to be made for each version. Moreover, if the problem of failed upgrade is encountered during upgrade, the upgrade cannot be repeatedly executed, for example, a field C is added to a certain table a during one-time upgrade of the database. If the upgrade fails due to an accident during the execution of the subsequent operations, when the upgrade is re-executed, an error occurs when the statement for adding the field C is re-executed (because the last operation for adding one field C in the table a was successfully executed). At this time, the operations in the last upgrade process must be rolled back to upgrade the database again, which results in low execution efficiency of database modification and affects the user experience.
Therefore, how to solve the above problems is a hot spot being studied by those skilled in the art.
Disclosure of Invention
The embodiment of the application provides a change processing method, a change processing device and related equipment, which can improve the execution efficiency of changes and improve the stability and safety of a database system.
In a first aspect, an embodiment of the present application provides a change processing method, including:
receiving change operation of user equipment on metadata of a database model;
and generating a DDL statement of a database mode definition language according to the change operation, wherein the DDL statement comprises a DDL statement corresponding to condition audit and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition audit is used for determining whether the database model meets the condition for executing the change operation.
The above-described method may be applied to a server, performed by the server or a component (e.g., a chip, a software module, or an integrated circuit) within the server. Or the method may be applied to a database design system, for example, executed by a server of the database design system (the server may be implemented by a server, a cloud platform, or the like).
In the embodiment of the application, a user can change the database model on user equipment, and the server can generate the DDL statement according to the change operation. The DDL statement generated in the present application includes, in addition to the DDL statement corresponding to the change implementing operation, a DDL statement subjected to condition review, and is used to check whether a condition for executing a change is satisfied before executing a change operation. Through the embodiment of the application, the possibility of errors in execution of the DDL statement can be reduced, the execution efficiency of database change is improved, the stability and the safety of a system are enhanced, and the user experience is improved.
For example, if a user adds a field C to table a of the database model through the user device, the server may generate a DDL statement, which includes a DDL statement corresponding to the operation of "add a field C to table a" and a DDL statement that checks whether the field C already exists in table a. Illustratively, the condition of performing "one field C is added in table a" is satisfied in the case where the field C does not exist in table a; if the field C exists in the table a, it is not satisfied, and the subsequent change operation may not be performed.
It can be seen that the DDL statement is repeatedly executable, for example, during the upgrade process, the operation of "add a field C in table a" is successfully executed because the field C does not exist in table a. If the upgrade fails, and the field C exists in the table a, the DDL statement corresponding to the subsequent change operation may not be executed, and an error may not be reported directly, and it is not necessary to rollback all the operations or regenerate the DDL statement. By the embodiment of the application, the possibility of errors in execution of the DDL statement can be reduced, the execution efficiency of database change is improved, the stability and the safety of a system are enhanced, and the user experience is improved.
In one possible implementation of the first aspect, the method is applied to a database design system.
In one possible implementation of the first aspect, the method comprises:
executing the DDL statement to alter metadata of the database model.
In yet another possible implementation manner of the first aspect, the executing the DDL statement to alter metadata of the database model includes:
executing the DDL statement corresponding to the condition audit to determine whether the database model meets the condition for executing the change operation;
and under the condition that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model.
In yet another possible implementation of the first aspect, the method comprises:
and providing the DDL statement to user equipment.
In the embodiment of the present application, the generated DDL statement may be provided to the user equipment. The user device (or a user to whom the user device is adapted) may view the generated DDL statement.
Or further, the user device (or a user of the applicable user device) may provide the DDL statements to other environments for execution.
In a further possible implementation of the first aspect, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible implementation of the first aspect, the change operation includes deleting the first metadata in the database model; the condition for performing the change operation is satisfied when the first metadata is present in the database model.
In a further possible implementation manner of the first aspect, the change operation comprises adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
In yet another possible implementation of the first aspect, the altering operation includes modifying content of a third metadata in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
In yet another possible implementation manner of the first aspect, the executing the DDL statement to alter metadata of the database model includes:
executing the DDL statement through a storage process to alter metadata of the database model.
In yet another possible implementation manner of the first aspect, the executing the DDL statement by the storing process to alter the metadata of the database model includes:
creating a storage process; the content of the storage process is the DDL statement;
executing the stored procedure to alter the metadata of the database model.
In yet another possible implementation manner of the first aspect, the generating a database schema definition language DDL statement according to the change information includes:
and generating a DDL file suitable for the database type according to the change operation.
The embodiment of the application can be suitable for databases of various database types, and improves the compatibility of change processing.
In yet another possible implementation manner of the first aspect, the method further includes:
providing a database model design interface to user equipment;
and receiving the change operation of the metadata of the database model, which is input on the database model design interface by the user equipment.
In a second aspect, an embodiment of the present application provides a change processing method, including:
receiving change operation of a user on metadata of a database model;
sending the change operation on the metadata of the database model to a server; the change operation is used for generating DDL statements, the DDL statements comprise DDL statements corresponding to condition audit and DDL statements corresponding to the change operation, and the DDL statements corresponding to the condition audit are used for determining whether the database model meets the condition for executing the change operation.
In one possible implementation of the second aspect, the method is applied to a database design system.
In one possible embodiment of the second aspect, the method further comprises:
and receiving the DDL statement sent by the server.
In one possible embodiment of the second aspect, the method further comprises:
receiving a database model design interface provided by the server;
and presenting the database model design interface.
In a possible implementation manner of the second aspect, the receiving a change operation of a user on metadata of a database model includes:
and receiving the change operation of the metadata of the database model, which is input on the database model design interface by a user.
In yet another possible embodiment of the second aspect, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible implementation of the second aspect, the change operation includes deleting the first metadata in the database model; the condition for performing the change operation is satisfied when the first metadata is present in the database model.
In yet another possible implementation of the second aspect, the altering operation includes adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
In yet another possible implementation of the second aspect, the altering operation includes modifying the contents of a third metadata in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
In a third aspect, an embodiment of the present application provides a system, including a server and a user equipment, where:
the user equipment is used for sending the change operation of the user equipment on the metadata of the database model to a server;
the server is used for receiving the change operation of the user equipment on the metadata of the database model;
the server is further configured to generate a database schema definition language (DDL) statement according to the change information, where the DDL statement includes a DDL statement corresponding to condition review and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition review is used to determine whether the database model meets a condition for executing the change operation.
In a possible implementation manner of the third aspect, the server is further configured to execute the DDL statement to alter metadata of the database model.
In yet another possible implementation manner of the third aspect, the server is further configured to:
executing the DDL statement corresponding to the condition audit to determine whether the database model meets the condition for executing the change operation;
and under the condition that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model.
In a further possible implementation manner of the third aspect, the server is further configured to provide the DDL statement to the user equipment.
In yet another possible implementation of the third aspect, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible implementation of the third aspect, the change operation includes deleting the first metadata in the database model; the condition for performing the change operation is satisfied when the first metadata is present in the database model.
In yet another possible implementation of the third aspect, the altering operation includes adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
In yet another possible implementation of the third aspect, the altering operation includes modifying content of a third metadata in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
In a further possible implementation manner of the third aspect, the server is further configured to execute the DDL statement through a storing process to alter metadata of the database model.
In yet another possible implementation manner of the third aspect, the executing the DDL statement by the storing process to alter the metadata of the database model includes:
creating a storage process; the content of the storage process is the DDL statement;
executing the stored procedure to alter the metadata of the database model.
In yet another possible implementation manner of the third aspect, the server is further configured to generate a DDL file applicable to the database type according to the change operation.
In a fourth aspect, an embodiment of the present application provides a change processing apparatus, which is configured to implement the method described in any one of the first aspect.
In one possible implementation of the fourth aspect, the change processing device includes a processing unit and a communication unit, wherein:
the communication unit is used for receiving the change operation of the user equipment on the metadata of the database model;
the processing unit is configured to generate a database schema definition language (DDL) statement according to the change operation, where the DDL statement includes a DDL statement corresponding to a condition audit and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition audit is used to determine whether the database model satisfies a condition for executing the change operation.
In yet another possible implementation manner of the fourth aspect, the processing unit is further configured to execute the DDL statement to alter metadata of the database model.
In a further possible implementation manner of the fourth aspect, the processing unit is further configured to:
executing the DDL statement corresponding to the condition audit to determine whether the database model meets the condition for executing the change operation;
and under the condition that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model.
In yet another possible implementation manner of the fourth aspect, the communication unit is further configured to provide the DDL statement to the user equipment.
In a further possible embodiment of the fourth aspect, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible implementation of the fourth aspect, the change operation includes deleting the first metadata in the database model; satisfying a condition to perform the change operation when the first metadata exists in the database model.
In yet another possible implementation of the fourth aspect, the altering operation comprises adding second metadata in the database model; the condition to perform the change operation is satisfied when the first metadata is not present in the database model.
In yet another possible implementation of the fourth aspect, the altering operation includes modifying content of a third metadata in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
In a further possible implementation manner of the fourth aspect, the processing unit is further configured to:
executing the DDL statement through a storage process to alter metadata of the database model.
In yet another possible implementation manner of the fourth aspect, the processing unit is further configured to:
creating a storage process; the content of the storage process is the DDL statement;
executing the storage process to alter the metadata of the database model.
In a further possible implementation manner of the fourth aspect, the processing unit is further configured to:
and generating a DDL file suitable for the database type according to the change operation.
In a fifth aspect, an embodiment of the present application provides a change processing apparatus, which is configured to implement the method described in any one of the second aspects.
In one possible implementation manner of the fifth aspect, the change processing apparatus includes a communication unit, wherein:
the communication unit is used for receiving a change operation of a user on the metadata of the database model;
the communication unit is used for sending the change operation of the metadata of the database model to a server; the change operation is used for generating a DDL statement, the DDL statement comprises a DDL statement corresponding to condition audit and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition audit is used for determining whether the database model meets the condition for executing the change operation.
In one possible implementation of the fifth aspect, the method is applied to a database design system.
In a possible implementation manner of the fifth aspect, the communication unit is configured to receive the DDL statement sent by the server.
In a possible implementation manner of the fifth aspect, the communication unit is further configured to receive a database model design interface provided by the server;
the device further comprises: and the processing unit is used for presenting the database model design interface.
In a possible embodiment of the fifth aspect, the communication unit is further configured to receive a change operation on the metadata of the database model, which is input by a user on the database model design interface.
In yet another possible implementation of the fifth aspect, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible implementation of the fifth aspect, the change operation includes deleting the first metadata in the database model; satisfying a condition to perform the change operation when the first metadata exists in the database model.
In yet another possible implementation of the fifth aspect, the altering operation comprises adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
In yet another possible implementation of the fifth aspect, the altering operation includes modifying the contents of a third metadata in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
In a sixth aspect, embodiments of the present application provide a computing device comprising a processor and a communication interface; the communication interface is used for receiving and/or sending data, and/or the communication interface is used for providing input and/or output for the processor; the processor is configured to implement the method described in any of the preceding first aspects, or any of the second aspects.
It should be noted that the processor included in the computing device described in the sixth aspect may be a processor dedicated to execute the methods (referred to as a special-purpose processor for convenience), or may be a processor that executes the methods by calling a computer program, such as a general-purpose processor. Optionally, the at least one processor may also include both special purpose and general purpose processors.
Alternatively, the computer program may be stored in a memory. For example, the Memory may be a non-transitory (non-transitory) Memory, such as a Read Only Memory (ROM), which may be integrated with the processor on the same device or separately disposed on different devices, and the embodiment of the present application is not limited to the type of the Memory and the arrangement manner of the Memory and the processor.
In one possible implementation, the at least one memory is external to the computing device.
In yet another possible implementation, the at least one memory is located within the computing device.
In yet another possible implementation, a portion of the at least one memory is located within the computing device, and another portion of the memory is located outside of the computing device.
In this application, it is also possible that the processor and the memory are integrated in one device, i.e. that the processor and the memory are integrated together.
In a seventh aspect, embodiments of the present application provide a computer-readable storage medium having instructions stored therein, which when executed on at least one processor, implement the method described in any one of the foregoing first aspects or any one of the foregoing second aspects.
In an eighth aspect, the present application provides a computer program product comprising computer instructions that, when run on at least one processor, implement the method described in any of the preceding first to fourth aspects. The computer program product may be a software installation package, which may be downloaded and executed on a computing device in case it is desired to use the method as described above.
The beneficial effects of the technical methods provided in the second to eighth aspects of the present application can refer to the beneficial effects of the technical solution of the first aspect, and are not described herein again.
Drawings
The drawings that are required to be used in the description of the embodiments will now be briefly described.
Fig. 1 is a schematic structural diagram of a change processing system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a change processing method according to an embodiment of the present application;
FIG. 3 is a diagram of a DDL statement provided by an embodiment of the present application;
FIG. 4 is a diagram of another DDL statement provided by an embodiment of the present application;
FIG. 5 is a diagram of another DDL statement provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a storage process provided by an embodiment of the present application;
fig. 7 is a schematic structural diagram of a modification processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a computing device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
For ease of understanding, the following description is given by way of example of some concepts related to embodiments of the present application. As follows:
1. metadata
Metadata in embodiments of the present application is data in a data model, such as a library, table, field, index, entity, attribute, foreign key, trigger, view, stored procedure, function, or sequence.
Among them, a Database (DB) is a warehouse that organizes, stores, and manages data according to a data structure, and is an organized, sharable collection of a large amount of data stored in a computer. A table is a structured file used to store specific types of data, such as student information, institution directories, and the like. The data in the database is typically stored in the form of tables, each table having a unique identifier, such as a table name. A table comprises one or more columns (columns), each column being a field in the table, and each column storing information for a part of the table. For example, the database may contain a table indicating students, one column storing student identification (or called student ID) numbers of the students, and one column storing names (names) of the students.
2. Database model
When designing a database, the process of analyzing and abstracting the real world, finding internal relations from the real world, and further determining the structure of the database is called database design modeling. It mainly includes two parts: determining the most basic data structure and modeling the constraint. The database model may include: conceptual models, logical models, physical models, and the like.
A Conceptual model (Conceptual model), also called an information model, models data and information from the perspective of a user. The concept model is used for describing some concepts of user service requirements, the concepts do not contain attributes, and the concepts have analysis structures of entity sets and contact sets. Such as "students" and "colleges" in a school database, etc.
The logical model is an embodiment of the conceptual model. To implement what the conceptual model describes, specific functions and specific information are needed, which leads to a detailed stage of the demand analysis. The logic model mainly comprises structures such as entities, attributes, relations and the like.
Where entities are transactions that exist objectively and are distinguishable from each other. Such as specific students, orders, items, etc. The union of entities of the same type is called an entity set. An attribute is some property that an entity has. An entity is characterized by several attributes. Relationships, also known as connections, connections within an entity generally refer to connections between the various attributes that make up the entity, and connections between entities generally refer to connections between different sets of entities. Taking student data as an example: the "student" entity includes: attributes such as school number, name, sex, year and month of birth, and ID of the college; the "college" entities include: the ID of the college, the name of the college, the address, the name of the captain and other attributes; "students" and "colleges" may be associated, with one student affiliated with at least one college. The logic model describes what service the system is to implement through an Entity-Relationship (E-R) diagram, and describes the association Relationship among the entities in the service flow.
The physical model is the content stated by the logic model and is realized on a specific physical database engine. For example, on databases such as MySQL, oracle, mongoDB, etc., the logical model entity relationship is realized by physical tables, fields, main foreign keys, etc.
3. Database design system
The database design system is a visual database design and management tool, which is used for designing, building, using and maintaining a database. A user may create (or edit) a design view including charts and associations between charts in a database design system that is capable of storing the database design views created (or edited) by the user and that may model the database (or also include storing data of the database).
It should be understood that the user in this application is indicative of a user of the database design system, including a designer or developer of the database.
4. Storing procedure
A stored procedure is a set of Structured Query Language (SQL) statements that are intended to perform a particular function. The user may invoke execution by specifying the name of the stored procedure and giving parameters (optional).
The above exemplary description of the concept can be applied to the following embodiments.
The embodiment of the application provides a change processing method, a change processing device and related equipment, which can improve the execution efficiency of changes and improve the stability and safety of a database system.
Optionally, the change processing method of the database model provided in the embodiment of the present application may be implemented based on a database design system. The database design system may include a hardware module, a software module (such as an application program, a component, and the like), a combination of a hardware module and a software module, and the like.
In one possible design, the database design system may include a client and a server. The client can be used for presenting an interface, a selection box, an input box and other components for interacting with the user, and the server is used for providing structural data of the database model for the client or responding to a request of the user and the like.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an architecture of a possible change processing system according to an embodiment of the present disclosure. The change processing system belongs to the database design system. The system as shown in fig. 1 comprises at least one user equipment 101 and at least one server 102.
The user equipment 101 is an electronic device having data processing and data transceiving capabilities, and can implement the functions of the client. For example, the device may include a handheld terminal, a wearable device, a vehicle, a robot, or a separate device, or may be a component (e.g., a chip or an integrated circuit) included in a separate device. For example, when the terminal device is a handheld terminal, it may be a mobile phone (mobile phone), a tablet computer (pad), a computer (e.g., a laptop, a palmtop, etc.), and the like.
The server 102 is a device having data processing and data transmitting/receiving capabilities, and can implement the functions of the server. It should be understood that the description herein is referred to as a server, and the specific form thereof may be a physical device such as a server, or a host, etc., or a virtual device such as a virtual machine, or a container, etc. Alternatively, the server 102 may be deployed in one device independently or in a distributed manner on multiple devices.
By virtue of the user device 101 being able to make changes to the database model (or metadata in the database model), the user device 101 can submit the changes to the server 102. And the server 102 may generate DDL statements according to the change operation. The DDL statement generated in the present application includes, in addition to the DDL statement corresponding to the change implementing operation, a DDL statement subjected to condition review, and is used to check whether a condition for executing a change is satisfied before executing a change operation. Through the embodiment of the application, the possibility of errors in execution of the DDL statement can be reduced, the execution efficiency of database change is improved, the stability and the safety of a system are enhanced, and the user experience is improved.
For example, a user adds a field C in Table A of the database model via the user device 101. After the change is submitted to the server 102, the server 102 may generate a DDL statement, which includes a DDL statement corresponding to the operation of "add a field C in table a", and further includes a DDL statement for checking whether the field C already exists in table a. Illustratively, the condition of performing "one field C is added in table a" is satisfied in the case where field C is not present in table a; if the field C exists in the table a, it is not satisfied, and the subsequent change operation may not be performed.
It can be seen that the DDL statement is repeatedly executable, for example, during the upgrade process, the operation of "add a field C in table a" is successfully executed because the field C does not exist in table a. If the upgrade fails, and the field C exists in the table a, the DDL statement corresponding to the subsequent change operation may not be executed, and an error may not be reported directly, and it is not necessary to roll back all the operations or regenerate the DDL statement. By the embodiment of the application, the possibility of errors in execution of the DDL statement can be reduced, the execution efficiency of database change is improved, the stability and the safety of a system are enhanced, and the user experience is improved.
It should be understood that the link for communication between the server 102 and the user equipment 101 may be a wired link, a wireless link, or a combination of wired and wireless links. Further optionally, the communication may also be implemented via one or more network technologies. The communication method between the server and the user equipment 101 is not limited in the present application.
In one possible design, the server 102 as shown in fig. 1 may be a cloud platform. The cloud platform includes a large amount of basic resources (including but not limited to computing resources, storage resources, or network resources, etc.) provided by a cloud service provider, wherein the computing resources may be a large number of computing devices (e.g., servers, virtual machines).
In one possible implementation scenario, the database design system (and/or change handling system) can be provided to the user by a cloud service provider in a cloud service abstracted into a database design on a cloud platform. For example, after a user purchases a database design cloud service, the cloud platform creates a database design system instance on resources provided by a cloud service provider in response to a user-triggered database design system instance creation operation, and then provides a change processing service of a database model to the user. Accordingly, the user equipment used by the user can present an interface and use the change processing service.
The method for purchasing the database design cloud service may include: and (3) charging in advance and then settling according to the actual use condition of the final resource, or settling according to the time of using the cloud service or according to the purchased function or resource of the cloud service.
It should be noted that, in this embodiment of the present application, the cloud platform may be a cloud platform of a center cloud, a cloud platform of an edge cloud, or a cloud platform including a center cloud and an edge cloud, and this embodiment of the present application is not particularly limited thereto. Moreover, when the cloud platform is a cloud platform including a center cloud and an edge cloud, the database design system may be partially deployed in the cloud platform of the edge cloud and partially deployed in the cloud platform of the center cloud.
The method of the embodiments of the present application is described in detail below.
Referring to fig. 2, fig. 2 is a schematic flow chart of a modification processing method according to an embodiment of the present disclosure. Alternatively, the method may be applied to the system shown in fig. 2.
The change processing method shown in fig. 2 includes at least steps S201 to S202.
Step S201: the server receives a change operation of the user equipment on the metadata of the database model.
For the related concepts of the server, the user equipment, the database model, and the metadata, reference may be made to the foregoing description, which is not repeated herein.
Optionally, the change operation may be input by the user equipment, or may be input by a user using the user equipment by clicking, pressing, dragging, or the like on the user equipment. In one possible design, the user device may receive a change operation of the metadata of the database model by the user, and send the change operation to the server. Accordingly, the server receives the change operation of the user equipment on the metadata of the database model.
Further optionally, the server may provide a database model design interface to the user device. The user device or a user using the user device may alter the database model through the interface. For example, the user device may present the database model design interface through which the user may visually alter the database model (or alter the metadata of the database model).
Step S202: and the server generates a DDL statement according to the change operation.
Specifically, the DDL statement includes a DDL statement corresponding to the condition review and a DDL statement corresponding to the change operation. And the corresponding DDL statement of the condition audit is used for determining whether the database model meets the condition for executing the change operation.
The following exemplifies several possible designs:
design 1: the change operation comprises deleting the first metadata in the database model; the condition for performing the change operation is satisfied when the first metadata exists in the database.
For example, if the description field (i.e. the 'desc' field) is deleted in the user table (t _ user) of the database model, taking the database model as MySQL as an example, the DDL statement generated by the server is as shown in fig. 3. Referring to fig. 3, fig. 3 is a schematic diagram of a possible DDL statement provided in an embodiment of the present application. And checking the corresponding DDL statement according to the 2 nd-6 th behavior conditions. And 8, updating the statement corresponding to the operation.
Further, line 1 is the beginning of the statement. Line 2 is for explaining that the condition review is for judging whether or not the following condition exists, and if the content in parentheses in line 2 is yes, the content of "THEN" in line 7 is executed. Lines 3-6 (i.e., the contents of the parenthesis) are used to determine whether a table with the table name "t _ user" exists in the database model and whether a "desc" field exists in the table. The "information _ schema" in the third row is a system library in the MySQL database, and metadata such as libraries, tables, fields, and the like created by the user are all stored in the "information _ schema", and the user can query through the query library. Line 8 indicates that the "t _ user" table is modified, specifically the delete column 'desc'. Line 8 is used to end the decision statement and line 10 is used to indicate that the DDL statement is to end.
Optionally, UPPER () is a function for converting a string into uppercase, avoiding missing fields due to case.
Design 2: the change operation comprises adding second metadata in the database model; the condition for performing the change operation is satisfied when the first metadata is not present in the database.
For example, if a description field (i.e. a 'desc' field) is added to the user table (t _ user) of the database model, taking the database model as MySQL as an example, the DDL statement generated by the server is as shown in fig. 4. Referring to fig. 4, fig. 4 is a schematic diagram of a possible DDL statement provided in an embodiment of the present application. Wherein the 2 nd-6 th behavior conditions review the corresponding DDL statements. And 8, updating statements corresponding to the operation by the behaviors 8 and 8. Line 1 is the beginning of the statement. Line 2 is for explaining that the condition audit is for judging whether the following condition exists, and if the content in parentheses in line 2 is no, the content of line 7 "THEN" is executed. Lines 3-6 (i.e., the contents of the parenthesis) are used to determine whether a table with the table name "t _ user" exists in the data model and whether a "desc" field exists in the table. Line 8 indicates that the "t _ user" table is modified, specifically by adding the column 'desc' whose field is of a literal type and 500 bits in length (i.e., VARCHAR (500)), whose data may be NULL (i.e., NULL), and whose location is AFTER the 'name' field (i.e., AFTER 'name'). Line 10 is used to end the decision statement and line 11 is used to indicate that the segment of the DDL statement is ended.
Design 3: the change operation comprises modifying the content of a third element of data in the database model; the execution condition for executing the change operation is satisfied when the third metadata exists in the database.
Illustratively, if the data type of the description field (i.e. 'desc' field) is modified to be a character type of 100 (i.e.: VARCHAR (100)) and the default value is NULL (NULL) in the user table (t _ user) of the database model, taking the database model as MySQL as an example, the DDL statement generated by the server is as shown in FIG. 5. Referring to fig. 5, fig. 5 is a schematic diagram of a possible DDL statement provided in an embodiment of the present application. Wherein the 2 nd-6 th behavior conditions review the corresponding DDL statements. And 8, updating statements corresponding to the operation by the behaviors 8 and 8. Line 1 is the beginning of the statement. Line 2 is for explaining that the condition audit is for judging whether the following condition exists, and if the content in parentheses in line 2 is no, the content of line 7 "THEN" is executed. Lines 3-6 (i.e., the contents of the parenthesis) are used to determine whether a table with the table name "t _ user" exists in the data model and whether a "desc" field exists in the table. Line 8 indicates that the "t _ user" table is modified, specifically modified column 'desc', the data type of the modified 'desc' field is character-type, 100 bits in length (i.e., VARCHAR (100)), which may be NULL (i.e., NULL) and the DEFAULT value NULL (i.e., DEFALT NULL), which is located AFTER the 'name' field (i.e., AFTER 'name'). Line 10 is used to end the decision statement and line 11 is used to indicate that the segment of the DDL statement is ended.
Optionally, designs 1 through 3 above support coexistence. For example, the user device may make multiple changes to the database at one time, and the change operation may be submitted to the server at one time. The server judges the execution conditions of the plurality of change operations respectively, and generates corresponding safe DDL statements.
Optionally, the DDL statement corresponding to the change operation may include a Data management statement (DML) statement, which is used to add, delete, update, and query the metadata. For example, an UPDATE statement may be included for padding after adding a field.
In one possible design, the syntax of corresponding DDL statements for different database types may be different. When the DDL statement is generated in the application, the DDL statement suitable for the database type corresponding to the database model can be generated. The database type can be MySQL, mariaDB, cassandra, mongoDB, dynamo, levelDB, oracle and other types.
Optionally, the server may determine a database type corresponding to the database model modified by the user, and generate a corresponding DDL statement according to the change operation of the user and the corresponding database type. According to the method, the user can design and change various database models, and the server correspondingly generates the safe DDL statements suitable for the database models, so that the compatibility of the system is improved, and the user experience is improved.
In one possible design, the DDL statements may be executed by other computing devices to implement change operations on metadata of the database model.
Optionally, the embodiment shown in fig. 3 further includes one or more steps from step S203 to step S204. The steps S203 to S204 are specifically as follows:
step S203: the server executes the DDL statements to alter the metadata of the database model.
In particular, the DDL statements may be executed by a server to implement a change operation on metadata of a database model.
Optionally, when executing the DDL statement, the server may execute the condition audit on the corresponding DDL statement to determine whether the database model satisfies the condition for executing the change operation. And in the case that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model. See the design of various DDL statements in step S202.
In one possible design, the server may execute the DDL statement by a stored procedure. The storing process is a database object for calling, and the DDL statement is placed in the content of the storing process, so that the DDL statement can be executed by calling the storing process.
In one design, the server may create a stored procedure (specifying the name of the stored procedure), with the DDL statement as the content of the stored procedure; by calling the store procedure, the corresponding DDL statement is executed. Taking the DDL statement shown in fig. 3 as an example, the statement that invokes execution through a store procedure is shown in fig. 6. With lines 4-14 as shown in figures 3, lines 1-10. Line 1 is used to delete duplicate names of storage processes, avoiding errors in duplicate creation of storage processes of the same name. Line 2 is used to create a stored procedure, named "PROC _ TABLES _ CHANGE" (the name of the stored procedure is merely an example), lines 4-14 store the contents of the procedure, line 16 CALLs (CALL) the statement of the stored procedure, and line 17 deletes the statement of the stored procedure. It can be seen that by calling the store procedure, the corresponding DDL statement can be executed.
It should be understood that the names of the stored procedures shown in FIG. 6 are examples only. In one possible design, the server can name the storage process through a hash function, a random function, or character string splicing and the like, so that the possibility of renaming with other storage processes is reduced, the storage process is convenient to manage, and the system stability is improved.
Alternatively, the DDL statement may be executed by converting into an executable object, and the execution manner shown in fig. 6 is merely an example.
Step S204: the server provides the DDL statement to the user device. Accordingly, the user equipment receives the DDL statement provided by the server.
Optionally, the user device may present the DDL statement such that the user device (or a user of the applicable user device) may view the server-generated DDL statement.
Or further, the user device (or a user of the applicable user device) may provide the DDL statements to other environments for execution.
In the embodiment shown in fig. 2, a user may change the database model on the user device, and the server may generate the DDL statement according to the change operation. The DDL statement generated in the present application includes, in addition to the DDL statement corresponding to the change implementing operation, a DDL statement subjected to condition review, and is used to check whether a condition for executing a change is satisfied before executing a change operation. Through the embodiment of the application, the possibility of errors in execution of the DDL statement can be reduced, the execution efficiency of database change is improved, the stability and the safety of a system are enhanced, and the user experience is improved.
The method of the embodiments of the present application is explained in detail above, and the apparatus of the embodiments of the present application is provided below.
The method of the embodiments of the present application is explained in detail above, and the apparatus of the embodiments of the present application is provided below.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a change processing apparatus 70 according to an embodiment of the present application, where the change processing apparatus 70 may be a server or a user equipment, or may be a device in the server or the user equipment, such as a chip, a software module, an integrated circuit, and the like. The change processing device 70 is used to implement the change processing method described above, for example, the change processing method in the embodiment shown in fig. 3 or fig. 7.
In one possible embodiment, the change processing device 70 may include a communication unit 701 and a processing unit 702.
Here, the division of the plurality of units is only a logical division according to functions, and is not a limitation on the specific configuration of the change processing device 70. In a specific implementation, some of the functional modules may be subdivided into more tiny functional modules, or some of the functional modules may be combined into one functional module, but whether the functional modules are subdivided or combined, the general flow executed by the change processing device 70 in the process of performing the change processing is the same.
In a possible design, the change processing device 70 may be a server in the foregoing embodiment.
In a possible implementation, the communication unit is configured to receive a change operation of a user equipment on metadata of a database model;
the processing unit is configured to generate a database schema definition language (DDL) statement according to the change operation, where the DDL statement includes a DDL statement corresponding to a condition audit and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition audit is used to determine whether the database model satisfies a condition for executing the change operation.
In yet another possible implementation manner, the processing unit is further configured to execute the DDL statement to alter metadata of the database model.
In another possible implementation, the processing unit is further configured to:
executing the DDL statement corresponding to the condition audit to determine whether the database model meets the condition for executing the change operation;
and under the condition that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model.
In yet another possible implementation manner, the communication unit is further configured to provide the DDL statement to the user equipment.
In yet another possible embodiment, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible embodiment, the change operation includes deleting the first metadata in the database model; satisfying a condition to perform the change operation when the first metadata exists in the database model.
In yet another possible embodiment, the change operation comprises adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
In yet another possible embodiment, the altering operation includes modifying the content of a third element in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
In another possible implementation, the processing unit is further configured to:
executing the DDL statement through a storage process to alter metadata of the database model.
In another possible implementation, the processing unit is further configured to:
creating a storage process; the content of the storage process is the DDL statement;
executing the stored procedure to alter the metadata of the database model.
In another possible implementation, the processing unit is further configured to:
and generating a DDL file suitable for the database type according to the change operation.
It should be understood that the related description may also refer to the description in the embodiment shown in fig. 3 or fig. 7, and the description is not repeated here.
In still another possible design, the change processing device 70 may be the user equipment in the foregoing embodiment.
In a possible implementation manner, the communication unit 701 is configured to receive a change operation of a user on metadata of a database model;
the communication unit 701 is configured to send the change operation on the metadata of the database model to a server; the change operation is used for generating DDL statements, the DDL statements comprise DDL statements corresponding to condition audit and DDL statements corresponding to the change operation, and the DDL statements corresponding to the condition audit are used for determining whether the database model meets the condition for executing the change operation.
In one possible embodiment, the method is applied to a database design system.
In a possible implementation manner, the communication unit 701 is configured to receive the DDL statement sent by the server.
In a possible implementation manner, the communication unit 701 is further configured to receive a database model design interface provided by the server;
and the processing unit 702 is used for presenting the database model design interface.
In a possible embodiment, the communication unit 701 is further configured to receive a change operation on the metadata of the database model, which is input by a user on the database model design interface.
In yet another possible embodiment, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible embodiment, the change operation includes deleting the first metadata in the database model; satisfying a condition to perform the change operation when the first metadata exists in the database model.
In yet another possible embodiment, the change operation comprises adding second metadata in the database model; the condition to perform the change operation is satisfied when the first metadata is not present in the database model.
In yet another possible embodiment, the change operation includes modifying the contents of a third element of data in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
It should be understood that the related description can also refer to the description in the embodiment shown in fig. 2, and the description is not repeated here.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a computing device 80 according to an embodiment of the present disclosure, where the computing device 80 may be a stand-alone device (for example, one or more of a server, or a user device, and the like) or may be a component (for example, a chip, a software module, or a hardware module, and the like) inside the stand-alone device. The computing device 80 may include at least one processor 801. Optionally, at least one memory 803 may also be included. Further optionally, computing device 80 may also include a communications interface 802. Still further optionally, a bus 804 may be included, wherein the processor 801, the communication interface 802, and the memory 803 are coupled via the bus 804.
The processor 801 is a module for performing arithmetic operation and/or logical operation, and may specifically be one or a combination of multiple processing modules, such as a Central Processing Unit (CPU), a picture processing Unit (GPU), a Microprocessor (MPU), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a Complex Programmable Logic Device (CPLD), a coprocessor (assisting the central processing Unit to perform corresponding processing and Application), and a Micro Control Unit (MCU).
The communication interface 802 may be used to provide information input or output to the at least one processor. And/or, the communication interface 802 may be used to receive and/or transmit data externally, and may be a wired link interface such as an ethernet cable, and may also be a wireless link (Wi-Fi, bluetooth, general wireless transmission, vehicle-mounted short-range communication technology, other short-range wireless communication technologies, etc.) interface. Optionally, the communication interface 802 may also include a transmitter (e.g., a radio frequency transmitter, an antenna, etc.) or a receiver, etc. coupled to the interface.
The memory 803 is used to provide a storage space in which data, such as an operating system and computer programs, may be stored. The memory 803 may be one or a combination of Random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or portable read-only memory (CD-ROM), among others.
The at least one processor 801 in the computing device 80 is configured to execute the aforementioned change handling method, such as the change handling method described in the embodiment shown in fig. 2.
Alternatively, the processor 801 may be a processor dedicated to performing the methods (referred to as a special-purpose processor for convenience), or may be a processor that calls a computer program to perform the methods, such as a general-purpose processor. Optionally, at least one processor may also include both special purpose and general purpose processors. Optionally, in case the computing device comprises at least one memory 803, the above mentioned computer program may be stored in the memory 803.
In one possible design, the computing device 80 may be a server in the foregoing embodiments.
In one possible implementation, the at least one processor 801 in the computing device 80 is configured to execute calling computer instructions to:
receiving a change operation of a user device to metadata of a database model (through communication interface 802);
and generating a database mode definition language (DDL) statement according to the change operation, wherein the DDL statement comprises a DDL statement corresponding to condition audit and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition audit is used for determining whether the database model meets the condition for executing the change operation.
In yet another possible implementation, the at least one processor 801 is further configured to:
executing the DDL statement to alter metadata of the database model.
In yet another possible implementation, the at least one processor 801 is further configured to:
executing the DDL statement corresponding to the condition audit to determine whether the database model meets the condition for executing the change operation;
and under the condition that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model.
In yet another possible implementation, the at least one processor 801 is further configured to:
the DDL statement is provided to the user equipment (through communication interface 802).
In yet another possible embodiment, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible embodiment, the change operation includes deleting the first metadata in the database model; the condition for performing the change operation is satisfied when the first metadata is present in the database model.
In yet another possible embodiment, the change operation comprises adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
In yet another possible embodiment, the change operation includes modifying the contents of a third element of data in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
In yet another possible implementation, the at least one processor 801 is further configured to:
executing the DDL statement through a storage process to alter metadata of the database model.
In yet another possible implementation, the at least one processor 801 is further configured to:
creating a storage process; the content of the storage process is the DDL statement;
executing the storage process to alter the metadata of the database model.
In yet another possible implementation, the at least one processor 801 is further configured to:
and generating a DDL file suitable for the database type according to the change operation.
It should be understood that the related description can also refer to the description in the embodiment shown in fig. 2, and the description is not repeated here.
In one possible design, the computing device 80 may be a server in the foregoing embodiments.
In one possible implementation, the at least one processor 801 in the computing device 80 is configured to execute calling computer instructions to:
receiving a user change operation to metadata of a database model (through the communication interface 802);
sending the change operation to the metadata of the database model to a server (through the communication interface 802); the change operation is used for generating DDL statements, the DDL statements comprise DDL statements corresponding to condition audit and DDL statements corresponding to the change operation, and the DDL statements corresponding to the condition audit are used for determining whether the database model meets the condition for executing the change operation.
In one possible embodiment, the method is applied to a database design system.
In one possible implementation, the at least one processor 801 is further configured to:
the DDL statement sent by the server is received (through communication interface 802).
In one possible implementation, the at least one processor 801 is further configured to:
receiving (via communications interface 802) a database model design interface provided by the server;
and presenting the database model design interface.
In one possible implementation, the at least one processor 801 is further configured to:
change operations to the metadata of the database model that are input by a user on the database model design interface are received (via communication interface 802).
In yet another possible embodiment, the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
In yet another possible embodiment, the change operation includes deleting the first metadata in the database model; the condition for performing the change operation is satisfied when the first metadata is present in the database model.
In yet another possible embodiment, the change operation comprises adding second metadata in the database model; the condition to perform the change operation is satisfied when the first metadata is not present in the database model.
In yet another possible embodiment, the altering operation includes modifying the content of a third element in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
It should be understood that the related description can also refer to the description in the embodiment shown in fig. 2, and the description is not repeated here.
The present application also provides a computer-readable storage medium having stored therein instructions that, when executed on at least one processor, implement a change handling method as described above, such as the change handling method shown in fig. 2.
The present application also provides a computer program product comprising computer instructions that, when executed by a computing device, implement the foregoing change processing method, such as the change processing method shown in fig. 2.
In the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "such as" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the present application, the term "at least one" means one or more, and the term "a plurality" means two or more. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a. b, c, (a and b), (a and c), (b and c), or (a and b and c), wherein a, b and c can be single or multiple. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B, which may indicate: the three cases of separately existing A, simultaneously existing A and B and separately existing B, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
And unless stated to the contrary, the ordinal numbers such as "first", "second", etc. are used in the embodiments of the present application to distinguish a plurality of objects and are not used to limit the sequence, timing, priority, or importance of the plurality of objects. For example, the first user equipment and the second user equipment are only for convenience of description, and do not indicate the difference in structure, importance degree, and the like of the first user equipment and the second user equipment, and in some embodiments, the first user equipment and the second user equipment may also be the same equipment.
As used in the above embodiments, the term "when 8230; \8230when" may be interpreted to mean "if 8230; \8230;" or "at 8230; \8230, after" or "in response to determining 8230; \8230;" or "in response to detecting 8230; \8230;" may be interpreted depending on the context. The above description is intended only to illustrate the alternative embodiments of the present application, and not to limit the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.

Claims (32)

1. A change processing method, comprising:
receiving change operation of user equipment on metadata of a database model;
and generating a DDL statement of a database mode definition language according to the change operation, wherein the DDL statement comprises a DDL statement corresponding to condition audit and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition audit is used for determining whether the database model meets the condition for executing the change operation.
2. The method according to claim 1, characterized in that it comprises:
executing the DDL statement to alter metadata of the database model.
3. The method of claim 2, wherein the executing the DDL statement to alter the metadata of the database model comprises:
executing the DDL statement corresponding to the condition audit to determine whether the database model meets the condition for executing the change operation;
and under the condition that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model.
4. A method according to any of claims 1-3, characterized in that the method comprises:
providing the DDL statement to the user equipment.
5. The method according to any of claims 1-4, wherein the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
6. The method of any of claims 1-5, wherein the change operation comprises deleting the first metadata in the database model; the condition for performing the change operation is satisfied when the first metadata is present in the database model.
7. The method of any of claims 1-6, wherein the change operation comprises adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
8. The method of any of claims 1-7, wherein the change operation comprises modifying the contents of a third element of data in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
9. The method according to any of claims 1-8, wherein said executing the DDL statement to alter metadata of the database model comprises:
executing the DDL statement through a storage process to alter metadata of the database model.
10. The method according to any of claims 1-8, wherein the generating a database schema definition language (DDL) statement according to the change information comprises:
and generating a DDL file suitable for the database type according to the change operation.
11. A system comprising a server and a user device, wherein:
the user equipment is used for sending the change operation of the user equipment on the metadata of the database model to a server;
the server is used for receiving the change operation of the user equipment on the metadata of the database model;
the server is further configured to generate a database schema definition language (DDL) statement according to the change information, where the DDL statement includes a DDL statement corresponding to condition review and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition review is used to determine whether the database model meets a condition for executing the change operation.
12. The system according to claim 11, wherein said server is further configured to execute said DDL statement to alter metadata of said database model.
13. The system of claim 12, wherein the server is further configured to:
executing the corresponding DDL statement of the condition audit to determine whether the database model meets the condition of executing the change operation;
and under the condition that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model.
14. The system according to any of claims 11-13, wherein said server is further configured to provide said DDL statement to said user equipment.
15. The system according to any of claims 11-14, wherein the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
16. The system of any of claims 11-15, wherein the change operation comprises deleting the first metadata in the database model; satisfying a condition to perform the change operation when the first metadata exists in the database model.
17. The system according to any of claims 11-16, wherein the change operation comprises adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
18. The system according to any of claims 11-17, wherein the change operation comprises modifying the content of a third element of data in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
19. The system according to any of claims 11-18, wherein the server is further configured to execute the DDL statement through a stored procedure to alter metadata of the database model.
20. The system according to any of claims 11-18, wherein said server is further configured to generate a DDL file applicable to said database type according to said change operation.
21. A change processing device is characterized by comprising:
the communication unit is used for receiving the change operation of the user equipment on the metadata of the database model;
and the processing unit is used for generating a database mode definition language (DDL) statement according to the change operation, wherein the DDL statement comprises a DDL statement corresponding to condition audit and a DDL statement corresponding to the change operation, and the DDL statement corresponding to the condition audit is used for determining whether the database model meets the condition for executing the change operation.
22. The apparatus of claim 21, wherein the processing unit is further configured to execute the DDL statement to alter metadata of the database model.
23. The apparatus of claim 22, wherein the processing unit is further configured to:
executing the corresponding DDL statement of the condition audit to determine whether the database model meets the condition of executing the change operation;
and under the condition that the database model meets the condition of executing the change operation, executing a DDL statement corresponding to the change operation to change the metadata of the database model.
24. The apparatus according to any of claims 21-23, wherein the communication unit is further configured to provide the DDL statement to the user equipment.
25. The apparatus according to any of claims 21-24, wherein the metadata of the database model comprises at least one of: libraries, tables, indices, fields, entities, attributes, foreign keys, triggers, views, stored procedures, functions, sequences.
26. The apparatus of any of claims 21-25, wherein the change operation comprises deleting the first metadata in the database model; the condition for performing the change operation is satisfied when the first metadata is present in the database model.
27. The apparatus of any of claims 21-26, wherein the change operation comprises adding second metadata in the database model; satisfying a condition to perform the change operation when the first metadata is not present in the database model.
28. The apparatus of any of claims 21-27, wherein the change operation comprises modifying the content of a third element of data in the database model; satisfying an execution condition for executing the change operation when the third metadata exists in the database model.
29. The apparatus according to any of claims 21-28, wherein the processing unit is further configured to:
executing the DDL statement through a storage process to alter metadata of the database model.
30. The apparatus according to any of claims 21-28, wherein said processing unit is further configured to:
and generating a DDL file suitable for the database type according to the change operation.
31. A computing device, wherein the computing device comprises a processor and a communication interface;
the communication interface is used for receiving and/or sending data, and/or the communication interface is used for providing input and/or output for the processor;
the processor is configured to implement the method of any one of claims 1 to 10.
32. A computer-readable storage medium having stored therein instructions which, when executed on at least one processor, carry out the method of any one of claims 1 to 10.
CN202110802362.2A 2021-07-15 2021-07-15 Change processing method and device and related equipment Pending CN115617772A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110802362.2A CN115617772A (en) 2021-07-15 2021-07-15 Change processing method and device and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110802362.2A CN115617772A (en) 2021-07-15 2021-07-15 Change processing method and device and related equipment

Publications (1)

Publication Number Publication Date
CN115617772A true CN115617772A (en) 2023-01-17

Family

ID=84855416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110802362.2A Pending CN115617772A (en) 2021-07-15 2021-07-15 Change processing method and device and related equipment

Country Status (1)

Country Link
CN (1) CN115617772A (en)

Similar Documents

Publication Publication Date Title
CN109840429B (en) Intelligent contract deployment and calling method and device
KR101989802B1 (en) Method for performing test using test case and apparatus for the same
US11360976B2 (en) Deployment of javascript and typescript stored procedures and user-defined functions into database management systems
US7689582B2 (en) Data flow system and method for heterogeneous data integration environments
US7739267B2 (en) Classification and sequencing of mixed data flows
CN104965735A (en) Apparatus for generating upgrade SQL script
CN104424018A (en) Distributed calculating transaction processing method and device
WO2023051125A1 (en) Structured data version management method, apparatus, and related device
CN112650526B (en) Method, device, electronic equipment and medium for detecting version consistency
CN110795331A (en) Software testing method and device
US11900269B2 (en) Method and apparatus for managing knowledge base, device and medium
CN111914537A (en) Data verification method, device and equipment and readable storage medium
CN115617772A (en) Change processing method and device and related equipment
CN113806327A (en) Database design method and device and related equipment
CN109857390B (en) Annotation transmission method of Git warehouse file annotation system
CN112667657A (en) System, method and device for realizing data desensitization based on computer software, processor and storage medium thereof
US10310959B2 (en) Pre-deployment validation system using intelligent databases
WO2023279752A1 (en) Version management method and apparatus for database model, and related device
CN115563183B (en) Query method, query device and program product
US20220171785A1 (en) Systems and methods of automating data processing and movement
WO2023273410A1 (en) Specification design method and apparatus, and related device
CN117573199B (en) Model difference comparison analysis method, device, equipment and medium
CN117573730B (en) Data processing method, apparatus, device, readable storage medium, and program product
CN117008890B (en) Extended application development system and method
CN113986305B (en) B/S model upgrade detection method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication