Database management method and device, equipment and storage medium

By obtaining the microservice field dictionary table and database information table, generating database structure information and displaying it in a tree directory, the complexity of database management under the microservice architecture is solved, real-time synchronization and centralized management of database information is realized, and management efficiency is improved and accuracy, simplifying version control.

CN119127840APending Publication Date: 2024-12-13GREAT WALL MOTOR CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411160906.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The complex database management under the microservice architecture results in many database design documents and error-prone, frequent updates, and it is difficult to maintain consistency with the actual environment.

Method used

By obtaining the microservice field dictionary table and database information table of the business system, the database structure information is generated and displayed on the database management interface in a tree directory structure, real-time synchronization and centralized management of database information is realized, manual entry errors are reduced, and version support Control and change resume records.

Benefits of technology

Improve the accuracy and efficiency of database management, reduce the risk of errors caused by human factors, simplify version control, promote team collaboration, and ensure that database updates are promptly reflected in the actual environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127840A_ABST
    Figure CN119127840A_ABST
Patent Text Reader

Abstract

The invention provides a database management method and device, equipment and a storage medium, and the method comprises the steps: obtaining a micro-service domain dictionary table and a database information table corresponding to a business system, and storing database information corresponding to a database associated with each micro-service included in the business system in the database information table; generating database structure information according to the micro-service domain dictionary table and the database information table; and displaying the database structure information on a database management interface in a tree directory structure. According to the method and the device, the database structure information can be automatically generated, the workload of manual input and editing is reduced, the error risk caused by human factors is further reduced, centralized management of the databases associated with the micro-services in the business system is realized, and the database management efficiency of the business system under the micro-service architecture is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a database management method, device, equipment and storage medium. Background Art

[0002] As microservice architecture becomes more and more popular, microservices have become a major trend. In the microservice architecture, each microservice is a small functional block focusing on a single function, and several microservices are combined into a complex large system. In the microservice architecture, each microservice is deployed independently, which makes the microservice architecture have advantages such as loose coupling and technical diversity, but it also brings some challenges to database management under the microservice architecture.

[0003] At present, each microservice usually has one or more databases associated with it, and each database has its own database design requirements, so a large number of database design documents are generated. Secondly, as the project progresses, the database design documents may change, and there are multiple database versions. And when the project requirements change, the database design needs to be updated frequently, which requires developers to update the database design documents in a timely manner and ensure that the updates can be accurately reflected in the actual database environment to avoid problems caused by inconsistencies between the documents and the actual environment. Therefore, a complete version control system is needed to track these changes. Summary of the invention

[0004] The embodiments of the present application provide a database management method, apparatus, device and storage medium to solve the problem of database management difficulties in a microservice architecture.

[0005] In a first aspect, an embodiment of the present application provides a database management method, the method comprising:

[0006] Obtain a microservice domain dictionary table and a database information table corresponding to the business system, wherein the database information table stores database information corresponding to the database associated with each microservice included in the business system;

[0007] Generate database structure information corresponding to the business system according to the microservice domain dictionary table and the database information table;

[0008] The database structure information is displayed in a tree directory structure on the database management interface corresponding to the business system.

[0009] In a second aspect, an embodiment of the present application further provides a database management device, the device comprising:

[0010] A first acquisition module is used to acquire a microservice domain dictionary table and a database information table corresponding to the business system, wherein the database information table stores database information corresponding to a database associated with each microservice included in the business system;

[0011] A generation module, used to generate database structure information corresponding to the business system according to the microservice domain dictionary table and the database information table;

[0012] The first display module is used to display the database structure information in a tree directory structure on the database management interface corresponding to the business system.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the above-mentioned database management method when executed by the processor.

[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned database management method is implemented.

[0015] The embodiments of the present application include at least the following technical effects:

[0016] The technical solution of the embodiment of the present application, the embodiment of the present application, by obtaining the microservice domain dictionary table and database information table corresponding to the business system, can ensure the real-time and accuracy of the database information in the database management system, and realize the synchronization of the database information in the database management system and the database information in the business system. According to the microservice domain dictionary table and the database information table, the database structure information is automatically generated, which can reduce the workload of manual entry and editing, thereby reducing the risk of errors caused by human factors. By displaying the database structure information in a tree directory structure that is easy to manage and search on the database management interface, centralized management of the databases associated with each microservice in the business system is realized, thereby improving the database management efficiency of the business system under the microservice architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0018] Figure 1 It is a flowchart of the database management method provided in the embodiment of the present application;

[0019] Figure 2 It is a structural diagram of a database management device provided in an embodiment of the present application;

[0020] Figure 3 A block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0023] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0024] In the existing technology, as the microservice architecture becomes more and more popular, microservices have become a major trend. Each microservice in the microservice architecture is deployed independently, which makes the microservice architecture have the advantages of loose coupling and technical diversity, but it also brings some challenges to database management under the microservice architecture. First, since each database has its own database design requirements, a large number of database design documents will be generated. Secondly, as the project progresses, the database design documents may change, and there are multiple database versions.

[0025] In view of this, the present application provides a database management method, apparatus, device and storage medium. The method can ensure the real-time and accuracy of database information in the database management system by obtaining the microservice domain dictionary table and database information table corresponding to the business system, and realize the synchronization of database information in the database management system and database information in the business system. According to the microservice domain dictionary table and the database information table, the database structure information is automatically generated, which can reduce the workload of manual entry and editing, thereby reducing the risk of errors caused by human factors. By displaying the database structure information on the database management interface in a tree directory structure that is easy to manage and search, centralized management of databases associated with each microservice in the business system is realized, thereby improving the database management efficiency of the business system under the microservice architecture.

[0026] like Figure 1 As shown, an embodiment of the present application provides a database management method, the method comprising:

[0027] Step 101: Obtain a microservice domain dictionary table and a database information table corresponding to the business system, wherein the database information table stores database information corresponding to a database associated with each microservice included in the business system.

[0028] The database management method provided in the embodiment of the present application is applied to a database management system, which is used to manage the database included in the business system. The business system in the present application adopts a microservice architecture, corresponding to multiple microservices, each microservice corresponds to at least one database, and each database has its own database design requirements, so the business system under the microservice architecture will have a large number of database design documents. The business system here can be an Internet of Vehicles system, an e-commerce system, a logistics system, an Internet of Things system, a social network system, etc. For different business systems, the corresponding microservice field dictionary table and database information table are different.

[0029] The database management system can regularly obtain the microservice domain dictionary table and database information table of the business system from the configuration center of the business system. The microservice domain dictionary table stores the domain information to which each microservice included in the business system belongs, and the domain information at least includes the microservice name, domain number, domain name, and parent domain number. The database information table stores the database information corresponding to the database associated with each microservice included in the business system, and the database information at least includes the microservice name, database name, database address, user name, password, database type, and update time.

[0030] Step 102: Generate database structure information corresponding to the business system according to the microservice domain dictionary table and the database information table.

[0031] After obtaining the microservice domain dictionary table and the database information table, the database management system can generate database structure information corresponding to the business system according to the microservice dictionary table and the database information table. The database structure information at least includes a database name, a microservice name, and a domain name.

[0032] Step 103: Display the database structure information in a tree directory structure on a database management interface corresponding to the business system.

[0033] Specifically, the database management system provides a database management interface. After obtaining the database structure information, the database structure information is displayed on the database management interface in a tree directory structure.

[0034] In the embodiment of the present application, by obtaining the microservice domain dictionary table and database information table corresponding to the business system, the real-time and accuracy of the database information in the database management system can be ensured, and the synchronization of the database information in the database management system and the database information in the business system can be achieved. According to the microservice domain dictionary table and the database information table, the database structure information is automatically generated, which can reduce the workload of manual entry and editing, and thus reduce the risk of errors caused by human factors. By displaying the database structure information in a tree directory structure that is easy to manage and search on the database management interface, centralized management of the databases associated with each microservice in the business system is achieved, thereby improving the database management efficiency of the business system under the microservice architecture.

[0035] As project requirements change and business develops, the database design corresponding to each microservice in the business system needs to be updated frequently, which requires the developers of the business system to be able to keep abreast of the latest database design changes and update the corresponding documents to ensure that the database updates can be reflected in the actual database environment and avoid problems caused by inconsistencies between the documents and the actual environment. In an optional embodiment of the present application, after obtaining the microservice domain dictionary table and database information table corresponding to the business system, the method also includes:

[0036] Obtaining historical database information corresponding to each database included in the business system;

[0037] For each database, compare the database information corresponding to the database with the historical database information corresponding to the database to obtain database change information;

[0038] The database change information is stored in a change history table corresponding to the database.

[0039] In the embodiment of the present application, after obtaining the data information of the database associated with each microservice, the database management system will compare the database information of each database with the historical database information to obtain the database change information, where the historical database information is the database information stored in the database management system. The database change information includes at least the database name, data table name, change date, change item, change type, change person and change description, and the change type can be modification, deletion or addition.

[0040] In the specific implementation process, the database management system stores at least one version of database information corresponding to each database included in the business system. Acquiring the historical database information corresponding to the data here means acquiring the database information with the latest version number among the at least one version of database information corresponding to the database. For example, the database management system stores three versions of database information of database A, with version numbers A1, A2 and A3, respectively, where the database information with version number A3 is the latest database information. After obtaining the database information table corresponding to the business system, the version number of the database information corresponding to database A in the database information table is set to A4 by default, and the database information with version number A3 (i.e., historical database information) is compared with the database information with version number A4.

[0041] Among them, when the database information with version number A4 has no change compared with the database information with version number A3, only the database information with version number A3 is retained. At this time, the database management system still stores three versions of database information of database A, and the version numbers are A1, A2 and A3. When the database information with version number A4 has a change compared with the database information with version number A3, the database change information including the change content is obtained. At this time, the database management system stores four versions of database information of database A, and the version numbers are A1, A2, A3 and A4.

[0042] Specifically, after obtaining the database change information, it is stored in the change history table corresponding to the database. The change history table stores the database change information corresponding to each database version update. For example, the database management system stores three versions of database information of database A, with version numbers A1, A2 and A3 respectively. In the change history table corresponding to database A, database change information 1 and database change information 2 are stored, wherein database change information 1 is the change content of the database information with version number A2 compared to the database information with version number A1, and database change information 2 is the change content of the database information with version number A3 compared to the database information with version number A2.

[0043] The above implementation scheme of the present application obtains database change information by comparing the database information corresponding to the database with the historical database information corresponding to the database; and stores the database change information in the change history table corresponding to the database, which can realize automatic comparison and recording of the old and new versions of the database, simplifying the complexity of version control, and facilitating subsequent tracking by recording the change information in detail. At the same time, clear database version management helps collaboration between team members and reduces misunderstandings and errors caused by version conflicts or inconsistent information during team collaboration.

[0044] In order to enable the user to clearly understand the changes in the database, based on the above embodiment, in an optional embodiment of the present application, the method further includes:

[0045] Receiving a database selection operation from a user on the database management interface, and determining a target database;

[0046] receiving a first input of a user to the target database;

[0047] In response to the first input, a target change history table corresponding to the target database is obtained, and the target change history table is displayed.

[0048] Specifically, the user can perform a database selection operation on the database management interface, select any database in the business system as the target database, and perform a first input on the target database. For example, a resume viewing control is provided on the database management interface, and the user can select the target database and perform the first input by clicking the resume viewing control. After receiving the user's first input for the target database, the database management system obtains the target change resume table corresponding to the target database and displays the target change resume table. When displaying the target change resume table, the database management system can convert the content in the target change resume table into a database design document. The database design document can be in Markdown, PDF or HTML format and contain the latest database structure and change instructions.

[0049] Optionally, the database management system may set authority management for the first input, and only when the user has the authority can it respond to the first input executed by the user and display the change history table.

[0050] Specifically, a first user list for the first input may be set, and the users in the first user list have the authority to execute the first input, that is, the database management system can only respond to the first input executed by the users in the first user list, and display the corresponding target change history table. For example, the history viewing control may be displayed differently for different users. When the user who logs into the database management system is a user in the first user list, the history viewing control is displayed in the database management interface. When the user who logs into the database management system is not a user in the first user list, the history viewing control is not displayed in the database management interface. Alternatively, the history viewing control is displayed, but the history viewing control is displayed in gray, indicating that the history viewing control cannot be used. Then, the user cannot execute the first input through the history viewing control.

[0051] The above implementation scheme of the present application can display the change history of the target database in response to the user's first input of the target database on the database management interface, so that the user can clearly understand the changes of the target database. Especially in team collaboration, it can reduce misunderstandings and errors caused by version conflicts or inconsistent information, and improve the management efficiency of the business system.

[0052] The following describes how to obtain database change information by comparing database information and database historical information. In an optional embodiment of the present application, comparing database information corresponding to the database with historical database information corresponding to the database to obtain database change information includes:

[0053] According to the database information corresponding to the database, obtaining first data table information corresponding to each data table included in the database; wherein the first data table information corresponds to a data definition language format;

[0054] According to the historical database information corresponding to the database, acquiring the historical data table information corresponding to each data table included in the database; wherein the historical data table information corresponds to a document format;

[0055] For each data table, converting first data table information corresponding to the data table into a document format to obtain second data table information;

[0056] For each data table, compare the second data table information corresponding to the data table with the historical data table information corresponding to the data table to obtain data table change information;

[0057] According to the data table change information corresponding to each data table, the database change information corresponding to the database is obtained.

[0058] Specifically, the database information obtained by the database management system from the configuration center of the business system is in a data definition language (DDL) format, so the database information in the data definition language format needs to be converted into a document format, such as a JSON structure.

[0059] In the embodiment of the present application, since each database includes at least one data table, for the convenience of comparison, the first data table information corresponding to each data table included in the database can be obtained according to the database information, and the first data table information corresponds to the data definition language format. At the same time, the historical data table information corresponding to each data table included in the database can be obtained according to the historical database information. Here, the historical database information and the historical data table information are both in document format. It should be noted that the database information and data table information stored in the database management system are both in document format.

[0060] In order to achieve version comparison, it is necessary to first unify the formats corresponding to the data table information, convert the first data table information into a document format, and obtain the second data table information, wherein the data table information in the document format includes at least the data table name, field name, data type, whether it is allowed to be empty, primary key, default value and description.

[0061] Then, after unifying the format of the data table information, for each data table, compare the second data table information corresponding to the data table with the historical data table information to obtain the data table change information, wherein the data table change information at least includes the database name, data table name, change item, change date, change person and change description, etc.

[0062] After obtaining the data table change information corresponding to each data table, the database change information corresponding to the database can be obtained.

[0063] The above implementation scheme of the present application, by converting the first data table information in the data definition language format into the second data table information in the document format, can realize the comparison between the second data table information and the historical data table information, and then realize the comparison between different versions of databases, obtain database change information, simplify the complexity of database version management, and facilitate subsequent tracking and auditing.

[0064] Considering that each microservice in a business system using a microservice architecture corresponds to at least one database, when a user searches for design documents for a database, he needs to manually search through a large number of documents, which is a cumbersome process. In an optional embodiment of the present application, a search control is provided on the database management interface, and the method further includes:

[0065] receiving a second input from a user within the search control;

[0066] In response to the second input, determining a target database and target database information corresponding to the target database;

[0067] Displaying the target database information on the database management interface;

[0068] The target database is displayed in a preset style in the tree-shaped directory structure.

[0069] Specifically, a search control is set at a preset position of the database management interface. For example, the search control can be set at the top middle position or the top right position of the database management interface, and this application does not make any specific limitation on this.

[0070] The second input of the user in the search control is received, and the target database is determined in response to the second input of the user. For example, the user can enter the microservice name, database name, database number or keyword in the search control. Based on the text input of the user, the database management system can display a selection box, in which at least one database related to the text content searched by the user is displayed. The user can further select the database to be searched from the selection box and determine it as the target database. The target database here can be one or more. Optionally, when the user clicks the search control, the historical search record can be displayed. For example, the historical search record shows the databases that the user has searched for the last 10 times, or the databases that the user has searched for in the last week. The user can directly select the database to be searched from the historical search record and determine it as the target database, so that when the user has recently searched for the database, there is no need to enter text content, and the target database can be directly obtained by selection.

[0071] After the target database is determined, the target database information corresponding to the target database is obtained, where the target database information includes the design document of the target database. The target database information is displayed on the database management interface. In addition, after the target database is determined, the level to which the target database belongs can be expanded in the database structure information displayed in the tree-shaped target structure, and displayed in a preset style different from other databases to achieve highlighting of the target database. For example, the text box corresponding to the target database can be filled with a first color, where the first color is different from the display background color of the tree-shaped directory structure.

[0072] The above implementation scheme of the present application, by providing a search control for searching, can quickly locate the target database through keywords such as microservice name or database name, and view the target database information corresponding to the target database, thereby improving the search efficiency, avoiding the tedious process of manual search in massive documents, and improving the user experience.

[0073] As the requirements of various projects in the business system change and the business develops, the database design corresponding to each microservice in the business system needs to be frequently updated. In order to ensure that the database information stored in the database management system is synchronized with the database corresponding to the business system, the real-time and accuracy of the database information in the database management system is ensured, and decision errors caused by data lag are reduced. In an optional embodiment of the present application, the microservice field dictionary table and database information table corresponding to the business system are obtained, including:

[0074] Detect whether the collection time of the preset collection cycle has arrived;

[0075] Detecting update prompts sent by the business system;

[0076] When the collection time arrives and / or the update prompt is received, the microservice domain dictionary table and the database information table corresponding to the business system are obtained.

[0077] Specifically, the database management system can set a collection cycle for the business system, which can be determined based on the update status of the database in the business system. It can be a fixed value or a dynamically changing value. The database management system can set a scheduled task, such as using Cron Job, Kubernetes' CronJob or a tool similar to XXLjob, to detect whether the collection time of the collection cycle has arrived, so as to regularly execute the database document generation script, obtain the microservice domain dictionary table and database information table corresponding to the business system from the configuration center of the business system, and specifically use database management tools or APIs (MySQL's SHOW CREATE TABLE command, PostgreSQL's pg_dump tool, etc.) to obtain DDL statements from various databases to complete the collection of database information tables.

[0078] In addition, the database management system can also detect the update prompts sent by the business system. The update prompts here indicate that the database of the business system has been updated, or the business system has added a microservice, deleted a microservice, etc. When the database management system receives the update prompt, it executes the database document generation script to obtain the microservice domain dictionary table and database information table corresponding to the business system from the configuration center of the business system. Specifically, the database management tool or API (MySQL's SHOW CREATE TABLE command, PostgreSQL's pg_dump tool, etc.) can be used to obtain DDL statements from each database to complete the collection of database information tables.

[0079] In the above implementation scheme of the present application, the database management system can regularly collect database information tables and microservice domain dictionary tables from the configuration center of the business system, and the real-time and accuracy of the database information in the database management system can reduce decision-making errors caused by data lag.

[0080] In order to help business personnel with non-technical backgrounds better understand the database structure and data flow and promote communication and cooperation between business and technology, in an optional embodiment of the present application, the method further includes:

[0081] Receive a microservice selection operation from a user on the database management interface, and determine a target microservice;

[0082] Receiving a third input from a user regarding the target microservice;

[0083] In response to the third input, displaying a graphical interface corresponding to the target microservice, wherein the graphical interface displays databases included in the target microservice and data tables included in each database;

[0084] receiving a fourth input from a user on at least two data tables in the graphical interface;

[0085] In response to the fourth input, an association relationship between the at least two data tables is established, and the association relationship is converted into an entity relationship diagram and displayed on the graphical interface.

[0086] Specifically, in the database design process, since excessive use of primary and foreign key associations is not recommended, visual management of the association relationship between data tables in the database cannot be achieved on the business system side.

[0087] In the embodiment of the present application, the database management system also provides a graphical interface. On the database management interface, the user can perform a microservice selection operation to determine the target microservice, wherein the target microservice can be any microservice in the business system. After determining the target microservice, the user can perform a third input on the target microservice. For example, an entity relationship diagram (ER diagram) viewing control is provided on the database management interface. After selecting the target microservice, the user can perform the third input by clicking the ER diagram viewing control. After receiving the third input executed by the user for the target microservice, the database management system displays the graphical interface corresponding to the target microservice, and displays the databases included in the target microservice and the data tables included in each database on the graphical interface.

[0088] Furthermore, the user can perform a fourth input on the graphic interface, where the fourth input specifically selects at least two data tables displayed on the graphic interface. After receiving the fourth input, the database management system establishes an association relationship between the data tables selected by the user and displays it on the graphic interface in the form of an entity relationship diagram.

[0089] Specifically, an association tool can be developed on the front end of the database management system to establish associations between data tables and generate and maintain global ER diagrams for each microservice. Users can create and edit associations between data tables by dragging and dropping on a graphical interface that also supports zooming, searching, and exporting.

[0090] The above implementation scheme of the present application can establish the association relationship between the data tables in the database associated with the target microservice, obtain the global ER diagram corresponding to the target microservice, make the complex data structure clear at a glance, and enhance the comprehensibility of the data. In addition, with the help of the ER diagram, the association relationship between the data tables and field mapping and other information can be clearly displayed, which helps business personnel with non-technical backgrounds to better understand the database structure and data flow, and promote communication and cooperation between business and technology.

[0091] The above introduces the database management method provided by the embodiment of the present application. The following will introduce the database management device provided by the embodiment of the present application in conjunction with the accompanying drawings.

[0092] like Figure 2 As shown, an embodiment of the present invention further provides a database management device, the device comprising:

[0093] The first acquisition module 201 is used to acquire a microservice domain dictionary table and a database information table corresponding to the business system, wherein the database information table stores database information corresponding to the database associated with each microservice included in the business system;

[0094] A generation module 202 is used to generate database structure information corresponding to the business system according to the microservice domain dictionary table and the database information table;

[0095] The first display module 203 is used to display the database structure information in a tree directory structure on the database management interface corresponding to the business system.

[0096] Optionally, after obtaining the microservice domain dictionary table and database information table corresponding to the business system, the device further includes:

[0097] A second acquisition module is used to acquire historical database information corresponding to each database included in the business system;

[0098] A comparison module, for comparing, for each database, database information corresponding to the database with historical database information corresponding to the database, to obtain database change information;

[0099] A storage module, used for storing the database change information in a change history table corresponding to the database;

[0100] Optionally, the device further comprises:

[0101] A first receiving module is used to receive a database selection operation of a user on the database management interface and determine a target database;

[0102] A second receiving module, configured to receive a first input of a user to the target database;

[0103] The second display module is used to obtain a target change history table corresponding to the target database in response to the first input, and display the target change history table.

[0104] Optionally, the comparison module includes:

[0105] A first acquisition submodule, configured to acquire first data table information corresponding to each data table included in the database according to database information corresponding to the database; wherein the first data table information corresponds to a data definition language format;

[0106] A second acquisition submodule is used to acquire historical data table information corresponding to each data table included in the database according to the historical database information corresponding to the database; wherein the historical data table information corresponds to a document format;

[0107] A processing submodule, for converting first data table information corresponding to each data table into a document format to obtain second data table information;

[0108] A comparison submodule, for comparing, for each data table, second data table information corresponding to the data table with historical data table information corresponding to the data table, to obtain data table change information;

[0109] The determination submodule is used to obtain the database change information corresponding to the database according to the data table change information corresponding to each data table.

[0110] Optionally, a search control is provided on the database management interface, and the device further comprises:

[0111] A second receiving module, used to receive a second input from a user in the search control;

[0112] a determination module, configured to determine a target database and target database information corresponding to the target database in response to the second input;

[0113] A third display module, used to display the target database information on the database management interface;

[0114] A fourth display module is used to display the target database in a preset style in the tree directory structure.

[0115] Optionally, the first acquisition module includes:

[0116] The first detection submodule is used to detect whether the collection time of a preset collection cycle has arrived;

[0117] A second detection submodule, used to detect the update prompt sent by the business system;

[0118] The third acquisition submodule is used to acquire the microservice domain dictionary table and database information table corresponding to the business system when the collection time arrives and / or the update prompt is received.

[0119] Optionally, the device further comprises:

[0120] A fifth receiving module is used to receive a microservice selection operation of a user on the database management interface and determine a target microservice;

[0121] A sixth receiving module, configured to receive a third input from a user to the target microservice;

[0122] a fifth display module, configured to display a graphical interface corresponding to the target microservice in response to the third input, wherein the graphical interface displays databases included in the target microservice and data tables included in each database;

[0123] a seventh receiving module, configured to receive a fourth input from a user on at least two data tables in the graphical interface;

[0124] The sixth display module is used to establish an association relationship between the at least two data tables in response to the fourth input, and convert the association relationship into an entity relationship diagram to display it on the graphical interface.

[0125] The database management method and device provided by the present application can ensure the real-time and accuracy of the database information in the database management system by obtaining the microservice domain dictionary table and the database information table corresponding to the business system, and realize the synchronization of the database information in the database management system and the database information in the business system. According to the microservice domain dictionary table and the database information table, the database structure information is automatically generated, which can reduce the workload of manual entry and editing, thereby reducing the risk of errors caused by human factors. By displaying the database structure information on the database management interface in a tree directory structure that is easy to manage and search, centralized management of the databases associated with each microservice in the business system is realized, thereby improving the database management efficiency of the business system under the microservice architecture.

[0126] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0127] An embodiment of the present application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned database management method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0128] For example, Figure 3 FIG. 1 shows a schematic diagram of the physical structure of an electronic device. Figure 3 As shown, the electronic device may include: a processor (processor) 310, a communication interface (Communications Interface) 320, a memory (memory) 330 and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 complete mutual communication through the communication bus 340. The processor 310 can call the logic instructions in the memory 330, and the processor 310 is used to perform the following steps: obtain the microservice domain dictionary table and the database information table corresponding to the business system, wherein the database information table stores the database information corresponding to the database associated with each microservice included in the business system; according to the microservice domain dictionary table and the database information table, generate the database structure information corresponding to the business system; display the database structure information in a tree directory structure on the database management interface corresponding to the business system. The processor 310 can also execute other schemes in the embodiments of the present application, which will not be further elaborated here.

[0129] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.

[0130] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned database management method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0131] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0133] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0134] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0136] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0138] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0139] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0140] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A database management method, characterized in that: The method comprises: Obtain a microservice domain dictionary table and a database information table corresponding to the business system, wherein the database information table stores database information corresponding to the database associated with each microservice included in the business system; Generate database structure information corresponding to the business system according to the microservice domain dictionary table and the database information table; The database structure information is displayed in a tree directory structure on the database management interface corresponding to the business system.

2. The database management method according to claim 1, characterized in that: After obtaining the microservice domain dictionary table and database information table corresponding to the business system, the method further includes: Obtaining historical database information corresponding to each database included in the business system; For each database, compare the database information corresponding to the database with the historical database information corresponding to the database to obtain database change information; The database change information is stored in a change history table corresponding to the database.

3. The database management method according to claim 2, characterized in that: The method further comprises: receiving a database selection operation by a user on the database management interface, and determining a target database; receiving a first input of a user to the target database; In response to the first input, a target change history table corresponding to the target database is obtained, and the target change history table is displayed.

4. The database management method according to claim 2, characterized in that: Comparing the database information corresponding to the database with the historical database information corresponding to the database to obtain database change information, including: According to the database information corresponding to the database, obtaining first data table information corresponding to each data table included in the database; wherein the first data table information corresponds to a data definition language format; According to the historical database information corresponding to the database, acquiring the historical data table information corresponding to each data table included in the database; wherein the historical data table information corresponds to the document format; For each data table, converting first data table information corresponding to the data table into a document format to obtain second data table information; For each data table, compare the second data table information corresponding to the data table with the historical data table information corresponding to the data table to obtain data table change information; According to the data table change information corresponding to each data table, the database change information corresponding to the database is obtained.

5. The database management method according to claim 1, characterized in that: The database management interface is provided with a search control, and the method further comprises: receiving a second input from a user within the search control; In response to the second input, determining a target database and target database information corresponding to the target database; Displaying the target database information on the database management interface; The target database is displayed in a preset style in the tree-shaped directory structure.

6. The database management method according to claim 1, characterized in that: Get the microservice domain dictionary table and database information table corresponding to the business system, including: Detect whether the collection time of the preset collection cycle has arrived; Detecting update prompts sent by the business system; When the collection time arrives and / or the update prompt is received, the microservice domain dictionary table and database information table corresponding to the business system are obtained.

7. The database management method according to claim 1, characterized in that: The method further comprises: Receive a microservice selection operation from a user on the database management interface, and determine a target microservice; Receiving a third input from a user regarding the target microservice; In response to the third input, displaying a graphical interface corresponding to the target microservice, wherein the graphical interface displays databases included in the target microservice and data tables included in each database; receiving a fourth input from a user on at least two data tables in the graphical interface; In response to the fourth input, an association relationship between the at least two data tables is established, and the association relationship is converted into an entity relationship diagram and displayed on the graphical interface.

8. A database management device, characterized in that: include: A first acquisition module is used to acquire a microservice domain dictionary table and a database information table corresponding to the business system, wherein the database information table stores database information corresponding to a database associated with each microservice included in the business system; A generation module, used to generate database structure information corresponding to the business system according to the microservice domain dictionary table and the database information table; The first display module is used to display the database structure information in a tree directory structure on the database management interface corresponding to the business system.

9. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program implements the database management method according to any one of claims 1 to 7 when executed by the processor.

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

Citation Information

Patent Citations

  • Micro-service splitting method, device and equipment and storage medium

    CN110909015A

  • Micro-service library division method and system and medium

    CN112148710A

  • Database management method and device, storage medium and electronic device

    CN112860699A

  • Database change data processing method and device, computer equipment and medium

    CN113377789A

  • Data table entity relation graph generation method and device, equipment and storage medium

    CN114637811A