Database maintenance method and related equipment

By analyzing and converting the database language, automatic update of the database is achieved, solving the problem that database maintenance in the existing technology requires a lot of manpower and consistency to be difficult to ensure, reducing the error rate and improving efficiency.

CN119938634APending Publication Date: 2025-05-06BEIJING HONGTENG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311466716.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-06
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The prior art requires a lot of manpower in database maintenance and it is difficult to ensure the consistency of each database, resulting in a high error rate.

Method used

By obtaining the update language of the first database, the table meta information is obtained, and the format template of the second database is converted to update the second database, thereby realizing automatic update of the database.

Benefits of technology

It reduces the manpower required for database maintenance, reduces the risk of errors, and ensures consistency of each database, simplifies the database update process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938634A_ABST
    Figure CN119938634A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a database maintenance method and related equipment. The database maintenance method comprises the steps of obtaining a first database language in response to updating of a first database; analyzing the first database language to obtain table element information; obtaining a predetermined format template, wherein the predetermined format template is a format template of a second database; and according to the predetermined format template, converting the table element information, and updating the second database. According to the technical scheme provided by the embodiment of the invention, only one database needs to be modified for updating and maintaining the database each time, so that a large amount of manpower is saved, and the error risk is reduced. And meanwhile, the consistency of the databases is ensured, so that the errors of the databases can be queried and modified more easily.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer and communication technology, and in particular to a database maintenance method and related equipment. Background Art

[0002] With the development of technology, in the database business, the server business needs to connect to multiple databases. Each database needs to write the SQL of the entire service. When the database needs to be updated or modified, it needs to be added or modified one by one according to the syntax of each database, which requires a lot of manpower and cannot guarantee the consistency of each database, resulting in a high error rate. Summary of the invention

[0003] The embodiments of the present application provide a database maintenance method and related equipment, which can at least to some extent overcome the problem that database maintenance in the prior art requires a lot of manpower and is prone to errors.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0005] According to one aspect of an embodiment of the present application, a database maintenance method is provided, the database maintenance method comprising: in response to an update of a first database, obtaining a first database language; parsing the first database language to obtain table meta information; obtaining a predetermined format template, the predetermined format template being a format template of a second database; and according to the predetermined format template, converting the table meta information and updating the second database.

[0006] In some embodiments of the present application, the parsing the first database language to obtain table meta information specifically includes: determining a category of the first database language; parsing the table meta information of the first database language according to the category of the first database language; and determining a specific operation category of the first database language according to the table meta information.

[0007] In some embodiments of the present application, the obtaining of a predetermined format template, wherein the predetermined format template is a format template of a second database, specifically includes: obtaining a format template corresponding to the second database; and determining a predetermined format template in the format template corresponding to the second database according to a specific operation category of the first database language.

[0008] In some embodiments of the present application, converting the table meta information according to the predetermined format template and updating the second database specifically includes: converting the table meta information into a second database language; filling the second database language into the predetermined format template and updating the second database.

[0009] In some embodiments of the present application, converting the table meta information into the second database language specifically includes: acquiring a predetermined conversion template corresponding to the second database; and converting the table meta information into the second database language according to the conversion template.

[0010] In some embodiments of the present application, converting the table meta information into a second database language specifically includes: inputting the table meta information one by one into a language conversion model, the language conversion model having multiple conversion sub-models; calling a corresponding conversion sub-model according to the second database; inputting the table meta information one by one into the corresponding conversion sub-model to obtain a corresponding second database language.

[0011] In some embodiments of the present application, the database maintenance method also includes: obtaining a table meta information sample set, the table meta information sample set including multiple table meta information samples, each of the table meta information samples having a second database language label; inputting the session feature samples into the conversion sub-model one by one to obtain the second database language result output by the conversion sub-model; updating the parameters of the conversion sub-model according to the second database language label and the second database language result until a predetermined condition is met, stopping training, and obtaining a trained conversion sub-model.

[0012] According to one aspect of an embodiment of the present application, a database maintenance device is provided, comprising: a language acquisition module, used to acquire a first database language in response to an update of a first database; a language parsing module, used to parse the first database language to obtain table meta information; a template acquisition module, used to acquire a predetermined format template, wherein the predetermined format template is a format template of a second database; and a data update module, used to transform the table meta information according to the predetermined format template and update the second database.

[0013] In some embodiments of the present application, the language parsing module specifically includes: a category determination submodule, used to determine the category of the first database language; a language parsing submodule, used to parse out the table meta information of the first database language according to the category of the first database language; and an operation category submodule, used to determine the specific operation category of the first database language according to the table meta information.

[0014] In some embodiments of the present application, the template acquisition module specifically includes: a template acquisition submodule, used to obtain the format template corresponding to the second database; a template determination submodule, used to determine a predetermined format template in the format template corresponding to the second database according to the specific operation category of the first database language.

[0015] In some embodiments of the present application, the data update module specifically includes: a language conversion submodule, used to convert the table element information into a second database language; a template filling submodule, filling the second database language into the predetermined format template to update the second database.

[0016] In some embodiments of the present application, the language conversion submodule specifically includes: a template acquisition unit, used to acquire a predetermined conversion template corresponding to the second database; and a language conversion unit, used to convert the table element information into the second database language according to the conversion template.

[0017] In some embodiments of the present application, the language conversion submodule specifically includes: a model input unit, used to input the table element information one by one into the language conversion model, and the language conversion model has multiple conversion sub-models; a model calling unit, used to call the corresponding conversion sub-model according to the second database; an information input unit, used to input the table element information one by one into the corresponding conversion sub-model to obtain the corresponding second database language.

[0018] In some embodiments of the present application, the database maintenance device further includes: a sample acquisition unit, configured to acquire a table meta information sample set, wherein the table meta information sample set includes a plurality of table meta information samples, each of the table meta information samples having a second database language tag;

[0019] A sample input unit is used to input the conversation feature samples one by one into the conversion sub-model to obtain the second database language result output by the conversion sub-model; a parameter updating unit is used to update the parameters of the conversion sub-model according to the second database language label and the second database language result until a predetermined condition is met, and the training is stopped to obtain a trained conversion sub-model.

[0020] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the database maintenance method as described in the above embodiment is implemented.

[0021] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the database maintenance method as described in the above embodiments.

[0022] In the technical solutions provided by some embodiments of the present application, after a certain database (i.e., the first database) is updated, the first database language corresponding to the first database is obtained, parsed, and the corresponding table meta information is obtained, and then the format template corresponding to the second database is obtained, and the table meta information is converted, that is, the complete SQL corresponding to the second database is obtained, and the second database is updated according to the complete SQL, that is, when the first database is updated, the SQL of the first database can be automatically converted into the SQL of other second databases through parsing and templates, thereby realizing the automatic update of the database. Each update and maintenance of the database only requires modifying one database, which saves a lot of manpower and reduces the risk of errors. At the same time, since the consistency of each database is guaranteed, it is easier to query and modify database errors.

[0023] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0025] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.

[0026] Figure 2 A flowchart of a database maintenance method provided in an embodiment of the present application is shown.

[0027] Figure 3 Shown according to Figure 2 A specific implementation flow chart of step S400 in the database maintenance method shown in the corresponding embodiment.

[0028] Figure 4 Shown according to Figure 2 Another specific implementation flow chart of the database maintenance method shown in the corresponding embodiment.

[0029] Figure 5 A schematic diagram of the structure of a database maintenance device provided in an embodiment of the present application is shown.

[0030] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0032] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0033] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0034] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0035] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.

[0036] like Figure 1 As shown, the system architecture may include terminal devices (such as Figure 1 The embodiment of the present invention is a schematic diagram of a mobile phone 101, a tablet computer 102, a portable computer 103, a desktop computer, etc., a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the terminal device and the server 105. The network 104 may include various connection types, such as a wired communication link, a wireless communication link, etc.

[0037] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.

[0038] The user can use the terminal device to interact with the server 105 through the network 104 to receive or send messages, etc. The server 105 can be a server that provides various services. For example, the user uses the terminal device 103 (or the terminal device 101 or 102) to upload the first database language to the server 105, and the server 105 can parse the first database language to obtain the table meta information; obtain a predetermined format template, which is the format template of the second database; according to the predetermined format template, the table meta information is converted to update the second database.

[0039] It should be noted that the database maintenance method provided in the embodiment of the present application is generally executed by the server 105, and accordingly, the database maintenance device is generally set in the server 105. However, in other embodiments of the present application, the terminal device may also have similar functions as the server, so as to execute the database maintenance solution provided in the embodiment of the present application.

[0040] The implementation details of the technical solution of the embodiment of the present application are described in detail below:

[0041] Figure 2 A flowchart of a database maintenance method according to an embodiment of the present application is shown. The database maintenance method can be executed by a server, which can be Figure 1 Refer to the server shown in Figure 2 As shown, the database maintenance method at least includes:

[0042] Step S100: in response to the update of the first database, obtaining the first database language.

[0043] Step S200: parsing the first database language to obtain table metadata.

[0044] Step S300: obtaining a predetermined format template, where the predetermined format template is a format template of a second database.

[0045] Step S400: transform the table element information according to the predetermined format template and update the second database.

[0046] In an embodiment of the present application, after a certain database (i.e., the first database) is updated, the first database language corresponding to the first database is obtained, parsed, and the corresponding table meta information is obtained, and then the format template corresponding to the second database is obtained, and the table meta information is converted, that is, the complete SQL corresponding to the second database is obtained, and the second database is updated according to this complete SQL, that is, when a first database is updated, the SQL of the first database can be automatically converted into the SQL of other second databases through parsing and templates, thereby realizing automatic update of the database, and each update and maintenance of the database only needs to modify one database, which saves a lot of manpower and reduces the risk of errors. At the same time, since the consistency of each database is guaranteed, it is easier to query and modify database errors.

[0047] In step S100, after a certain database (ie, the first database) is updated, the first database language corresponding to the first database is obtained. Specifically, only the first database language of the updated part may be obtained.

[0048] In step S200, the first database language is parsed to obtain the most basic information of the table structure, namely, table meta-information.

[0049] Specifically, in some embodiments, the specific implementation of step S200 can refer to the following embodiments. Figure 2 The detailed description of step S200 in the database maintenance method shown in the corresponding embodiment, in the database maintenance method, step S200 may include the following steps:

[0050] A category of the first database language is determined.

[0051] According to the category of the first database language, table meta information of the first database language is parsed.

[0052] A specific operation category of the first database language is determined according to the table meta information.

[0053] In this embodiment, the category of the first database language is first identified to determine whether it is a data definition language or a data manipulation language, and then the most basic information of the table structure, that is, the table meta information, is parsed based on the determined language category. Specifically, the table meta information may include table name, field name, field type, field annotation information, etc. At the same time, the specific operation category of the first database language can be determined based on the table meta information, and the specific operation category may be at least one of create, insert, update, delete, index, etc.

[0054] For example, for a table creation statement:

[0055] CREATE TABLE admin(

[0056] ˋidˋint NOT NULL AUTO_INCREMENT COMMENT'Auto-increment primary key',

[0057] ˋuidˋint DEFAULT NULL COMMENT'user id',

[0058] ˋuser_nameˋvarchar(255)DEFAULT NULL COMMENT'Account',

[0059] ˋsourceˋtinyint(1)DEFAULT'1'COMMENT'Source (1 system organization, 2 third-party organization)',

[0060] ˋuser_typeˋenum('1','2')DEFAULT NULL COMMENT'1Super administrator 2Ordinary administrator',

[0061] PRIMARY KEY(ˋidˋ)

[0062] )ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COMMENT 'user table';

[0063] The following table meta information can be parsed: the table name is admin; the character type is utf8mb3; the comment information is the user table. The primary key information includes the field name, field type, primary key strategy, and comment information. Among them, the field name is id; the field type is int; the primary key strategy is auto-increment, and it is not allowed to be empty; the comment information is auto-increment primary key. The field information includes the field name, field type, default value, field type length, enumeration value, and comment information.

[0064] Among them, the first field includes the field name uid; the field type is int; the default value is null; the comment information is user id. The next field includes the field name user_name; the field type is varchar; the field type length is 255; the constraint is to allow null; the comment information is account number. The next field includes the field name source; the field type is tinyint; the default value is 1; the comment information is source (1 system organization, 2 third-party organization). The last field includes the field name user_type; the field type is enum; the enumeration value is 1,2; the comment information is 1 super administrator 2 ordinary administrator.

[0065] In step S300, a format template corresponding to the second database is obtained to facilitate filling.

[0066] Specifically, in some embodiments, the specific implementation of step S300 can refer to the following embodiments. Figure 2 The detailed description of step S300 in the database maintenance method shown in the corresponding embodiment, in the database maintenance method, step S300 may include the following steps:

[0067] Get the format template corresponding to the second database.

[0068] According to the specific operation category of the first database language, a predetermined format template is determined in the format templates corresponding to the second database.

[0069] In the embodiment of the present application, all format templates corresponding to the second database are first obtained, and then a corresponding format template is selected according to a specific operation category as a predetermined format template.

[0070] The data definition language is used to define the relationship model, delete the relationship, modify the relationship model, and create various objects in the database, such as tables, clusters, indexes, views, functions, stored procedures, and triggers, etc. It consists of four syntaxes: CREATE, ALTER, DROP, and TRUNCATE. The data manipulation language is mainly used to insert, delete, and modify tuples. It mainly consists of insert, update, and delete syntax. Since different types of languages ​​use different syntaxes, their corresponding formats are also different. Therefore, it is necessary to determine the syntax used by the first database language, that is, the specific operation category, in order to determine the specific syntax format. There are certain differences in the table creation statements for each type of data. For example, the primary key of the DAMO database uses IDENTITY to achieve increment, while the Renmin University of China Jincang database uses SERIAL to achieve increment. At the same time, OceanBase uses AUTO_INCREMENT, which is consistent with MySQL, to achieve increment.

[0071] In step S400, the aforementioned table element information is converted, and the second database is updated using a predetermined format template.

[0072] Specifically, in some embodiments, the specific implementation of step S400 can be found in Figure 3 . Figure 3 is based on Figure 2 The detailed description of step S400 in the database maintenance method shown in the corresponding embodiment, in the database maintenance method, step S400 may include the following steps:

[0073] Step S410: converting the table metadata into a second database language.

[0074] Step S420: Fill the second database language into the predetermined format template to update the second database.

[0075] In an embodiment of the present application, after the parsed table element information is converted into the second database language, it is filled into the corresponding predetermined format template to obtain a complete database SQL, and the second database can be updated based on the complete database SQL.

[0076] In step S410, there are multiple ways to convert the table element information into the second database language. The language conversion can be performed according to a pre-configured conversion template, or the language conversion can be performed through a neural network model.

[0077] Specifically, in some embodiments, the specific implementation of step S410 can refer to the following embodiments. Figure 3 The detailed description of step S410 in the database maintenance method shown in the corresponding embodiment, in the database maintenance method, step S410 may include the following steps:

[0078] Acquire a predetermined conversion template corresponding to the second database;

[0079] The table meta information is converted into a second database language according to the conversion template.

[0080] In the embodiment of the present application, a predetermined conversion template is used for conversion. The predetermined conversion template is pre-configured to convert the table meta information one by one into the database language corresponding to the second database. The database's float type, enum type, and char type all have database characteristics, so we need to perform special type conversions according to the target database. In addition to the fields that need to be converted, this situation also exists with index creation, comment information, etc. This step is mainly to fill in various basic template information. If the original sql is a create table statement, the create table template corresponding to the target database is filled in, and differential type conversion is used to complete the filling of differential information, such as field information, index information, and comment information.

[0081] Specifically, in other embodiments, the specific implementation of step S410 can refer to the following embodiments. Figure 3 The detailed description of step S410 in the database maintenance method shown in the corresponding embodiment, in the database maintenance method, step S410 may include the following steps:

[0082] The table element information is input into the language conversion model one by one, and the language conversion model has a plurality of conversion sub-models.

[0083] According to the second database, the corresponding conversion sub-model is called.

[0084] The table element information is input into the corresponding conversion sub-model one by one to obtain the corresponding second database language.

[0085] In the embodiment of the present application, a neural network model is used for conversion. Since different databases use different syntaxes, etc., different conversion sub-models need to be prepared for different databases. In the process of use, the corresponding conversion sub-model is called according to the second database. After the table meta information is input into the language conversion model one by one, the corresponding conversion sub-model is called according to the target database to be converted, that is, the second database, and then the table meta information is input into the corresponding conversion sub-model one by one to obtain the corresponding second database language.

[0086] Specifically, Figure 4 As shown, the training method of each conversion sub-model of the above-mentioned language conversion model includes:

[0087] Step S402: obtaining a table meta information sample set, wherein the table meta information sample set includes a plurality of table meta information samples, and each of the table meta information samples carries a second database language tag.

[0088] Step S404: input the conversation feature samples one by one into the conversion sub-model to obtain the second database language result output by the conversion sub-model.

[0089] Step S406, updating the parameters of the conversion sub-model according to the second database language label and the second database language result until a predetermined condition is met, stopping the training, and obtaining a trained conversion sub-model.

[0090] In this embodiment, in order to analyze and learn the database language, the convolutional neural network can well capture the semantic features contained in the database language itself, mine the correlation between the database languages, and has strong generalization ability and robustness. When training, the conditions for stopping training, that is, the conditions for model training, can be multiple, and the specific embodiments can be referred to as follows.

[0091] Specifically, in some embodiments, the specific implementation of step S406 can refer to the following embodiments. Figure 4 The detailed description of step S406 in the database maintenance method shown in the corresponding embodiment, in the database maintenance method, step S406 may include the following steps:

[0092] If, in the table meta information sample set, less than a predetermined number of table meta information samples are input into the conversion sub-model and the output second database language result is consistent with the second database language label, the parameters of the conversion sub-model are updated.

[0093] If, in the table meta information sample set, more than a predetermined number of table meta information samples are input into the conversion sub-model and the output second database language result is consistent with the second database language label, the predetermined end condition is met, the training is ended, and a trained conversion sub-model is obtained.

[0094] Specifically, in other embodiments, the specific implementation of step S406 can refer to the following embodiments. Figure 4 The detailed description of step S406 in the database maintenance method shown in the corresponding embodiment, in the database maintenance method, step S406 may include the following steps:

[0095] A loss function is determined according to the second database language label of the table meta-information sample and the corresponding second database language result.

[0096] The parameters of the conversion sub-model are updated according to the loss function until a predetermined end condition is reached, and the training is terminated to obtain a trained conversion sub-model.

[0097] In this embodiment, the loss function reaching a predetermined end condition may be that the loss function converges or the loss function is less than a predetermined loss (eg, 0.001).

[0098] In the above embodiment, log text recognition is performed through a neural network model obtained through multiple trainings to obtain corresponding judgment results. The neural network model is obtained through multiple trainings. The more samples it trains, the more accurate the results obtained. It basically does not require maintenance during operation, which also reduces maintenance costs, improves the efficiency and accuracy of traffic identification, and reduces the false alarm rate.

[0099] It should be noted that, in some other embodiments, the table element information sample set may also be divided into a training set, a test set, and a validation set for training, and the K-fold cross validation fold is taken.

[0100] In step S420, the second database language is filled into the corresponding predetermined format template to obtain a complete database SQL, and update operations such as overwriting, adding, deleting and modifying are performed on the second database according to the complete database SQL, thereby completing the update of the second database.

[0101] The embodiment of the present application converts the database language so that after maintaining one database (i.e., the first database), other databases (i.e., the second database) can be automatically converted according to the relevant database language of the maintained database, so that they can be automatically maintained. Therefore, when using the embodiment of the present application, it is no longer necessary to write multiple database SQLs, only one database needs to be written, which reduces a huge workload. At the same time, due to the automatic conversion and update of the database language, it is possible to uniformly maintain multiple database SQLs, avoiding the functional impact caused by omitting a certain database, and also quickly expanding other arbitrary types of databases.

[0102] The following describes an apparatus embodiment of the present application, which can be used to execute the database maintenance method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the database maintenance method of the present application.

[0103] Figure 5 A block diagram of a database maintenance device according to an embodiment of the present application is shown.

[0104] Reference Figure 5 As shown, a database maintenance device 500 according to an embodiment of the present application includes: a language acquisition module 510, a language parsing module 520, a template acquisition module 530 and a data update module 540.

[0105] Among them, the language acquisition module 510 is used to acquire the first database language in response to the update of the first database; the language parsing module 520 is used to parse the first database language to obtain table meta information; the template acquisition module 530 is used to acquire a predetermined format template, and the predetermined format template is a format template of the second database; the data update module 540 is used to transform the table meta information according to the predetermined format template and update the second database.

[0106] In some embodiments of the present application, the language parsing module specifically includes: a category determination submodule, used to determine the category of the first database language; a language parsing submodule, used to parse out the table meta information of the first database language according to the category of the first database language; and an operation category submodule, used to determine the specific operation category of the first database language according to the table meta information.

[0107] In some embodiments of the present application, the template acquisition module specifically includes: a template acquisition submodule, used to obtain the format template corresponding to the second database; a template determination submodule, used to determine a predetermined format template in the format template corresponding to the second database according to the specific operation category of the first database language.

[0108] In some embodiments of the present application, the data update module specifically includes: a language conversion submodule, used to convert the table element information into a second database language; a template filling submodule, filling the second database language into the predetermined format template to update the second database.

[0109] In some embodiments of the present application, the language conversion submodule specifically includes: a template acquisition unit, used to acquire a predetermined conversion template corresponding to the second database; and a language conversion unit, used to convert the table element information into the second database language according to the conversion template.

[0110] In some embodiments of the present application, the language conversion submodule specifically includes: a model input unit, used to input the table element information one by one into the language conversion model, and the language conversion model has multiple conversion sub-models; a model calling unit, used to call the corresponding conversion sub-model according to the second database; an information input unit, used to input the table element information one by one into the corresponding conversion sub-model to obtain the corresponding second database language.

[0111] In some embodiments of the present application, the database maintenance device also includes: a sample acquisition unit, used to acquire a table meta information sample set, the table meta information sample set includes multiple table meta information samples, each of the table meta information samples has a second database language label; a sample input unit, used to input session feature samples one by one into the conversion sub-model to obtain the second database language result output by the conversion sub-model; a parameter updating unit, used to update the parameters of the conversion sub-model according to the second database language label and the second database language result until a predetermined condition is met, stop training, and obtain a trained conversion sub-model.

[0112] In the technical solutions provided by some embodiments of the present application, after a certain database (i.e., the first database) is updated, the first database language corresponding to the first database is obtained, parsed, and the corresponding table meta information is obtained, and then the format template corresponding to the second database is obtained, and the table meta information is converted, that is, the complete SQL corresponding to the second database is obtained, and the second database is updated according to the complete SQL, that is, when the first database is updated, the SQL of the first database can be automatically converted into the SQL of other second databases through parsing and templates, thereby realizing the automatic update of the database. Each update and maintenance of the database only requires modifying one database, which saves a lot of manpower and reduces the risk of errors. At the same time, since the consistency of each database is guaranteed, it is easier to query and modify database errors.

[0113] The embodiment of the present application converts the database language so that after maintaining one database (i.e., the first database), other databases (i.e., the second database) can be automatically converted according to the relevant database language of the maintained database, so that they can be automatically maintained. Therefore, when using the embodiment of the present application, it is no longer necessary to write multiple database SQLs, only one database needs to be written, which reduces a huge workload. At the same time, due to the automatic conversion and update of the database language, it is possible to uniformly maintain multiple database SQLs, avoiding the functional impact caused by omitting a certain database, and also quickly expanding other arbitrary types of databases.

[0114] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0115] It should be noted that Figure 6 The computer system of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0116] like Figure 6 As shown, the computer system includes a central processing unit (CPU) 1801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1802 or the program loaded from the storage part 1808 to the random access memory (RAM) 1803, such as executing the method described in the above embodiment. In RAM 1803, various programs and data required for system operation are also stored. CPU 1801, ROM 1802 and RAM 1803 are connected to each other through bus 1804. Input / output (I / O) interface 1805 is also connected to bus 1804.

[0117] The following components are connected to the I / O interface 1805: an input section 1806 including a keyboard, a mouse, etc.; an output section 1807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1808 including a hard disk, etc.; and a communication section 1809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1809 performs communication processing via a network such as the Internet. A drive 1810 is also connected to the I / O interface 1805 as needed. A removable medium 1811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1810 as needed so that a computer program read therefrom is installed into the storage section 1808 as needed.

[0118] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1809, and / or installed from a removable medium 1811. When the computer program is executed by a central processing unit (CPU) 1801, various functions defined in the system of the present application are executed.

[0119] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0120] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0121] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0122] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.

[0123] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0124] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0125] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0126] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A database maintenance method, characterized in that: The database maintenance method comprises: In response to an update of the first database, obtaining a first database language; Parsing the first database language to obtain table meta information; Acquire a predetermined format template, where the predetermined format template is a format template of a second database; According to the predetermined format template, the table element information is converted and the second database is updated.

2. The database maintenance method according to claim 1, characterized in that: The step of parsing the first database language to obtain table meta information specifically includes: determining a category of the first database language; parsing table meta information of the first database language according to the category of the first database language; A specific operation category of the first database language is determined according to the table meta information.

3. The database maintenance method according to claim 2, characterized in that: The obtaining of a predetermined format template, wherein the predetermined format template is a format template of the second database, specifically includes: Obtaining a format template corresponding to the second database; According to the specific operation category of the first database language, a predetermined format template is determined in the format templates corresponding to the second database.

4. The database maintenance method according to claim 1, characterized in that: The converting the table meta information according to the predetermined format template and updating the second database specifically includes: Converting the table meta information into a second database language; The second database language is filled into the predetermined format template, and the second database is updated.

5. The database maintenance method according to claim 4, characterized in that: The converting the table meta information into a second database language specifically includes: Acquire a predetermined conversion template corresponding to the second database; The table meta information is converted into a second database language according to the conversion template.

6. The database maintenance method according to claim 4, characterized in that: The converting the table meta information into a second database language specifically includes: Inputting the table element information one by one into a language conversion model, wherein the language conversion model has a plurality of conversion sub-models; According to the second database, calling a corresponding conversion sub-model; The table element information is input into the corresponding conversion sub-model one by one to obtain the corresponding second database language.

7. The database maintenance method according to claim 6, characterized in that: The database maintenance method further comprises: Acquire a table meta information sample set, wherein the table meta information sample set includes a plurality of table meta information samples, each of the table meta information samples has a second database language tag; Input the conversation feature samples one by one into the conversion sub-model to obtain the second database language result output by the conversion sub-model; According to the second database language label and the second database language result, the parameters of the conversion sub-model are updated until a predetermined condition is met, and the training is stopped to obtain a trained conversion sub-model.

8. A database maintenance device, characterized in that: The database maintenance device comprises: A language acquisition module, configured to acquire the language of the first database in response to an update of the first database; A language parsing module, used for parsing the first database language to obtain table meta-information; A template acquisition module, used to acquire a predetermined format template, wherein the predetermined format template is a format template of the second database; A data updating module is used to transform the table element information according to the predetermined format template and update the second database.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the database maintenance method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the database maintenance method according to any one of claims 1 to 7.