CN113806327A - Database design method and device and related equipment - Google Patents

Database design method and device and related equipment Download PDF

Info

Publication number
CN113806327A
CN113806327A CN202011043839.5A CN202011043839A CN113806327A CN 113806327 A CN113806327 A CN 113806327A CN 202011043839 A CN202011043839 A CN 202011043839A CN 113806327 A CN113806327 A CN 113806327A
Authority
CN
China
Prior art keywords
branch
database
version
user
request
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
CN202011043839.5A
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 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 Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN113806327A publication Critical patent/CN113806327A/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
    • 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/219Managing data history or versioning
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Abstract

The embodiment of the application provides a database design method, which is applied to a database design system and comprises the following steps: the database design system provides a first interface for a user, so that the user inputs source information and target information on the first interface; receiving a branch operation request set by a user through a first interface, wherein the branch operation request comprises source information and target information input by the user, and the branch operation request is any one of branch synchronization or branch duplication; and executing the operation specified by the branch operation request according to the source information and the target information in the branch operation request. By implementing the embodiment of the application, the database design system can provide synchronous operation between different branches in the same database model and repeated engraving operation of the database between different database models, so that the operation and management modes of a user on the database are increased, and the working efficiency and the user experience can be improved.

Description

Database design method and device and related equipment
Technical Field
The present application relates to the field of database design, and in particular, to a method and an apparatus for designing a database, and a related device.
Background
During the project development process, a user may design a database through a database design system. When a user designs a database through a database design system, one or more branches are created according to project requirements. For example, "development branches" for user project development, and "backbone branches" for project product release, each branch including a different version of the design-state database. The operations provided by current database design systems for different branches include creating new branches, deleting used branches, and merging operations between different branches. At present, the operation modes among different database branches are few, and the requirements in project development cannot be met.
Disclosure of Invention
The embodiment of the application discloses a database design method, a device and related equipment, which can provide branch synchronization and branch repeated engraving operation for a database, increase the operation and management mode of a user for the database and improve the user experience.
In a first aspect, the present application provides a database design method applied to a database design system, the database design system including at least one database model of a design state, each database model including at least one branch, each branch including at least one database version, the database design method including: the database design system provides a first interface for a user, so that the user can set a branch operation request on the first interface, wherein the branch operation request is any one of a branch synchronous request or a branch repeated etching request, and the branch operation request comprises source information and target information; and receiving a branch operation request set by a user through a first interface, and executing the operation specified by the branch operation request by the database design system according to the source information and the target information in the branch operation request.
The database design system increases the operation and management modes of the database by the user by providing synchronous operation between different branches in the same database model and repeated engraving operation of the database between different database models, and improves the working efficiency and user experience of the user.
In a specific implementation manner, the branch synchronization request is used for representing that any one database version in a first branch in a database model is used for covering a database version in a second branch in the same database model; wherein the first branch is any one branch in the database model, and the second branch is a branch different from the first branch; the branch replication request is used for representing that a third branch in the first database model is replicated into the second database model to form a fourth branch in the second database model, wherein the first database model and the second database model are two different database models.
By the branch synchronization method between different branches in the same database model, the problem of merging conflict when different branches in the same database are merged can be solved, and a user can select any one database version in a first branch to be synchronized into a second branch, so that data represented by the other branch is the same as data represented by the database version selected by the user. The branch duplication method provides a cross-model branch operation method, and can copy the data of a third branch in one database model into another database model to form a fourth branch, so that after the fourth branch has the same data as the third branch, a user can perform new development work in the fourth branch without influencing the third branch, and the modification operation of the third branch by the user does not influence the fourth branch.
In a specific implementation manner, when the branch operation request is a branch synchronization request, the source information includes a name of the first branch and a version number of a database version used for branch synchronization in the first branch; the target information includes a name of the second branch.
In a specific implementation manner, when the branch operation request is a branch duplication request, the source information includes a name of the first database model and a name of a third branch; the target information includes a name of the second database model.
In a specific implementation manner, the database design system executes the operation specified by the branch operation request according to the source information and the target information in the branch operation request, and the method includes: when the branch operation request is a branch synchronization request, the database design system determines difference information between data represented by a first database version and data represented by a second branch, wherein the first database version is the database version indicated by the version number of the database version in the source information; and the database design system acquires part or all of the difference information selected by the user as target difference information and stores the target difference information to the second branch. Specifically, the database design system may delete the database version that is not checked in the second branch, create a new database version in the second branch, and store the target difference information in the newly created database version in the second branch; alternatively, the database design system directly replaces the data in the unviewed version of the database in the second branch with the target difference information.
And the database design system can obtain the full data represented by the second branch according to the difference information and the data in other branches in the second branch, and ensure that the data represented by the latest database version of the second branch is the same as the data represented by the first database version in the first branch.
In a specific implementation manner, the database design system executes the operation specified by the branch operation request according to the source information and the target information in the branch operation request, and the method includes: when the branch operation request is a branch repeated-carving request, the database design system obtains the full data of the third branch from the first database model according to the name of the first database model and the name of the third branch; and copying the total data of the third branch into the second database model to form a fourth branch in the second database model, wherein the third branch is any one branch in the first database model, and the fourth branch is a branch newly created in the second database model when the database design system executes branch copy operation.
In a specific implementation manner, the database design system operates on a cloud platform, and a user purchases a cloud service of the database design system on the cloud platform. The database design cloud service is provided for the user in a cloud service mode, the flexibility of database design and use is improved, and the user experience can be improved.
In a second aspect, an embodiment of the present application provides a database design apparatus, which is applied to a database design system, where the database design system includes at least one database model in a design state, each database model includes at least one branch, and each branch includes at least one database version, the apparatus includes:
the display module is used for providing a first interface for a user, the first interface is used for the user to set source information and target information, wherein the branch operation request is any one of a branch synchronous request or a branch repeated etching request, and the branch operation request comprises the source information and the target information;
a receiving module, configured to receive a branch operation request set by a user through the first interface;
and the processing module is used for executing the operation specified by the branch operation request according to the source information and the target information in the branch operation request.
In a specific implementation manner, the branch synchronization request is used for representing that any one database version in a first branch in a database model is used for covering a database version in a second branch in the same database model; wherein the first branch is any one branch in the database model, and the second branch is a branch different from the first branch; the branch replication request is used for representing that a third branch in the first database model is replicated into the second database model to form a fourth branch in the second database model, wherein the first database model and the second database model are two different database models.
In a specific implementation manner, when the branch operation request is a branch synchronization request, the source information includes a name of the first branch and a version number of a database version used for branch synchronization in the first branch; the target information includes a name of the second branch.
In a specific implementation manner, when the branch operation request is a branch duplication request, the source information includes a name of the first database model and a name of a third branch; the target information includes a name of the second database model.
In a specific implementation manner, when the processing module executes an operation specified by the branch operation request according to the source information and the target information in the branch operation request, the processing module is specifically configured to: when the branch operation request is a branch synchronization request, acquiring difference information between data represented by a first database version and data represented by a second branch, wherein the first database version is the database version indicated by the version number of the database version; and acquiring target difference information, and storing the target difference information to a second branch, wherein the target difference information is part or all of the difference information selected by the user.
In a specific implementation manner, when the processing module executes an operation specified by the branch operation request according to the source information and the target information in the branch operation request, the processing module is specifically configured to: when the branch operation request is a branch repeated-carving request, acquiring the full data of a third branch from the first database model according to the name of the first database model and the name of the third branch; and copying the full data of the third branch into the second database model to form a fourth branch in the second database model.
In a specific implementation manner, the database design system operates on a cloud platform, and a user purchases a cloud service of the database design system on the cloud platform.
In a third aspect, embodiments of the present application provide a computing device comprising a processor and a memory; the memory has a computer program stored therein; when the processor executes the computer program, the computing device performs the method of the first aspect or any of the specific implementation manners of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where instructions are stored, and when the instructions are executed on a network device, the method in the first aspect or any specific implementation manner of the first aspect is performed.
In a fifth aspect, the present application provides a computer program product comprising computer instructions that, when executed by a computing device, cause the computing device to perform the method of the first aspect or any of the specific implementations of the first aspect. 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 of the first aspect or any of the specific implementations of the first aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1A is a schematic deployment diagram of a local database design system according to an embodiment of the present disclosure;
fig. 1B is a deployment diagram of a cloud database design system provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a database design method according to an embodiment of the present disclosure;
FIG. 3 is a schematic view of a first interface provided by an embodiment of the present application;
FIG. 4A is a schematic view of another first interface provided by an embodiment of the present application;
FIG. 4B is a schematic view of a second interface provided by an embodiment of the present application;
FIG. 4C is a schematic view of a third interface provided by embodiments of the present application;
FIG. 5 is a schematic view of another first interface provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a database design apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computing device according to an embodiment of the present application.
Detailed Description
The technical solution in the present application will be described below with reference to the accompanying drawings.
A Database (DB) is a repository that organizes, stores, and manages data according to a data structure, and is an organized, sharable collection of large amounts of data stored in a computer.
The database design system is a visual database design and management tool, which is used for building, using and maintaining the database. A user can create database elements such as a design view, a storage process, a function, a sequence, an index, a foreign key, a trigger and the like comprising tables and incidence relations among the tables in a database design system, and the database design system can generate a script of the database according to design. The server generates a database by running the script. When a user needs to modify data in the database, the user can modify the design data in the database design system. After the user has completed modifying the design data, the database design system may generate a new script based on the modified design data.
The database design system has the functions of branch management and version management, the branch creation is the most common database management means in the database design system, several items of work in project development can be isolated from each other by creating different branches, and data in a plurality of branches are integrated by branch combination when versions need to be released. When a user designs a database through a database design system, one or more branches may be created in one database model, for example, a "development branch" for user project development, a "backbone branch" for project product release, and the like. Each branch comprises one or more database versions, wherein the database version refers to a design state database, and the design state database refers to a database stored in the database design system during the process of project development of a user through the database design system.
It should be noted that in one branch of the database design system, the other database versions except the first database version are stored with differences. I.e. the data stored in a database version is the difference information obtained by comparing the database version with a database version preceding it. For example, three database versions of a1, a2, and A3 are included in one branch, and the creation order is a1, a2, and A3. If the character x is in A1, the data represented by A1 is x; in a2, the user added the character yz after the character x, and in a2, the saved data is not xyz, but two change operations: "add y" and "add z", but the data represented by a2 is xyz; in A3, when the user deleted the character z, the change operation "delete z" in A3 is performed instead of the stored data being xy, but the data indicated by A3 is xy. Since the branch has only these three database versions, the data represented by a3 is the data represented by the branch. It should be understood that the data and operation processes in the database version are only used for illustrating the difference storage manner, and cannot be understood as the data actually stored in the database and the actual operation on the database.
Branch merging refers to merging modifications to a database in one version into another version in different branches of the same database, where the different versions of the same database may be in the same branch or in different branches. For example, if a first branch is merged into a second branch, the database design system may detect the first branch and the second branch, determine that the first branch and the second branch have all operations of adding, deleting and modifying the first branch with respect to the merge point or the creation point since the last merge point or the first creation point of the branch, and all operations of adding, deleting and modifying the second branch with respect to the merge point or the first creation point of the branch, and then perform a change to the database by the first branch into the second branch, i.e., repeat the change to the database model by the first branch in the second branch since the last merge point or the first creation point of the branch. For example, after the point was first created from the last merge point or branch, the second branch includes table 1, but the first branch made the operation to delete table 1, then when the first branch was merged into the second branch, table 1 was deleted in the latest version of the second branch, and the first branch did not make any changes.
It should be noted that a merge conflict occurs when branches merge, for example, two branches modify the same object differently. When branch merging is carried out, a database design system can carry out conflict detection, then merging conflicts are processed according to a preset conflict processing strategy or conflict early warning is carried out, and a user decides certain conflicts which cannot be automatically processed. For example, according to the modification time, the data with the later modification time is taken as the data after the branch combination; or early warning is carried out when the merging conflict occurs, and a user is informed to solve the merging conflict.
The database design system in the embodiment of the present application is an application program for providing a database development environment. The database design system includes at least one component, which refers to a simple encapsulation of data and methods. In some programming language architectures, components may also be referred to as parts, controls, and the like. Based on the role of the components, the components included in the database design system can be divided into two types, front-end components and back-end components.
The front-end component refers to a component that implements interaction with a user, such as a client, specifically for receiving data input by the user, displaying an interface and data requested by the user, and so on. The back-end component refers to a component for processing data, and is specifically configured to process received data according to a set logic, or obtain data from a database for processing, and the like. In an embodiment of the present application, the database design system may include at least one of a graphical user interface, an integrated code editor, a compiler, a debugger, and the like. The database design system front-end component can include components related to graphical user interfaces, and the database design system back-end component can include components related to compilers, debuggers, and the like.
Based on different deployment modes, the database design system can be divided into a local database design system and a cloud database design system. Both the front-end component and the back-end component of the local database design system are deployed locally. Local is also referred to as local device. The local devices include user devices (e.g., terminals such as laptop computers) under the direct control of the user, or devices in geographic proximity to the user devices (e.g., local computer clusters). The cloud database design system has at least a portion of the components (e.g., backend components) deployed in the cloud. The cloud in the embodiment of the application is one end corresponding to the local, namely a resource end remotely accessed by a local user through a network.
As shown in fig. 1A, fig. 1A is a schematic deployment diagram of a local database design system according to an embodiment of the present application. The front-end components described above may operate on a variety of end devices, such as: a cell phone, a notebook computer, a tablet computer, or a personal desktop computer, etc. The back-end component can run on a cluster of computers (including at least one computing device).
As shown in fig. 1B, fig. 1B is a deployment schematic diagram of a cloud database design system provided in an embodiment of the present application. The database design system is deployed in a cloud platform. A large amount of basic resources provided by a cloud service provider are deployed in the cloud platform. For example, the cloud platform 1 has computing resources, storage resources, network resources, and the like deployed therein, and the computing resources may be a large number of computing devices (e.g., servers). The database design system can utilize basic resources deployed in the cloud platform to realize the database design method provided by the embodiment of the application.
It should be understood that the database design system may be a hardware system or a software system deployed on a hardware device and/or a virtual machine, and the database design system may also be implemented by a combination of hardware and software. When the database design system is a hardware system, it may be a collection of computing devices. When the database design system is a software system, the database design system may be independently deployed on a server or a virtual machine in the cloud platform, or the database design system may be distributively deployed on a plurality of servers in the cloud platform, or the database design system may be distributively deployed on a plurality of virtual machines in the cloud platform, or the database design system may be distributively deployed on a server and a virtual machine in the cloud platform.
As shown in fig. 1B, the database design system can be provided to users by cloud services abstracted as a database design by a cloud service provider on a cloud platform. After a user purchases a database design cloud service on a cloud platform, the cloud platform can provide the database design cloud service for the user by using a database design system deployed on the cloud platform. For example, the cloud platform may provide a graphical user interface to a user purchasing the cloud service, which is displayed on the user device of the user, in which the user performs database design. 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. And when the cloud platform is a cloud platform comprising 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.
During the project development process, a user may design a database through a database design system. When a user designs a database through a database design system, one or more branches are created in the same database model according to project requirements. For example, "development branches" for user project development, and "backbone branches" for project product release. Each branch includes a different version of the design state database. Current database design systems provide operations between design-state databases including creating new branches, deleting a used branch or deleting a version of a database in an existing branch, merging operations between design-state databases in different branches, and the like. The operation modes among design state databases of different branches are few at present, and the requirements in project development cannot be met.
In order to solve the above problem, embodiments of the present application provide a database design system and a database design method. As shown in fig. 2, fig. 2 is a schematic flow chart of a database design method provided in an embodiment of the present application, and a database design system can provide synchronization operations between design-state databases in different branches of the same database and re-engraving operations of the design-state databases between different databases, so that an operation and management manner of a user on the databases is increased, and the work efficiency and user experience of the user can be improved.
S201, providing a first interface for a user, and receiving a branch operation request set by the user through the first interface.
In the embodiment of the application, the branch operation requests in the database model are all operation requests for the design state database in the database design system. The branch operations of the database include branch merging, branch synchronization, branch duplication and the like.
The branch synchronization means that any one database version provided by a first branch in the database model is used for replacing one database version in a second branch in the same database model, and the data represented by the second branch is the same as the data represented by one database version in the first branch. Wherein the first branch and the second branch are two different branches. The branch synchronization may be used for replacing the data represented by the second branch with the data represented by the database version selected by the user in the first branch when the user needs to change the scheme corresponding to the second branch to the scheme corresponding to any one of the database versions in the first branch. For example, if the first branch in the database model includes four database versions of a1, a2, A3 and a4, the second branch includes two database versions of B1 and B2, and B1 and B2 are database versions that cannot be modified any more after auditing is complete, the second branch represents the data. If the user chooses to synchronize A3 in the first branch to the second branch, the database design system creates database version B3 in the second branch and performs a branch synchronization operation, after which the data represented by B3 is the same as the data represented by A3 in the first branch. It should be understood that the data and operation procedures in the database version are only used for illustrating branch synchronization, and cannot be understood as the data actually stored in the database and the actual operation procedures on the database.
Branch replication (fork) refers to copying a third branch in the first database model to a fourth branch in the second database model for developing a new product on the basis of an existing database. The first database model and the second database model are two different database models, the third branch is any one branch in the first database model, and the fourth branch is a branch newly created in the second database model when the branch is executed repeatedly. For example, after a user completes the development of an android version of an application, the development of a saiban system version of the application needs to be performed, at this time, the user can repeatedly engrave a third branch in a first database model corresponding to the android version into a second database model established for the saiban system version development, and create a fourth branch in the second database model to store data of the third branch, so that the data in the fourth branch is identical to the data in the third branch, but the fourth branch and the third branch are not in the same database model, and therefore, the fourth branch and the third branch are not affected by each other, and thus, new products can be developed by using the data of an existing database.
In a specific implementation manner, the branch operation request may be a branch synchronization request, where the branch synchronization request includes source information and target information, the source information includes a name of a first branch and a version number of a database version, and the target information includes a name of a second branch, where the version number of the database version indicates the database version used for branch synchronization in the source branch. When a user needs to perform branch synchronization operation on two database versions in different branches of the same database, the database design system can provide a first interface for the user, and the user selects source information corresponding to a first branch and target information corresponding to a second branch for performing the branch synchronization operation through the first interface.
As shown in fig. 3, fig. 3 is a schematic view of a first interface provided in the embodiment of the present application. The first interface is an interface displayed by the database design system on the user terminal, and is used for the user to select the first branch and the version number of the database version. When the user needs to perform the branch synchronization operation, the user may enter the management interface corresponding to the second branch first, that is, the user selects the database model and the second branch that need to perform the branch synchronization. And then, entering the first interface shown in fig. 3 through the management interface corresponding to the second branch, where fig. 3 shows that the user selects the trunk branch in the database model T as the second branch. The first interface includes names of different branches in the database model and version information of different versions of the database in each branch. The version information comprises a version number, an audit state, a submitter identifier, submission time and the like, and the audit state comprises audit completion and non-audit; the submitter identification indicates the submitter of the corresponding version. The user may select the first branch and the database version for branch synchronization on the first interface, and fig. 3 shows that the user selects the development branch as the first branch, and uses the database version with version number 2 in the development branch as the first database version for branch synchronization, that is, the user selects to synchronize the database version with version number 2 in the development branch into the trunk branch. After the user selects the first branch and the first database version on the first interface, the user terminal detects a trigger operation of the user by triggering (for example, clicking with a mouse) the synchronization control, and in response to the trigger operation, the user terminal sends a branch synchronization request to a computer cluster or a cloud platform where the database design system is located, so that the database design system obtains a branch synchronization operation task set by the user.
It should be understood that the interface shown in fig. 3 is only an example, and other types of interfaces are also possible in practical applications.
For example, as shown in fig. 4A, fig. 4A is a schematic view of another first interface provided in the embodiment of the present application. The first interface includes a second branch selection control that can be triggered (e.g., by mouse clicking) by a user to set target information and a first branch selection control that can be triggered to set source information. After the database design system detects that the user triggers the operation of the second branch selection control, the database design system can display a second interface for setting the target information to the user in response to the operation. As shown in FIG. 4B, the second interface includes the names of the different branches in the database model and version information for different versions of the database in each branch. After selecting the second branch, the user returns to the first interface by triggering the decision control of the second interface. The user can then set the source information by triggering the first branch selection control. After the database design system detects the operation of triggering the source branch selection control by the user, the database design system can show a third interface for setting source information to the user in response to the operation. As shown in FIG. 4C, the third interface includes the names of the different branches in the database model and version information for different versions of the database in each branch. After the user selects the first branch and the first database version, the user returns to the first interface by triggering the determination control of the first branch selection interface. The first interface further comprises a synchronization control, after the user selects the first database version and the second branch, the synchronization control can be triggered (for example, clicked by a mouse), the user terminal detects the operation of triggering the synchronization control by the user, and in response to the operation, the user terminal sends a branch synchronization request to a computer cluster or a cloud platform where the database design system is located, so that the database design system obtains a database branch synchronization operation task set by the user.
As shown in fig. 4B and 4C, the database model includes 5 branches, the branch names being "trunk branch", "development branch", "feature branch 1", "feature branch 2", and "release branch", respectively. The main branch is a second branch, the development branch is a first branch, the main branch comprises 4 design state databases, and the development branch comprises 4 design state databases which are subjected to examination. The user selects the database version with the version number of 4 in the development branch as the first database version to perform branch synchronization. It should be understood that the interfaces shown in fig. 4A to 4C are only one example, and other types of interfaces may be used in practical applications.
In a specific implementation manner, the branch operation request may also be a branch copy request. The branch copy request includes source information and target information. The source information comprises the name of the first database model, the name of the third branch and the like, and the target information comprises the name of the second database model and the like.
As shown in fig. 5, fig. 5 is a schematic view of another first interface provided in the embodiment of the present application. The user can input the source information as well as the destination information in the first interface shown in fig. 5. For example, the user can input the name of the first database model in an input box corresponding to the name of the first database model under the source information or select the name of the first database model through a pull-down menu, input the name of a third branch in a branch (version number) input box, or select the name of the third branch through a pull-down menu; and inputting the name of the second database model in an input box corresponding to the name of the database model under the target information or selecting the name of the second database model through a pull-down menu. As shown in fig. 5, a branch (version number) input box may be further included under the target information of the first interface, and the user may input a name of a fourth branch in the branch (version number) input box. If the user enters a branch name in the input box, the database design system creates a fourth branch named by the branch name in the second database model when executing the branch copy request, and if the user does not enter the branch name in the input box, the database design system creates a fourth branch with a default name in the second database model when executing the branch copy request. The first interface further comprises a determining control and a canceling control, after the user selects the source information and the target information, the branch etching operation can be triggered through the determining control, the user terminal detects the triggering operation of the user, and in response to the operation, the user terminal sends a branch etching request to a computer cluster or a cloud platform where the database design system is located, so that the database design system can obtain a database branch etching operation task set by the user. Optionally, the source information may further include a version number, and the user may select a version of the third branch when selecting the third branch, and copy a database version in the third branch into the second database model.
As shown in fig. 5. The user chooses to copy the open branch in database model V1 into the backbone branch of database model V2. It should be understood that the interface shown in fig. 5 is only an example, and the database design system can provide other forms of interfaces to complete the selection of the source information and the target information in the branch duplication. The embodiments of the present application are not particularly limited.
202. And executing the operation specified by the branch operation request according to the source information and the target information in the branch operation request.
In a specific implementation, when the branch operation request is a branch synchronization request, if the user selects the second branch, the first branch, and the first database version for branch synchronization in the first branch through the interface shown in fig. 3 or the interfaces shown in fig. 4A to 4C. The database design system firstly clears the database version which is not checked and completed in the second branch according to the name of the database model in the branch synchronization request and the name of the second branch, and then compares the data represented by the latest checked and completed second database version in the second branch with the data represented by the first database version in the first branch to obtain difference information. And finally, creating a new database version in the second branch, and storing the difference information into the new database version. For example, in fig. 3, the user selects the database version with the version number of 2 in the development branch as the first database version, the backbone branch includes database versions with 4 versions, and the version numbers are 1, 2, 3, and 4, respectively. The database versions with version numbers 1, 2 and 3 are audited and the database version with version number 4 is an audited version. After the user triggers the synchronization control on the first interface, the database design system deletes the database version with the version number of 4. And then comparing the data represented by the database version with the version number of 3 in the trunk branch with the data represented by the database version with the version number of 2 in the development branch to obtain difference information. And finally, creating a new database version with the version number of 4 in the trunk branch, and storing the difference information into the database version with the version number of 4, so that the total data of the database version with the version number of 4 can be obtained through the difference information and the database versions of other versions in the trunk branch.
For example, if the database version with version number 1 in the development branch indicates the character a, the database version with version number 2 indicates the character string abc, and the database version with version number 2 stores the change operations "add b" and "add c". In the backbone branch, the database version with version number 1 indicates the character a, the database version with version number 2 indicates the character string ax, and the database version with version number 3 indicates the character string axy, the database version with version number 2 stores the change operation "add x", and the database version with version number 3 stores the change operation "add y". After comparing the data represented by the database version with the version number of 2 in the development branch with the data represented by the database version with the version number of 3 in the trunk branch, obtaining the difference information includes the following 4 change operations: if "b" is added, "c" is added, "x" is deleted, and "y" is deleted, the database version with the version number of 4 in the trunk branch stores the difference information, but the data represented by the database version with the version number of 4 in the trunk branch is abc. It should be understood that the data and operation procedures in the database version are only used for illustrating branch synchronization, and cannot be understood as the data actually stored in the database and the actual operation procedures on the database.
Optionally, when the database design system stores the difference information, the database design system may not delete the non-audited version in the second branch, and after determining the difference information, the database design system directly replaces the data stored in the non-audited version in the second branch with the difference information.
It should be understood that after the database design system obtains the difference information, the difference information may be presented to the user, and then the user selects part of or all of the difference information as the target difference information, and then the database design system obtains the target difference information selected by the user, and completes the branch synchronization operation according to the target difference information. The method for the database design system to perform the branch synchronization operation according to the target difference information is the same as the method for performing the branch synchronization operation according to the target difference information, and will not be described in detail herein.
In a specific implementation manner, when the branch operation request is a branch duplication request, the database design system searches a third branch in the first database model specified by the branch duplication request according to source information in the branch duplication request, and duplicates the full data of the third branch into a fourth branch in the second database model. It should be appreciated that if the user has created a fourth branch in the second database model prior to the branch duplication, the database design system directly copies the full amount of data of the third branch into the fourth branch; if the user does not create a fourth branch in the second database model before the branch replication, the database design system first creates a fourth branch in the second database model and then copies the full amount of data of the third branch into the fourth branch.
The database design system provided by the embodiment of the application can provide synchronous operation between different branches in the same database model and repeated carving operation of the branches between different database models, increases the operation and management modes of a user on the database, and can improve the working efficiency and user experience of the user.
The application provides a database design device which can be deployed in a cloud platform. As shown in fig. 6, the database designing apparatus 600 may include:
the display module 610 is configured to provide a first interface for a user to set and submit a branch operation request, where the branch operation includes branch merging, branch synchronization, branch duplication, and the like. The branch merging refers to merging operation between design state databases in different branches in the same database model; branch synchronization is a covering operation, which means that a version of a database provided by a first branch of the same database model covers a version of a database in a second branch; the branch duplication refers to copying a design state database of one version in the first database model into a target branch of the second database model;
a receiving module 620, configured to receive a branch operation request set by a user through the first interface;
the processing module 630 is configured to execute a corresponding branch operation according to the branch operation request.
Optionally, the database design system operates on a cloud platform, and the user purchases a user of the cloud service of the database design system for the cloud platform.
Optionally, the display module 610 is further configured to provide a second interface to the user, and configured to provide the result of the execution of the branch operation request to the user.
The above units may perform data transmission through a communication path, and it should be understood that each module included in the apparatus 600 may be a software module, a hardware module, or a part of the software module and a part of the hardware module.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus and each module described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Since the modules in the database design system provided by the embodiment of the present application can be distributively deployed on multiple computers in the same environment or different environments, the embodiment of the present application also provides a computing device, which may be one computer system including one or more computers 700 in some cases. Illustratively, as shown in FIG. 7, each computer 700 includes a memory 701, a processor 702, a communication interface 703, and a bus 704. The memory 701, the processor 702, and the communication interface 703 are communicatively connected to each other via a bus 704.
The Memory 701 may be a Read Only Memory (ROM), a static Memory device, a dynamic Memory device, or a Random Access Memory (RAM). The memory 701 may store a programWhen the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used for executing the database design method provided by the embodiment of the present application. The memory 701 may also include other software modules, data, and the like required to run a process, such as an operating system. And the operating system may be LINUXTM,UNIXTM,WINDOWSTMAnd the like.
The processor 702 may be implemented as a general-purpose Central Processing Unit (CPU), a microprocessor, an Application Specific Integrated Circuit (ASIC), a Graphics Processing Unit (GPU), or one or more Integrated circuits.
The processor 702 may also be an integrated circuit chip having signal processing capabilities. In implementation, some or all of the functions of the database design system of the present application may be performed by instructions in the form of hardware integrated logic circuits or software in the processor 702. The processor 702 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 701, and the processor 702 reads the information in the memory 701, and completes, in combination with hardware thereof, part of the functions of the database design system according to the embodiment of the present application.
The communication interface 703 enables communication between the computer 700 and other devices or communication networks using transceiver modules, such as, but not limited to, transceivers.
Bus 704 may include a pathway to transfer information between components of computer 700 (e.g., memory 701, processor 702, communication interface 703).
The computers 700 each establish a communication path therebetween via a communication network. Each computer 700 is used for part of the functionality of the database design system. Any of the computers 700 may be a computer in a cloud platform (e.g., a server), or a computer in an edge data center.
The descriptions of the flows corresponding to the above-mentioned figures have respective emphasis, and for parts not described in detail in a certain flow, reference may be made to the related descriptions of other flows.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. A computer program product for providing a database design cloud service comprises one or more computer program instructions which, when loaded and executed on a computer, cause, in whole or in part, the method flows or functions described in accordance with embodiments of the present application, fig. 2.
The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, optical fiber, digital subscriber line, or wireless (e.g., infrared, wireless, microwave, etc.) means.
The present application also provides a computer-readable storage medium, which may be a non-transitory readable storage medium, and when instructions in the computer-readable storage medium are executed by a computer, the computer is configured to perform the database design method provided in the present application. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD).
The present application further provides a computer program product, which includes computer instructions, and when executed by a computing device, the computing device executes the database design method provided in the embodiments 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 above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
In the embodiments of the present application, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The term "one or more" refers to one or more, and the term "plurality" refers to two or more, unless expressly defined otherwise.
The term "and/or" in this application is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The above description is only exemplary of the present application and is not intended to limit the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principles of the present application are intended to be included within the scope of the present application.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, training device, or data center to another website site, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a training device, a data center, etc., that incorporates one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium, or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

Claims (16)

1. A database design method, applied to a database design system including at least one database model of a design state, each database model including at least one branch, each branch including at least one database version, the method comprising:
providing a first interface for a user, wherein the first interface is used for the user to set a branch operation request, the branch operation request is any one of a branch synchronization request and a branch copy request, and the branch operation request comprises source information and target information;
and receiving a branch operation request set by the user through the first interface, and executing the operation specified by the branch operation request according to the source information and the target information in the branch operation request.
2. The method of claim 1, wherein the branch synchronization request is used to represent overwriting of a database version in a second branch in the same database model with a database version in a first branch in the database model; the branch replication request is used for representing that a third branch in the first database model is replicated to a second database model to form a fourth branch in the second database model.
3. The method of claim 2,
when the branch operation request is a branch synchronization request, the source information includes a name of the first branch and a version number of a database version used for branch synchronization in the first branch; the target information includes a name of the second branch.
4. The method of claim 2, wherein when the branch operation request is a branch copy request, the source information comprises a name of the first database model and a name of the third branch; the target information includes a name of the second database model.
5. The method of claim 3, wherein the performing the operation specified by the branch operation request according to the source information and the target information in the branch operation request comprises:
when the branch operation request is a branch synchronization request, acquiring difference information between data represented by a first database version and data represented by a second branch, wherein the first database version is a database version indicated by a version number of the database version;
and acquiring target difference information, and storing the target difference information to the second branch, wherein the target difference information is part or all of the difference information selected by the user.
6. The method of claim 4, wherein the performing the operation specified by the branch operation request according to the source information and the target information in the branch operation request comprises:
when the branch operation request is a branch repeated-carving request, acquiring the full data of the third branch from the first database model according to the name of the first database model and the name of the third branch;
copying the full data of the third branch into the second database model to form the fourth branch in the second database model.
7. The method according to any one of claims 1 to 6, wherein the database design system runs on a cloud platform, and the user is a user who purchases a cloud service of the database design system on the cloud platform.
8. A database design apparatus, applied to a database design system including database models of at least one design state, each database model including at least one branch, each branch including at least one database version, the apparatus comprising:
the display module is used for providing a first interface for a user, wherein the first interface is used for the user to set source information and target information, the branch operation request is any one of a branch synchronization request or a branch repeated etching request, and the branch operation request comprises the source information and the target information;
the receiving module is used for receiving a branch operation request set by the user through the first interface;
and the processing module is used for executing the operation specified by the branch operation request according to the source information and the target information in the branch operation request.
9. The apparatus of claim 8, wherein the branch synchronization request is used to represent a version of the database represented by a first branch in a database model, and to overwrite a version of the database represented by a second branch in the same database model; the branch duplication request is used for copying a third branch in the first database model into the second database model to form a fourth branch in the second database model.
10. The apparatus of claim 9, wherein when the branch operation request is a branch synchronization request, the source information comprises a name of the first branch and a version number of a database version used for branch synchronization in the first branch; the target information includes a name of the second branch.
11. The apparatus of claim 9, wherein when the branch operation request is a branch copy request, the source information comprises a name of the first database model and a name of the third branch; the target information includes a name of the second database model.
12. The apparatus of claim 10, wherein the processing module is specifically configured to:
when the branch operation request is a branch synchronization request, acquiring difference information between data represented by a first database version and data represented by a second branch, wherein the first database version is a database version indicated by a version number of the database version;
and acquiring target difference information, and storing the target difference information to the second branch, wherein the target difference information is part or all of the difference information selected by the user.
13. The apparatus of claim 11, wherein the processing module is specifically configured to:
when the branch operation request is a branch repeated-carving request, acquiring the full data of the third branch in the first database model according to the name of the first database model and the name of the third branch;
copying the full data of the third branch into the second database model to form the fourth branch in the second database model.
14. The apparatus of any one of claims 8 to 13, wherein the database design system operates on a cloud platform, and the user is a user who purchases a cloud service of the database design system on the cloud platform.
15. A computing device comprising a processor and a memory, the memory to store instructions, the processor to execute the instructions, the processor when executing the instructions to perform the method of any of claims 1 to 7.
16. A computer-readable storage medium having stored therein instructions that, when executed on a computing device, perform the method of any of claims 1-7.
CN202011043839.5A 2020-06-16 2020-09-28 Database design method and device and related equipment Pending CN113806327A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010549609 2020-06-16
CN202010549609X 2020-06-16

Publications (1)

Publication Number Publication Date
CN113806327A true CN113806327A (en) 2021-12-17

Family

ID=78892843

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011043839.5A Pending CN113806327A (en) 2020-06-16 2020-09-28 Database design method and device and related equipment

Country Status (1)

Country Link
CN (1) CN113806327A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668466A (en) * 2023-08-02 2023-08-29 北京滴普科技有限公司 Internet-based carbon asset information cloud synchronization method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668466A (en) * 2023-08-02 2023-08-29 北京滴普科技有限公司 Internet-based carbon asset information cloud synchronization method
CN116668466B (en) * 2023-08-02 2023-10-13 北京滴普科技有限公司 Internet-based carbon asset information cloud synchronization method

Similar Documents

Publication Publication Date Title
CN109840429B (en) Intelligent contract deployment and calling method and device
US10481884B2 (en) Systems and methods for dynamically replacing code objects for code pushdown
US11429365B2 (en) Systems and methods for automated retrofitting of customized code objects
WO2021184725A1 (en) User interface test method and apparatus, storage medium, and computer device
US10592312B2 (en) Message oriented middleware with integrated rules engine
US10055302B2 (en) Performing a closure merge operation
CN110858172A (en) Automatic test code generation method and device
US20200097260A1 (en) Software application developer tools platform
CN115878589A (en) Version management method and device of structured data and related equipment
CN113806327A (en) Database design method and device and related equipment
CN110083351B (en) Method and device for generating code
CN112230919A (en) Page templating configuration publishing method, system, storage medium and server
CN117112060A (en) Component library construction method and device, electronic equipment and storage medium
CN112000334A (en) Page development method, device, server and storage medium
CN112947907A (en) Method for creating code branch
CN114936152A (en) Application testing method and device
CN114564854A (en) Operation method and equipment of data node supporting FMEA bidirectional relationship tree
CN113495723A (en) Method and device for calling functional component and storage medium
CN112363700A (en) Cooperative creation method and device of intelligent contract, computer equipment and storage medium
CN113011858A (en) Audit project configuration and execution method and device
CN113821249A (en) Project development configuration method and device, electronic equipment and readable storage medium
CN113761075A (en) Method, device, equipment and computer readable medium for switching databases
CN113032004A (en) Method, apparatus and program product for managing development jobs in a development environment
CN117407049B (en) Application release arrangement method, device, equipment and storage medium
US20240103853A1 (en) Code maintenance system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220211

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Applicant after: Huawei Cloud Computing Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination