CN117472928A - Database management method, device, electronic equipment and computer storage medium - Google Patents

Database management method, device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN117472928A
CN117472928A CN202311481796.2A CN202311481796A CN117472928A CN 117472928 A CN117472928 A CN 117472928A CN 202311481796 A CN202311481796 A CN 202311481796A CN 117472928 A CN117472928 A CN 117472928A
Authority
CN
China
Prior art keywords
database
metadata
target
version number
type
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
CN202311481796.2A
Other languages
Chinese (zh)
Inventor
赵飞
曹召换
王煜
何腾翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino Corp filed Critical Aisino Corp
Priority to CN202311481796.2A priority Critical patent/CN117472928A/en
Publication of CN117472928A publication Critical patent/CN117472928A/en
Pending legal-status Critical Current

Links

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/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2329Optimistic concurrency control using 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/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a database management method, a device, electronic equipment and a computer storage medium, wherein the database management method is used for a target information system, the target information system comprises a main database and a plurality of target databases, the database type of the main database is different from the database type of the target databases, and the application obtains first updating metadata corresponding to a first database type and a target version number of the main database and a second database type of the target database to be updated; according to the first database type and the second database type, converting the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model; and updating the second updating metadata to the target database to be updated so as to finish the version updating of the target database. The workload of updating the versions of the databases of different types is reduced, and the updating efficiency is improved.

Description

Database management method, device, electronic equipment and computer storage medium
Technical Field
The embodiment of the application relates to the technical field of databases, in particular to a database management method, a database management device, electronic equipment and a computer storage medium.
Background
In an information system, a plurality of types of databases are generally included, and the data storage structures and grammars of the databases of different types are different, so that when the information system is updated or maintained, a user needs to perform version update operations on the databases of different types respectively, which results in large update workload and low efficiency.
Disclosure of Invention
In view of the foregoing, embodiments of the present application provide a database management method, apparatus, electronic device, and computer storage medium, so as to at least partially solve the foregoing problems.
According to a first aspect of an embodiment of the present application, there is provided a database management method for a target information system, the target information system including a main database and a plurality of target databases, the database type of the main database being different from the database type of the target database, the database management method including: acquiring first updating metadata corresponding to a first database type and a target version number of a main database and a second database type of the target database to be updated, wherein the first updating metadata refers to metadata changed in the process of changing the main database from the first version number to the target version number, and the first version number refers to a version number corresponding to the current version number of the target database to be updated in the main database; according to the first database type and the second database type, converting the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model, wherein the metadata mapping model comprises a mapping relation between the metadata corresponding to the first database type and the metadata corresponding to the second database type; and updating the second updating metadata to the target database to be updated so as to finish the version updating of the target database.
According to a second aspect of the embodiments of the present application, there is provided a database management apparatus for a target information system, where the target information system includes a main database and a plurality of target databases, the database type of the main database is different from the database type of the target database, the database management apparatus includes a data acquisition module, a metadata conversion module, and a version update module, where the data acquisition module is configured to acquire first update metadata corresponding to a first database type and a target version number of the main database, and second database type of the target database to be updated, the first update metadata refers to metadata changed in a process of changing the main database from the first version number to the target version number, and the first version number refers to a version number corresponding to a current version number of the target database to be updated in the main database; the metadata conversion module is used for converting the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model according to the first database type and the second database type, and the metadata mapping model comprises a mapping relation between the metadata corresponding to the first database type and the metadata corresponding to the second database type; the version updating module is used for updating the second updating metadata to the target database to be updated so as to finish the version updating of the target database.
According to a third aspect of embodiments of the present application, there is provided an electronic device, including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are communicated with each other through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute operations corresponding to the method according to the first aspect.
According to a fourth aspect of embodiments of the present application, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements a method as in the first aspect.
According to the database management method, the device, the electronic equipment and the computer storage medium provided by the embodiment of the application, wherein the database management method is used for a target information system, the target information system comprises a main database and a plurality of target databases, the database type of the main database is different from the database type of the target databases, and the database management method comprises the following steps: acquiring first updating metadata corresponding to a first database type and a target version number of a main database and a second database type of the target database to be updated, wherein the first updating metadata refers to metadata changed in the process of changing the main database from the first version number to the target version number, and the first version number refers to a version number corresponding to the current version number of the target database to be updated in the main database; according to the first database type and the second database type, converting the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model, wherein the metadata mapping model comprises a mapping relation between the metadata corresponding to the first database type and the metadata corresponding to the second database type; and updating the second updating metadata to the target database to be updated so as to finish the version updating of the target database. According to the method and the device, the user only needs to update the metadata of the main database, and then the metadata mapping model can be used for directly synchronizing the plurality of target databases so as to finish version update of the plurality of target databases, and version update operation of the user on each type of database is not needed, so that the workload of version update of the plurality of different types of databases is reduced, and the update efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present application, and other drawings may also be obtained according to these drawings for a person having ordinary skill in the art.
Fig. 1 is a schematic view of an application scenario of a database management method according to an exemplary embodiment of the present application;
FIG. 2 is a flowchart of steps of a database management method according to an exemplary embodiment of the present application;
FIG. 3 is a block diagram of a database management device according to an exemplary embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
In order to better understand the technical solutions in the embodiments of the present application, the following descriptions will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the embodiments of the present application shall fall within the scope of protection of the embodiments of the present application.
Embodiments of the present application are further described below with reference to the accompanying drawings of embodiments of the present application.
First, an application scenario of the database management method of the present embodiment is described, where the database management method of the present embodiment may be used for a target information system, where the target information system includes a main database and a plurality of target databases, and a database type of the main database is different from a database type of the target database.
Referring to fig. 1, for example, the target information system may include one main database and three target databases, and the types of databases of the main database and the target databases may be different, for example, any one of Mysql, oracle, postgresql and the like, which is not limited in this embodiment. Databases of different database types may differ in terms of data storage structure and syntax, and thus, when performing version update of the database, version update operations need to be performed on databases of different types for the same update content, for example, different update scripts are written for each type of database, resulting in a large workload for version update of a plurality of databases of different types and low efficiency of version update. In view of the foregoing, embodiments of the present application provide a database management method, apparatus, electronic device, and computer storage medium, which can solve the above-mentioned problems in the prior art.
Referring to fig. 2, a flowchart of steps of a database management method according to an exemplary embodiment of the present application is shown.
The database management method of the present embodiment includes the steps of:
s202, acquiring first updating metadata corresponding to a first database type and a target version number of a main database and a second database type of a target database to be updated.
The first update metadata refers to metadata changed in the process of changing the primary database from a first version number to a target version number, and the first version number refers to a version number corresponding to the current version number of the target database to be updated in the primary database.
The main database may be a Mysql database, the first database type may be a tinylint type, the main database may include a plurality of version numbers and metadata corresponding to each version number, and according to metadata corresponding to any two version numbers, a change of the corresponding metadata may be determined, so as to obtain corresponding updated metadata. The target database to be updated may be an Oracle database, and the second database type may be a Number type, wherein the target version Number corresponds to first update metadata, the first update metadata refers to update metadata corresponding to the target version Number from a first version Number of the main database, and the first version Number refers to a version Number corresponding to a current version Number of the target database to be updated in the main database. It should be noted that, the current version number of the target database to be updated has a corresponding version number in the master database, that is, the current version number of the master database is greater than or equal to the current version number of the target database.
It should be noted that metadata is also called intermediate data, relay data, etc. and is data for describing data, mainly describing information of data attributes, and is used to support functions such as indicating storage locations, history data, resource searching, file recording, etc. For example, the metadata may include table information, column information, view information, stored procedure information, function information, constraint information, and the like, which is not limited by the present embodiment.
In an alternative implementation manner, the database management method of the present embodiment further includes: according to a preset updating verification period, acquiring metadata of a main database in a current period and metadata of a previous period; comparing the metadata of the current period with the metadata of the previous period to obtain a comparison result; if the comparison result is metadata change, the version number of the metadata in the current period is identified and stored in the metadata version library of the main database.
The preset update verification period may be flexibly set by those skilled in the art according to actual situations, for example, the update verification period may be set to 1 month, which is not limited in this embodiment. And according to a preset updating verification period, acquiring the metadata of the main database in the current period and the metadata of the last period, for example, acquiring the metadata of the main database in the current month and the metadata of the last month if the preset updating verification period is 1 month, and comparing the metadata of the current month and the metadata of the last month to obtain a comparison result, wherein the comparison result can comprise metadata change or metadata unchanged. If the comparison result is metadata change, the version number is identified for the metadata of the current month, and the version number is stored in a metadata version library of the main database. For example, if the version number of the previous month is A3, it may be identified that the version number of the metadata of the current month is A4, and the metadata of the current month and the corresponding version number are stored in the metadata version library of the main database. All metadata and corresponding version numbers of the main database in the current period can be stored in the metadata version database, and the updated metadata identification version numbers of the main database in the current period, which are changed relative to the main database in the previous period, can be stored in the metadata version database of the main database. This way, compared with storing all metadata of the main database of the current period into the metadata version library, the amount of stored data is smaller, and the occupied storage space is smaller.
In the implementation mode, the update verification period is set, the metadata of the main database in the current period and the metadata of the last period are obtained according to the update verification period, the metadata of the current period and the metadata of the last period are compared, if the obtained comparison result is metadata change, the version number of the metadata of the current period is identified, and the version number of the metadata of the current period is stored in the metadata version database of the main database. Version updating of the main database can be monitored in time, metadata of different versions are stored, follow-up version rollback can be conveniently carried out, and changing contents among versions can be conveniently inquired.
In an alternative implementation, if the comparison result is a metadata change, the version number is identified for metadata of the current period and stored in a metadata version database of the main database, including: if the comparison result is metadata change, transmitting the comparison result to an auditing node for auditing according to a preset transmission path; and receiving an auditing result returned by the auditing node, and if the auditing result is a confirmation change, identifying the version number by the metadata of the current period and storing the version number into a metadata version library in the main database.
For example, if the comparison result is metadata change, the comparison result may be sent to an auditing node for auditing according to a preset sending path. The preset sending path may be flexibly set by those skilled in the art according to practical situations, for example, the sending path may be set as a mailbox address, which is not limited in this embodiment. And receiving an audit result returned by the audit node, wherein the audit result can comprise confirmation of change or no change. If the auditing result is confirmation change, the version number of the metadata in the current period is identified and stored in a metadata version library in the main database. If the auditing result is that the modification is not carried out, the version number identification and the storage of the metadata of the current period are not carried out.
In the implementation mode, the comparison result is sent to the auditing node for auditing through a preset sending path, and then the metadata in the current period is identified with the version number and stored in the metadata version database in the main database according to the auditing result returned by the auditing node if the auditing result is confirmation change. And further checking and confirming the version updating of the main database so as to avoid the situation that metadata corresponding to different version numbers are the same in the version library of the main database.
In an alternative implementation manner, the database management method of the present embodiment further includes: acquiring metadata corresponding to a target version number of a main database and metadata corresponding to a first version number; and comparing the metadata corresponding to the target version number of the main database with the metadata corresponding to the first version number to obtain first updated metadata of the main database.
Illustratively, the first version number in the primary database corresponds to the current version number of the target database to be updated, e.g., the first version number in the primary database is A2 and the current version number of the target database to be updated is B2. Metadata corresponding to the first version number corresponds to metadata corresponding to the current version number of the target database to be updated, namely, the metadata corresponding to the first version number in the main database is the same as the content described by the metadata corresponding to the current version number of the target database to be updated. Acquiring metadata corresponding to a target version number of a main database and metadata corresponding to a first version number; and comparing the metadata corresponding to the target version number of the main database with the metadata corresponding to the first version number, so as to obtain the first updated metadata of the main database. The first version number and the target version number may be two adjacent version numbers, for example, the first version number is A2, and the target version number is A3; two non-adjacent version numbers, for example, a first version number of A2 and a target version number of A5, may be used, which is not limited in this embodiment.
In this implementation manner, the first version number in the main database corresponds to the current version number of the target database to be updated, so that metadata corresponding to the target version number of the main database and metadata corresponding to the first version number can be compared as a reference, and then the change content between the metadata corresponding to the current version number of the target database to be updated and the metadata of the final target version, that is, the first update metadata of the main database can be obtained, so that version update of the target database can be realized according to the first update metadata of the main database.
S204, according to the first database type and the second database type, converting the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model.
Wherein the metadata mapping model comprises a mapping relation between metadata corresponding to a first database type and metadata corresponding to a second database type
The preset metadata mapping model may include a mapping relationship between metadata corresponding to a first database type of the main database and metadata corresponding to a database type of each target database, and taking the above information system as an example that the main database is the first database type and the three target databases are respectively the second database type, the third database type and the fourth database type, and the preset metadata mapping model may include a mapping relationship between metadata corresponding to the first database type and metadata corresponding to the second database type, a mapping relationship between metadata corresponding to the first database type and metadata corresponding to the third database type, and a mapping relationship between metadata corresponding to the first database type and metadata corresponding to the fourth database type. The preset metadata mapping model may further include a mapping relationship between metadata corresponding to a database type of each target database, for example, the preset metadata mapping model may include a mapping relationship between metadata corresponding to a second database type and metadata corresponding to a third database type, a mapping relationship between metadata corresponding to the second database type and metadata corresponding to a fourth database type, and a mapping relationship between metadata corresponding to the third database type and metadata corresponding to the fourth database type. This embodiment is not limited thereto. Determining database types of the main database and the target database to be updated, namely a first database type and a second database type, and mapping the first updating metadata through a preset metadata mapping model based on the first database type and the second database type, so that the first updating metadata corresponding to the first database type can be converted into second updating metadata corresponding to the second database type.
In an alternative implementation, the metadata mapping model is built by: determining first standard metadata corresponding to a first database type of a main database and target standard metadata of target database types of each target database, wherein the first standard metadata are used for defining metadata corresponding to the first database type, and the target standard metadata are used for defining metadata corresponding to the target database type; respectively establishing mapping relations between the metadata of the main database and the metadata of each target database according to the first standard metadata and the target standard metadata to obtain a plurality of mapping relations; and determining a metadata mapping model according to the mapping relations.
The standard metadata is used to define metadata corresponding to different database types, that is, the standard metadata may define which metadata corresponds to the corresponding database types, for example, metadata corresponding to each database type includes field type information, function information, index type information, and the like, which is not limited in this embodiment. The first standard metadata may define metadata corresponding to a first database type, the target standard metadata may define metadata corresponding to a target database type, determine the first standard metadata corresponding to the first database type of the main database and the target standard metadata corresponding to the target database type of each target database, and it should be noted that the target database type herein generally refers to the database type of each target database, including but not limited to the second database type corresponding to the target database to be updated, and likewise, the target standard metadata herein generally refers to standard metadata corresponding to the database type of each target database, including but not limited to the second standard metadata corresponding to the second database type. According to the first standard metadata and the target standard metadata, mapping relations between the metadata of the main database and the metadata of each target database are respectively established to obtain a plurality of mapping relations, and taking the first database type and the second database type as examples, for example, field information in the first standard metadata and field type information in the second standard metadata can be respectively subjected to one-to-one correspondence, function information can be subjected to one-to-one correspondence, index type information can be subjected to one-to-one correspondence, and the like, so that mapping relations between the metadata of the main database and the metadata of the target database to be updated can be obtained. And integrating the mapping relations and the database types corresponding to the mapping relations to form a metadata mapping model.
In the implementation manner, a plurality of mapping relations are obtained by respectively establishing the mapping relation between the metadata of the main database and the metadata of each target database through the first standard metadata corresponding to the first database type of the main database and the target standard metadata of the target database type of each target database, and a metadata mapping model is determined according to the plurality of mapping relations. The metadata of the main database and the metadata of each target database can be mapped through the metadata mapping model, so that when the version of the information system is updated, the version of the main database is used as a reference, batch version updating can be performed on a plurality of target databases, and the version updating efficiency is improved.
In an alternative implementation, according to a preset metadata mapping model, converting the first updated metadata into second updated metadata corresponding to the second database type of each target database includes: determining a target mapping relation from a plurality of mapping relations in a preset metadata mapping model according to the first database type and the second database type; and converting the first updating metadata into second updating metadata corresponding to the second database type of the target database according to the target mapping relation.
The target mapping relationship can be obtained by querying the mapping relationship between the first database type and the second database type from a plurality of mapping relationships in a preset metadata mapping model according to the first database type and the second database type. And converting the first updating metadata into second updating metadata corresponding to the second database type according to the corresponding relation in the target mapping relation. For example, the first update metadata is a field value a of an a field type, where the a field type corresponding to the first database type has a mapping relationship with the B field type corresponding to the second database type, the field value a of the a field type may be converted into a field value B of the B field type according to the mapping relationship, where the content contained in the field value a and the field value B are the same, but have different storage structures or grammars, and the embodiment is not limited to this.
In the implementation manner, only the database types of the main database and the target database to be updated are required to be determined, the target mapping relation is determined from a plurality of mapping relations in a preset metadata mapping model according to the database types of the main database and the target database to be updated, and the first updating metadata of the main database can be converted into the second updating metadata corresponding to the second database type of the target database according to the target mapping relation. Thus, the version update of the target database to be updated is completed, and the workload of the user on the version update of the databases of different types is reduced.
S206, updating the second updating metadata to the target database to be updated so as to finish the version updating of the target database.
For example, the second update metadata may be sent to the database connection adapter, and the version update of the target database may be completed by updating the second update metadata to the target database to be updated using the database connection adapter.
In an alternative implementation manner, the database management method of the present embodiment further includes: acquiring first metadata corresponding to a current version number and second metadata corresponding to a previous version number of a main database from a metadata version database; generating an upgrade script corresponding to the current version number of the main database according to the first metadata and the second metadata, and storing the upgrade script into a script library of the main database; and/or acquiring the first metadata corresponding to the current version number of the main database from the metadata version database, generating an initialization script corresponding to the current version number of the main database according to the first metadata, and storing the initialization script in a script database of the main database.
Illustratively, first metadata corresponding to a current version number and second metadata corresponding to a last version number of a main database are obtained from a metadata version database, and the current version number and the last version number are adjacent version numbers. According to the first metadata and the second metadata, metadata changed between the current version number and the last version number is determined, namely, the metadata are updated, the updated metadata are used for generating an upgrade script corresponding to the current version number of the main database, namely, the main database is upgraded from the last version to the upgrade script of the current version, and the upgrade script is stored in a script library of the main database. In another implementation manner, third metadata corresponding to a third version number and fourth metadata corresponding to a fourth version number of the main database are obtained from the metadata version database, the third version number and the fourth version number are non-adjacent version numbers, the third version number is smaller than the fourth version number, and an upgrade script corresponding to the fourth version number of the main database, namely an upgrade script of the main database from the third version to the fourth version, is generated according to the third version number and the fourth version number, and is stored in a script library of the main database. In another implementation manner, the first metadata corresponding to the current version number of the main database can be obtained from the metadata version database, and the initialization script corresponding to the current version number of the main database is directly generated by the first metadata and stored in the script database of the main database.
In the implementation manner, besides updating a certain version of the main database to other target databases in the same information system synchronously, the metadata in the metadata version database of the main database can be used for generating upgrade scripts among different versions or generating initialization scripts corresponding to each version, and a user can directly download the upgrade scripts or the initialization scripts and directly execute the obtained upgrade scripts or the initialization scripts in other systems, so that version synchronization of databases among different systems is realized, and synchronization efficiency is improved.
According to the database management method, the first database type of the main database, the first updating metadata corresponding to the target version number and the second database type of the target database to be updated are obtained; according to the first database type and the second database type, converting the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model; and updating the second updating metadata to the target database to be updated so as to finish the version updating of the target database. In this embodiment, the user only needs to update the metadata of the main database, and then uses the metadata mapping model to directly synchronize the multiple target databases, so as to complete the version update of the multiple target databases, without the need of the user to perform version update operation on each type of database, thereby reducing the workload of version update of multiple different types of databases and improving the update efficiency.
Referring to fig. 3, a block diagram of a database management apparatus according to an exemplary embodiment of the present application is shown.
The database management device of the present embodiment is used for a target information system, where the target information system includes a main database and a plurality of target databases, the database type of the main database is different from the database type of the target database, and the database management device includes a data acquisition module 302, a metadata conversion module 304, and a version update module 306.
The data obtaining module 302 is configured to obtain first update metadata corresponding to a first database type and a target version number of the main database, and a second database type of the target database to be updated, where the first update metadata refers to metadata changed in a process of changing the main database from the first version number to the target version number, and the first version number refers to a version number corresponding to a current version number of the target database to be updated in the main database; the metadata conversion module 304 is configured to convert, according to a first database type and a second database type, the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model, where the metadata mapping model includes a mapping relationship between metadata corresponding to the first database type and metadata corresponding to the second database type; the version updating module 306 is configured to update the second update metadata to the target database to be updated, so as to complete the version update of the target database.
In an alternative implementation manner, the database management device further includes a metadata mapping model building module, configured to: determining first standard metadata corresponding to a first database type of a main database and second standard metadata of a second database type of each target database, wherein the first standard metadata are used for defining metadata corresponding to the first database type, and the second standard metadata are used for defining metadata corresponding to the second database type; respectively establishing a mapping relation between the metadata of the main database and the metadata of each target database according to the first standard metadata and the second standard metadata to obtain a plurality of mapping relations; and determining a metadata mapping model according to the mapping relations.
In an alternative implementation manner, the metadata conversion module 304 is further configured to determine, according to the first database type and the second database type, a target mapping relationship from a plurality of mapping relationships in a preset metadata mapping model; and converting the first updating metadata into second updating metadata corresponding to the second database type of the target database according to the target mapping relation.
In an alternative implementation, the database management apparatus further includes a version management module configured to: according to a preset updating verification period, acquiring metadata of a main database in a current period and metadata of a previous period; comparing the metadata of the current period with the metadata of the previous period to obtain a comparison result; if the comparison result is metadata change, the version number of the metadata in the current period is identified and stored in the metadata version library of the main database.
In an alternative implementation, the version management module is further configured to: if the comparison result is metadata change, transmitting the comparison result to an auditing node for auditing according to a preset transmission path; and receiving an auditing result returned by the auditing node, and if the auditing result is a confirmation change, identifying the version number by the metadata of the current period and storing the version number into a metadata version library in the main database.
In an alternative implementation, the database management apparatus further includes a script management module configured to: acquiring first metadata corresponding to a current version number and second metadata corresponding to a previous version number of a main database from a metadata version database; generating an upgrade script corresponding to the current version number of the main database according to the first metadata and the second metadata, and storing the upgrade script into a script library of the main database; and/or acquiring the first metadata corresponding to the current version number of the main database from the metadata version database, generating an initialization script corresponding to the current version number of the main database according to the first metadata, and storing the initialization script in a script database of the main database.
In an alternative implementation, the data acquisition module 302 is further configured to: acquiring metadata corresponding to a target version number of a main database and metadata corresponding to a first version number; and comparing the metadata corresponding to the target version number of the main database with the metadata corresponding to the first version number to obtain first updated metadata of the main database.
The database management device in this embodiment is configured to implement the corresponding database management method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again. In addition, the functional implementation of each module in the database management device of the present embodiment may refer to the description of the corresponding portion in the foregoing method embodiment, which is not repeated herein.
Referring to fig. 4, a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application is shown. The specific embodiments of the present invention are not limited to specific implementations of electronic devices.
As shown in fig. 4, the electronic device may include: a processor 401, a memory 403, a communication bus 404, and a communication interface (Communications Interface) 405.
Wherein: processor 401, memory 403, and communication interface 405, communicate with each other via communication bus 404.
A communication interface 405 for communicating with other electronic devices or servers.
The processor 401 is configured to execute the program 402, and may specifically perform the steps of the database management method in any of the foregoing embodiments.
In particular, program 402 may include program code including computer operating instructions.
The processor 401 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present application. The one or more processors comprised by the smart device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
A memory 403 for storing the program 402. Memory 403 may comprise high-speed RAM memory and may also comprise non-volatile memory (non-volatile memory), such as at least one disk memory.
Program 402 may be used in particular to cause processor 401 to execute steps of any of the database management methods described in the embodiments. The specific implementation of each step in the program 402 may refer to the corresponding descriptions in the steps and units executed by any one of the database management methods in the above steps, which are not described herein in detail. It will be apparent to those skilled in the art that for convenience and brevity of description, the specific operation of the apparatus and modules described above may be described with reference to corresponding processes in the foregoing method embodiments.
The present application also provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements a database management method as described in any of the above-described method embodiments.
Embodiments of the present application also provide a computer program product, including computer instructions that instruct a computing device to perform operations corresponding to the database management method described in any one of the above-described method embodiments.
It should be noted that, according to implementation requirements, each component/step described in the embodiments of the present application may be split into more components/steps, and two or more components/steps or part of operations of the components/steps may be combined into new components/steps, so as to achieve the purposes of the embodiments of the present application.
The above-described methods according to embodiments of the present application may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, RAM, floppy disk, hard disk, or magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium and to be stored in a local recording medium downloaded through a network, so that the methods described herein may be stored on such software processes on a recording medium using a general purpose computer, special purpose processor, or programmable or special purpose hardware such as an ASIC or FPGA. It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by a computer, processor, or hardware, performs the methods described herein. Furthermore, when a general purpose computer accesses code for implementing the methods illustrated herein, execution of the code converts the general purpose computer into a special purpose computer for performing the methods illustrated herein.
Those of ordinary skill in the art will appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The above embodiments are only for illustrating the embodiments of the present application, but not for limiting the embodiments of the present application, and various changes and modifications can be made by one skilled in the relevant art without departing from the spirit and scope of the embodiments of the present application, so that all equivalent technical solutions also fall within the scope of the embodiments of the present application, and the scope of the embodiments of the present application should be defined by the claims.

Claims (10)

1. A database management method for a target information system, the target information system including a main database and a plurality of target databases, the main database having a database type different from a database type of the target database, the database management method comprising:
Acquiring first updating metadata corresponding to a first database type and a target version number of the main database and a second database type of the target database to be updated, wherein the first updating metadata refer to metadata changed in the process of changing the main database from the first version number to the target version number, and the first version number refers to a version number corresponding to the current version number of the target database to be updated in the main database;
according to the first database type and the second database type, converting the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model, wherein the metadata mapping model comprises a mapping relation between the metadata corresponding to the first database type and the metadata corresponding to the second database type;
and updating the second updating metadata to the target database to be updated so as to finish version updating of the target database.
2. The database management method according to claim 1, wherein the metadata mapping model is established by:
Determining first standard metadata corresponding to a first database type of the main database and target standard metadata corresponding to target database types of each target database, wherein the first standard metadata are used for defining metadata corresponding to the first database type, and the target standard metadata are used for defining metadata corresponding to the target database type;
respectively establishing a mapping relation between the metadata of the main database and the metadata of each target database according to the first standard metadata and the target standard metadata to obtain a plurality of mapping relations;
and determining the metadata mapping model according to a plurality of mapping relations.
3. The database management method according to claim 2, wherein the converting the first updated metadata into second updated metadata corresponding to the second database type of each of the target databases according to a preset metadata mapping model includes:
determining a target mapping relation from a plurality of mapping relations in the preset metadata mapping model according to the first database type and the second database type;
And according to the target mapping relation, converting the first updating metadata into second updating metadata corresponding to a second database type of the target database to be updated.
4. The database management method according to claim 1, wherein the method further comprises:
acquiring metadata of the main database in the current period and metadata of the last period according to a preset updating verification period;
comparing the metadata of the current period with the metadata of the previous period to obtain a comparison result;
and if the comparison result is metadata change, identifying a version number for the metadata of the current period, and storing the version number into a metadata version library of the main database.
5. The method according to claim 4, wherein if the comparison result is a metadata change, identifying a version number for the metadata of the current period and storing the version number in a metadata version library of the master database, comprising:
if the comparison result is metadata change, the comparison result is sent to an auditing node for auditing according to a preset sending path;
and receiving an auditing result returned by the auditing node, if the auditing result is a confirmation change, identifying a version number for the metadata in the current period, and storing the version number into a metadata version library in the main database.
6. The database management method according to claim 4, wherein the method further comprises:
acquiring first metadata corresponding to the current version number and second metadata corresponding to the last version number of the main database from the metadata version database; generating an upgrade script corresponding to the current version number of the main database according to the first metadata and the second metadata, and storing the upgrade script into a script library of the main database; and/or the number of the groups of groups,
and acquiring the first metadata corresponding to the current version number of the main database from the metadata version library, generating an initialization script corresponding to the current version number of the main database according to the first metadata, and storing the initialization script into a script library of the main database.
7. The database management method according to claim 1, wherein the method further comprises:
acquiring metadata corresponding to the target version number of the main database and metadata corresponding to the first version number;
and comparing the metadata corresponding to the target version number of the main database with the metadata corresponding to the first version number to obtain the first updated metadata of the main database.
8. A database management apparatus for a target information system including a main database and a plurality of target databases, the main database having a database type different from a database type of the target database, the database management apparatus comprising:
the data acquisition module is used for acquiring first updating metadata corresponding to a first database type and a target version number of the main database and a second database type of the target database to be updated, wherein the first updating metadata refers to metadata changed in the process of changing the main database from the first version number to the target version number, and the first version number refers to a version number corresponding to the current version number of the target database to be updated in the main database;
the metadata conversion module is used for converting the first updated metadata into second updated metadata corresponding to the second database type through a preset metadata mapping model according to the first database type and the second database type, and the metadata mapping model comprises a mapping relation between the metadata corresponding to the first database type and the metadata corresponding to the second database type;
And the version updating module is used for updating the second updating metadata to the target database to be updated so as to finish the version updating of the target database.
9. An electronic device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the method of any one of claims 1-7.
10. A computer storage medium having stored thereon a computer program, which when executed by a processor performs the method according to any of claims 1-7.
CN202311481796.2A 2023-11-08 2023-11-08 Database management method, device, electronic equipment and computer storage medium Pending CN117472928A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311481796.2A CN117472928A (en) 2023-11-08 2023-11-08 Database management method, device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311481796.2A CN117472928A (en) 2023-11-08 2023-11-08 Database management method, device, electronic equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN117472928A true CN117472928A (en) 2024-01-30

Family

ID=89628856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311481796.2A Pending CN117472928A (en) 2023-11-08 2023-11-08 Database management method, device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN117472928A (en)

Similar Documents

Publication Publication Date Title
CN109840429B (en) Intelligent contract deployment and calling method and device
CN110351325B (en) Data processing method and related equipment
CN109977099A (en) Database portion arranging method, user equipment, storage medium and device
US10776313B2 (en) Converting source objects to target objects
CN113886485A (en) Data processing method, device, electronic equipment, system and storage medium
CN111193622B (en) Asymmetric configuration management method, device and equipment and readable storage medium
CN112395339B (en) Intersystem data admission verification method, device, computer equipment and storage medium
CN111752916B (en) Data acquisition method and device, computer readable storage medium and electronic equipment
CN113254045A (en) Software initialization method, system and computer readable storage medium
CN115525534A (en) Test case generation method and platform based on swagger interface test
CN112395284A (en) Data processing method and device, database system, electronic equipment and storage medium
CN117472928A (en) Database management method, device, electronic equipment and computer storage medium
CN114722108A (en) Customer service data processing method and device, electronic equipment and storage medium
CN114328739A (en) Data synchronization method, data reading method, data synchronization device, data reading device, electronic equipment, storage medium and product
CN113704120A (en) Data transmission method, device, equipment and storage medium
CN114553859A (en) BMC configuration management method and device, electronic equipment and storage medium
CN113076343A (en) Data query method, device, equipment and storage medium
CN108304188B (en) Data type conversion method and terminal
CN115543485B (en) Data conversion configuration generation method, device, computer equipment and medium
CN109710293B (en) File processing method and device, electronic equipment and storage medium
CN112486556B (en) Method, system, terminal and storage medium for server to be compatible with BMC
CN116560722B (en) Operation and maintenance flow processing method and device, electronic equipment and storage medium
CN113129049B (en) File configuration method and system for model training and application
CN115269207B (en) Method and system for allocating resources to vCPE network element
CN118227234A (en) Request response method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination