Automatic database management method, device and system

By obtaining predefined information of the database, and using Dart asynchronous programming model and concurrent operation strategies to perform database management operations, the problem of irregular writing of database management operation codes in the existing technology is solved, and efficient , accurate database management.

CN119441181APending Publication Date: 2025-02-14SHENZHEN GREEN CONNECTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411483984.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing technology has problems such as irregular or error-based code writing and time-consuming in database management operations, and third-party code tools are not universal in cross-platform project development, resulting in high management efficiency and cost.

Method used

By obtaining predefined information of the database, including data model and business logic, the operation code is generated for the database, and based on the Dart asynchronous programming model and concurrent operation strategy, the operation code is called asynchronously to perform database management operations.

Benefits of technology

It improves the accuracy and efficiency of writing database operation code, reduces database management and maintenance costs, simplifies management processes, and improves the efficiency and accuracy of database management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441181A_ABST
    Figure CN119441181A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of database management, and discloses an automatic database management method, device and system, and the method comprises the steps: obtaining predefined information corresponding to at least one database; the predefined information comprises a data model and / or business logic of the database; based on the predefined information corresponding to each database, determining a management demand for the database; generating an operation code aiming at the database according to the management requirement aiming at the database; and asynchronously calling the operation code based on an asynchronous operation object of the Dart asynchronous programming model and / or a preset concurrent operation strategy, and executing database management operation. Visibly, the database operation code can be intelligently generated based on the data model and / or the service logic of the database, and a developer does not need to manually write the code, so that the database management efficiency, convenience and accuracy are improved while the writing accuracy and efficiency of the database operation code are improved; and the database management and maintenance cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database management, and in particular to a method, device and system for automatic database management. Background Art

[0002] In the prior art, when a user needs to perform management operations on a database, the user needs to write corresponding operation codes, and the code writing is mostly divided into two ways: one way is for the developer to manually write lengthy operation codes, but the codes written in this way may have problems such as non-standardization or errors, and the operation takes a long time; the other way is to use a third-party code tool to write the code, but the third-party code tools used in this way are usually only used on specific platforms and are not universal in cross-platform project development.

[0003] Therefore, it is particularly important to propose a technical solution that can improve the accuracy and efficiency of writing database operation codes while improving the management efficiency, convenience and accuracy of the database to reduce the management and maintenance costs of the database. Summary of the invention

[0004] The present invention provides a database automation management method, device and system, which can improve the accuracy and efficiency of writing database operation codes while improving the management efficiency, convenience and accuracy of the database, which is conducive to reducing the management and maintenance costs of the database.

[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a method for automatic database management, the method comprising:

[0006] Acquire predefined information corresponding to at least one database; the predefined information corresponding to each database includes a data model of the database and / or a business logic corresponding to the database;

[0007] Based on the predefined information corresponding to each of the databases, generate an operation code for the database;

[0008] Based on the asynchronous operation object of the Dart asynchronous programming model and / or a pre-set concurrent operation strategy, the operation code is asynchronously called to perform the database management operation.

[0009] As an optional implementation manner, in the first aspect of the present invention, generating an operation code for each database based on the predefined information corresponding to the database includes:

[0010] For each of the databases, based on predefined information corresponding to the database, determine management requirements for the database; the management requirements include data management requirements and / or database migration requirements;

[0011] For each of the databases, an operation code for the database is generated according to management requirements for the database.

[0012] As an optional implementation manner, in the first aspect of the present invention, for each of the databases, determining the management requirements for the database based on the predefined information corresponding to the database includes:

[0013] When it is detected that there is a data management request for the database, determining, according to predefined information corresponding to the database, that the management demand for the database includes a data management demand regarding the data management request; wherein the data management demand includes a combination of one or more of a data query demand, a data insertion demand, a data update demand and a data deletion demand; and / or,

[0014] When the predefined information includes the data model, obtaining a preset migration strategy corresponding to the database, and monitoring the current data model of the database;

[0015] According to the data model and the current data model, determining whether the database meets the migration condition corresponding to the preset migration strategy;

[0016] When it is determined that the database meets the migration condition corresponding to the preset migration strategy, it is determined that the management requirement for the database includes a database migration requirement.

[0017] As an optional implementation manner, in the first aspect of the present invention, for each of the databases, judging whether the database satisfies the migration condition corresponding to the preset migration strategy according to the data model and the current data model includes:

[0018] Comparing the data model with the current data model to obtain a model comparison result;

[0019] When the model comparison result indicates that the data model does not match the current data model, determining that the database satisfies the migration condition corresponding to the preset migration strategy; or

[0020] Detecting whether the version corresponding to the current data model is higher than the version corresponding to the data model;

[0021] When it is detected that the version corresponding to the current data model is higher than the version corresponding to the data model, it is determined that the database meets the migration condition corresponding to the preset migration strategy.

[0022] As an optional implementation manner, in the first aspect of the present invention, for each of the databases, generating an operation code for the database according to the management requirements for the database includes:

[0023] When the management requirements include the data management requirements, generating Dart management code for the data management requirements of the database according to the data model of the database and the business logic corresponding to the database;

[0024] Generate SQL management code for the database according to the Dart management code;

[0025] Based on a preset code optimization strategy, the SQL management code is optimized to obtain a management operation code for the database;

[0026] When the management requirement includes the database migration requirement, determining a model difference corresponding to the database according to the data model and the current data model;

[0027] According to the preset migration strategy corresponding to the database, a migration script generation function corresponding to the database migration requirement is obtained;

[0028] Based on the migration script generation function, a Dart migration script for the database is generated according to the model differences as the migration operation code for the database;

[0029] The operation code includes the management operation code and / or the migration operation code.

[0030] As an optional implementation, in the first aspect of the present invention, before the asynchronous operation object based on the Dart asynchronous programming model and / or the pre-set concurrent operation strategy asynchronously calls the operation code to perform the database management operation, the method further includes:

[0031] Determining whether the operation code for each of the databases satisfies a preset type safety condition;

[0032] When it is determined that the operation code for each of the databases meets the type safety condition, triggering the execution of the asynchronous operation object based on the Dart asynchronous programming model and / or the pre-set concurrent operation strategy, asynchronously calling the operation code, and performing the database management operation;

[0033] The step of determining whether the operation code for each database satisfies a preset type safety condition includes:

[0034] For each of the databases, determining whether a first data type defined by the database matches a second data type required to be operated by the operation code;

[0035] For each of the databases, when it is determined that the first data type defined by the database matches the second data type required to be operated by the operation code, it is determined that the operation code meets a preset type safety condition.

[0036] As an optional implementation, in the first aspect of the present invention, the asynchronous operation object based on the Dart asynchronous programming model and / or the pre-set concurrent operation strategy asynchronously calls the operation code to perform the database management operation, including:

[0037] Based on the asynchronous operation object of the Dart asynchronous programming model and / or a pre-set concurrent operation strategy, the operation code is asynchronously called to perform database management operations; wherein the concurrent operation strategy includes at least one of a transaction management mechanism, a lock mechanism, an optimistic concurrency control mechanism, a queue management mechanism and a transaction retry mechanism.

[0038] A second aspect of the present invention discloses a database automation management device, the device comprising:

[0039] An acquisition module, used to acquire predefined information corresponding to at least one database; the predefined information corresponding to each database includes a data model of the database and / or a business logic corresponding to the database;

[0040] A determination module, configured to determine, for each of the databases, a management requirement for the database based on predefined information corresponding to the database; the management requirement includes a data management requirement and / or a database migration requirement;

[0041] A generating module, used for generating, for each of the databases, an operation code for the database according to the management requirements for the database;

[0042] The calling module is used to asynchronously call the operation code based on the asynchronous operation object of the Dart asynchronous programming model and / or a pre-set concurrent operation strategy to perform database management operations.

[0043] As an optional implementation, in the second aspect of the present invention, for each of the databases, the specific manner in which the determination module determines the management requirements for the database based on the predefined information corresponding to the database includes:

[0044] When it is detected that there is a data management request for the database, determining, according to predefined information corresponding to the database, that the management demand for the database includes a data management demand regarding the data management request; wherein the data management demand includes a combination of one or more of a data query demand, a data insertion demand, a data update demand and a data deletion demand; and / or,

[0045] When the predefined information includes the data model, obtaining a preset migration strategy corresponding to the database, and monitoring the current data model of the database;

[0046] According to the data model and the current data model, determining whether the database meets the migration condition corresponding to the preset migration strategy;

[0047] When it is determined that the database meets the migration condition corresponding to the preset migration strategy, it is determined that the management requirement for the database includes a database migration requirement.

[0048] As an optional implementation manner, in the second aspect of the present invention, for each of the databases, the specific manner in which the determination module determines whether the database satisfies the migration condition corresponding to the preset migration strategy according to the data model and the current data model includes:

[0049] Comparing the data model with the current data model to obtain a model comparison result;

[0050] When the model comparison result indicates that the data model does not match the current data model, determining that the database satisfies the migration condition corresponding to the preset migration strategy; or

[0051] Detecting whether the version corresponding to the current data model is higher than the version corresponding to the data model;

[0052] When it is detected that the version corresponding to the current data model is higher than the version corresponding to the data model, it is determined that the database meets the migration condition corresponding to the preset migration strategy.

[0053] As an optional implementation, in the second aspect of the present invention, for each of the databases, the specific manner in which the generating module generates the operation code for the database according to the management requirements for the database includes:

[0054] When the management requirements include the data management requirements, generating Dart management code for the data management requirements of the database according to the data model of the database and the business logic corresponding to the database;

[0055] Generate SQL management code for the database according to the Dart management code;

[0056] Based on a preset code optimization strategy, the SQL management code is optimized to obtain a management operation code for the database;

[0057] When the management requirement includes the database migration requirement, determining a model difference corresponding to the database according to the data model and the current data model;

[0058] According to the preset migration strategy corresponding to the database, a migration script generation function corresponding to the database migration requirement is obtained;

[0059] Based on the migration script generation function, a Dart migration script for the database is generated according to the model differences as the migration operation code for the database;

[0060] The operation code includes the management operation code and / or the migration operation code.

[0061] As an optional implementation, in the second aspect of the present invention, for each of the databases, the generation module generates a Dart management code for the data management requirements of the database according to the data model of the database and the business logic corresponding to the database. The specific manner includes:

[0062] Obtain a pre-built build management code generator; wherein the management code generator is built based on a Dart preset function;

[0063] Based on the management code generator, Dart code that meets the data management requirements of the database is generated according to the data model of the database and the business logic corresponding to the database;

[0064] Based on the asynchronous operation object of the Dart asynchronous programming model, the Dart code is optimized to obtain the Dart management code.

[0065] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0066] A judgment module is used to determine whether the operation code for each of the databases satisfies a preset type safety condition before the calling module asynchronously calls the operation code based on the asynchronous operation object of the Dart asynchronous programming model and / or the preset concurrent operation strategy to perform the database management operation; when it is determined that the operation code for each of the databases satisfies the type safety condition, the calling module is triggered to execute the asynchronous operation object based on the Dart asynchronous programming model and / or the preset concurrent operation strategy, asynchronously call the operation code, and perform the database management operation;

[0067] The specific manner in which the judgment module judges whether the operation code for each database satisfies the preset type safety condition includes:

[0068] For each of the databases, determining whether a first data type defined by the database matches a second data type required to be operated by the operation code;

[0069] For each of the databases, when it is determined that the first data type defined by the database matches the second data type required to be operated by the operation code, it is determined that the operation code meets a preset type safety condition.

[0070] As an optional implementation, in the second aspect of the present invention, the concurrent operation strategy includes at least one of a transaction management mechanism, a lock mechanism, an optimistic concurrency control mechanism, a queue management mechanism, and a transaction retry mechanism.

[0071] The third aspect of the present invention discloses another database automatic management device, the device comprising:

[0072] A memory storing executable program code;

[0073] a processor coupled to the memory;

[0074] The processor calls the executable program code stored in the memory to execute part or all of the steps of the database automatic management method disclosed in the first aspect of the present invention.

[0075] The fourth aspect of the present invention discloses a database automation management system, the system includes a network attached storage device and an electronic device, the electronic device is communicatively connected to the network attached storage device, and the electronic device accesses the network attached storage device through a preset application, and the preset application is used to execute part or all of the steps of the database automation management method disclosed in the first aspect of the present invention.

[0076] The fifth aspect of the present invention discloses a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute part or all of the steps of the database automation management method disclosed in the first aspect of the present invention.

[0077] Compared with the prior art, the present invention has the following beneficial effects:

[0078] The present invention can first obtain predefined information corresponding to at least one database, then generate operation codes for each database based on the predefined information, and then call the above operation codes based on a preset asynchronous operation strategy to perform database management operations. It can intelligently generate database operation codes based on the data model and / or business logic of the database, without the need for developers to manually write codes. While improving the efficiency of database development, it reduces the complexity and error possibility of writing database operation codes, thereby improving the accuracy and efficiency of writing database operation codes while improving the execution accuracy of database management operations, thereby improving the management efficiency, convenience and accuracy of the database, which is conducive to simplifying the management and maintenance process of the database, and is conducive to reducing the management and maintenance costs of the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0080] Figure 1 It is a flowchart of a database automation management method disclosed in an embodiment of the present invention;

[0081] Figure 2 It is a flowchart of another database automation management method disclosed in an embodiment of the present invention;

[0082] Figure 3 It is a structural schematic diagram of a database automatic management device disclosed in an embodiment of the present invention;

[0083] Figure 4 It is a structural schematic diagram of another database automatic management device disclosed in an embodiment of the present invention;

[0084] Figure 5 It is a structural schematic diagram of another database automatic management device disclosed in an embodiment of the present invention;

[0085] Figure 6 It is a structural schematic diagram of a database automation management system disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0086] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0087] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0088] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0089] The present invention discloses a method, device and system for automatic management of a database, which can first obtain predefined information corresponding to at least one database, then generate an operation code for each database based on the predefined information, and then call the operation code based on a preset asynchronous operation strategy to perform database management operations. The operation code of the database can be intelligently generated based on the data model and / or business logic of the database, without the need for developers to manually write codes, thereby improving the efficiency of database development while reducing the complexity and error possibility of writing database operation codes, thereby improving the accuracy and efficiency of writing database operation codes while improving the execution accuracy of database management operations, thereby improving the management efficiency, convenience and accuracy of the database, which is conducive to simplifying the management and maintenance process of the database, and is conducive to reducing the management and maintenance costs of the database. The following is a detailed description.

[0090] Embodiment 1

[0091] See also Figure 1 , Figure 1 1 is a flow chart of a method for automatic database management disclosed in an embodiment of the present invention. Figure 1 The described database automation management method can be applied to a database automation management device, which may include one of an automation management device, an automation management terminal, an automation management system and a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiments of the present invention; the method can also be applied to electronic devices with different operating systems, further, the electronic device can be connected to NAS (Network Attached Storage), and further, the electronic device can access the network attached storage device through a preset application, which is not limited in the embodiments of the present invention. Figure 1 As shown, the database automatic management method may include the following operations:

[0092] 101. Obtain predefined information corresponding to at least one database.

[0093] In an embodiment of the present invention, the predefined information corresponding to each database includes the data model of the database and / or the business logic corresponding to the database; wherein the business logic corresponding to each database can be used to represent the specific logic of the basic management operations corresponding to the database and / or the specific logic of the database operations corresponding to the business functions that the database needs to implement; wherein the basic management operations may include at least one of query operations, insert operations, update operations and delete operations.

[0094] In the embodiment of the present invention, for example, it is assumed that the method can be applied to a user management system, and the user management system needs to implement the functions of user registration, updating user information and deleting users, and the business logic of user registration may include verifying user input, ensuring that the user name is unique, and then inserting the user information into the database; the business logic of updating user information may include updating user information according to the user ID; the business logic of deleting a user may include deleting the user record according to the user ID, which is not limited in the embodiment of the present invention.

[0095] 102. For each database, determine management requirements for the database based on predefined information corresponding to the database.

[0096] In an embodiment of the present invention, management requirements include data management requirements and / or database migration requirements; wherein, data management requirements can be used to indicate the need to manage data stored in a database (such as query, insert, update, delete); database migration requirements can be used to indicate the need to migrate data stored in a database to a target database (such as a new version of a database, a database with a new data model), which is not limited in the embodiment of the present invention.

[0097] 103. For each database, an operation code for the database is generated according to management requirements for the database.

[0098] In the embodiment of the present invention, the operation code for the database is an operation code that matches the above-mentioned management requirements; illustratively, when the management requirements include data query requirements, the operation code includes a query operation code, which is not limited in the embodiment of the present invention.

[0099] In the embodiment of the present invention, optionally, after step 103, the method may further generate comments corresponding to the above operation code, which is not limited in the embodiment of the present invention.

[0100] 104. Based on the asynchronous operation objects of the Dart asynchronous programming model and / or pre-set concurrent operation strategies, asynchronously call the operation code to perform database management operations.

[0101] In the embodiment of the present invention, the database management operation may include the above-mentioned basic management operation and / or database migration operation; further, the database management operation may also include business operations corresponding to the business logic, which is not limited in the embodiment of the present invention.

[0102] In an embodiment of the present invention, optionally, the pre-set asynchronous operation strategy can be an asynchronous operation strategy pre-set in the automation management abstraction layer, which is not limited in the embodiment of the present invention; optionally, the automation management abstraction layer can be built based on Dart; further optionally, the operations of step 101-step 103 can be performed based on the automation management abstraction layer, which is not limited in the embodiment of the present invention; further optionally, the automation management abstraction layer can be integrated in the Dart language environment to support running on multiple platforms, and exemplarily, the platform can include Flutter, Web, and command line tools, which are not limited in the embodiment of the present invention; further optionally, the automation management abstraction layer can set an adapter mode to support multiple database backends, such as: SQLite, and further, the interface corresponding to the automation management abstraction layer can be set so that the interface can be called on different platforms to manage the database, which is not limited in the embodiment of the present invention. In this way, the automation management abstraction layer can run across platforms, improve the portability of the code, and improve the application flexibility and application uniformity of the automation management abstraction layer, thereby improving the management flexibility and management efficiency of the database.

[0103] It can be seen that the method described in the embodiment of the present invention can first obtain the predefined information corresponding to at least one database, then generate the operation code for each database based on the predefined information, and then call the above operation code based on the preset asynchronous operation strategy to perform the database management operation, and can intelligently generate the database operation code based on the data model and / or business logic of the database, without the need for developers to manually write code, while improving the efficiency of database development, reducing the complexity and error possibility of the database operation code, so that while improving the accuracy and efficiency of the database operation code, the execution accuracy of the database management operation can be improved, thereby improving the management efficiency, management convenience and management accuracy of the database, which is conducive to simplifying the management and maintenance process of the database, and is conducive to reducing the management and maintenance cost of the database. In addition, it is also possible to determine the management requirements for each database based on the predefined information, and then intelligently generate the corresponding operation code according to the management requirements, so that the generated operation code is more in line with the management requirements of the current database, which can improve the analysis accuracy of the database data model and / or business logic, thereby improving the accuracy of determining the database management requirements, thereby improving the generation accuracy and generation efficiency of the operation code, and further improving the management efficiency and management accuracy of the database.

[0104] In an optional embodiment, the predefined information corresponding to each database can be defined in the following manner:

[0105] Define the data model of each database according to the Dart annotation and / or the configuration file of each database obtained; the data model includes at least one database table, and each database table includes multiple fields and field information corresponding to each field; wherein the field information includes at least one of field type, primary key and index; and / or,

[0106] Obtain the functional requirements corresponding to each database, and generate business logic that matches the functional requirements corresponding to each database.

[0107] It should be noted that the Dart in the embodiment of the present invention is the programming language Dart.

[0108] Optionally, the above Dart annotations may include @Table and @Column, wherein @Table may be used to define a database table, and @Column may be used to define a field, which is not limited in the embodiment of the present invention.

[0109] Optionally, the fields included in the data model of each defined database may all be type-safe fields, which is not limited in the embodiment of the present invention.

[0110] The functional requirements corresponding to each database may include one or more business functional requirements, which is not limited in the embodiment of the present invention.

[0111] Optionally, after generating the business logic matching the functional requirements corresponding to each database, it is also possible to: generate a logic implementation code corresponding to each business logic, which is not limited in the embodiment of the present invention.

[0112] It can be seen that this optional embodiment can define the data model of each database according to Dart annotations and / or the configuration files of each database, and / or obtain the functional requirements corresponding to each database and generate business logic matching the functional requirements corresponding to each database, which can improve the definition accuracy and convenience of basic information such as the database data model and business logic, thereby improving the convenience of database development, which is conducive to improving the convenience of subsequent database management.

[0113] In this optional embodiment, optionally, before defining the predefined information corresponding to each database, the method may further include:

[0114] Get the permission type of the current operator;

[0115] When the permission type belongs to the preset permission type, the current operator is allowed to define the predefined information corresponding to each database;

[0116] When the permission type does not belong to the preset permission type, the current operator is prohibited from defining the predefined information corresponding to each database.

[0117] Exemplarily, the preset permission type may include a developer type and / or a super administrator type, which is not limited in the embodiment of the present invention.

[0118] It can be seen that this optional embodiment can also allow the current operator to define the predefined information corresponding to the database only when it is determined that the current operator's authority type belongs to the preset authority type, which can improve the accuracy of authority control of database operations, thereby improving the reliability and security of the database, and is conducive to maintaining data security.

[0119] Embodiment 2

[0120] See also Figure 2 , Figure 2 1 is a flow chart of a method for automatic database management disclosed in an embodiment of the present invention. Figure 2 The described database automation management method can be applied to a database automation management device, which may include one of an automation management device, an automation management terminal, an automation management system and a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiments of the present invention; the method can also be applied to electronic devices with different operating systems, further, the electronic device can be connected to NAS (Network Attached Storage), and further, the electronic device can access the network attached storage device through a preset application, which is not limited in the embodiments of the present invention. Figure 2 As shown, the database automatic management method may include the following operations:

[0121] 201. Obtain predefined information corresponding to at least one database.

[0122] In the embodiment of the present invention, the predefined information corresponding to each database includes the data model of the database and / or the business logic corresponding to the database.

[0123] 202. For each database, when it is detected that there is a data management request for the database, determine, according to predefined information corresponding to the database, that the management requirement for the database includes a data management requirement regarding the data management request.

[0124] In the embodiment of the present invention, the data management requirements include a combination of one or more of data query requirements, data insertion requirements, data update requirements, and data deletion requirements. Exemplarily, when a data query request sent by a user is detected (e.g., all user information in a database needs to be queried), it is determined based on the data model and / or business logic of the database that the management requirements for the database include data query requirements for the data query request, and therefore a query operation code for the data query requirement needs to be generated, which is not limited in the embodiment of the present invention.

[0125] 203. For each database, when the predefined information includes a data model, obtain a preset migration strategy corresponding to the database, and monitor the current data model of the database.

[0126] In the embodiment of the present invention, optionally, the preset migration strategy may include a migration condition, and may also include a migration script generation function and / or a migration tool, which is not limited in the embodiment of the present invention.

[0127] 204. Determine whether the database satisfies a migration condition corresponding to a preset migration strategy based on the data model and the current data model.

[0128] In the embodiment of the present invention, when step 204 determines that the database meets the migration condition corresponding to the preset migration strategy, that is, when the determination result of step 204 is yes, the operation of step 205 is performed.

[0129] 205. Determine the management requirements for the database including database migration requirements.

[0130] It should be noted that step 202 has no sequence relationship with any of steps 203 to 205, that is, step 202 may occur before or after any of steps 203 to 205 or simultaneously with any of steps 203 to 205, and the embodiment of the present invention is not limited thereto.

[0131] 206. For each database, generate an operation code for the database according to management requirements for the database.

[0132] In the embodiment of the present invention, the management requirements include data management requirements and / or database migration requirements.

[0133] In the embodiment of the present invention, the operation code for the database is an operation code that matches the above-mentioned management requirements; illustratively, when the management requirements include data query requirements, the operation code includes a query operation code, which is not limited in the embodiment of the present invention.

[0134] 207. Based on the asynchronous operation object of the Dart asynchronous programming model and / or the pre-set concurrent operation strategy, the operation code is asynchronously called to perform database management operations.

[0135] In the embodiment of the present invention, for other detailed descriptions of step 201 and step 206-step 207, please refer to the detailed descriptions of step 101 and step 103-step 104 in the first embodiment, and the embodiment of the present invention will not be repeated here.

[0136] It can be seen that the method described in the embodiment of the present invention can first obtain the predefined information corresponding to at least one database, then generate the operation code for each database based on the predefined information, and then call the above operation code based on the preset asynchronous operation strategy to perform the database management operation, and can intelligently generate the database operation code based on the data model and / or business logic of the database, without the need for developers to manually write code, while improving the efficiency of database development, reducing the complexity and error possibility of the database operation code, so that while improving the accuracy and efficiency of the database operation code, the execution accuracy of the database management operation can be improved, thereby improving the management efficiency, management convenience and management accuracy of the database, which is conducive to simplifying the management and maintenance process of the database, and is conducive to reducing the management and maintenance cost of the database. In addition, it is also possible to determine the management requirements for each database based on the predefined information, and then intelligently generate the corresponding operation code according to the management requirements, so that the generated operation code is more in line with the management requirements of the current database, which can improve the analysis accuracy of the database data model and / or business logic, thereby improving the accuracy of determining the database management requirements, thereby improving the generation accuracy and generation efficiency of the operation code, and further improving the management efficiency and management accuracy of the database. In addition, for each database, when a data management request is detected, it is possible to determine, based on predefined information, whether there is a data management requirement for the database, and / or, based on the data model of the database and the monitored current data model, determine whether the database meets the migration conditions corresponding to the preset migration strategy. If so, it is determined that there is a database migration requirement for the database. Different management requirements of the database can be intelligently determined in different ways, thereby improving the accuracy and comprehensiveness of the analysis of the predefined information of the database, thereby further improving the accuracy and flexibility of determining the database management requirements, which is conducive to further improving the accuracy and intelligence of database management.

[0137] In an optional embodiment, optionally, for each database, judging whether the database meets the migration condition corresponding to the preset migration strategy according to the data model and the current data model may include the following operations:

[0138] Compare the data model with the current data model to obtain the model comparison result;

[0139] When the model comparison result indicates that the data model does not match the current data model, it is determined that the database meets the migration condition corresponding to the preset migration strategy; or

[0140] Check whether the version corresponding to the current data model is higher than the version corresponding to the data model;

[0141] When it is detected that the version corresponding to the current data model is higher than the version corresponding to the data model, it is determined that the database meets the migration condition corresponding to the preset migration strategy.

[0142] Optionally, comparing the data model with the current data model to obtain a model comparison result may specifically include: comparing the first model structure of the data model with the second model structure of the current data model to obtain a model comparison result; or, comparing the first table structure of each first database table of the data model with the second table structure of the second database table corresponding to each first database table in the current data model to obtain a model comparison result, which is not limited in the embodiments of the present invention; or, comparing the first database schema corresponding to the data model with the second database schema corresponding to the current data model to obtain a model comparison result. Further optionally, when the first model structure and the second model structure are different or any first table structure is different from the corresponding second table structure or the first database schema is different from the second database schema, the model comparison structure is determined to be that the data model does not match the current data model, which is not limited in the embodiments of the present invention.

[0143] Optionally, the version corresponding to the current data model being higher than the version corresponding to the data model may be used to indicate that the update time of the current data model is later than the update time of the data model, which is not limited in the embodiment of the present invention.

[0144] It can be seen that this optional embodiment can also determine that the database meets the migration conditions corresponding to the preset migration strategy when it is found that the data model does not match the current data model; or, when it is detected that the version corresponding to the current data model is higher than the version corresponding to the data model, determine that the database meets the migration conditions corresponding to the preset migration strategy, which can improve the accuracy and flexibility of judging whether the database meets the migration conditions corresponding to the preset migration strategy, thereby facilitating improving the accuracy of determining whether the database has migration requirements, and further facilitating improving the accuracy and flexibility of determining database management requirements, and further facilitating further improving the accuracy and intelligence of database management.

[0145] In this optional embodiment, optionally, for each database, according to the management requirements for the database, generating an operation code for the database may include the following operations:

[0146] When the management requirements include data management requirements, generate Dart management code for the data management requirements of the database according to the data model of the database and the business logic corresponding to the database;

[0147] Generate SQL management code for the database based on the Dart management code;

[0148] Based on the pre-set code optimization strategy, optimize the SQL management code to obtain the management operation code for the database;

[0149] When the management requirements include database migration requirements, determine the model differences corresponding to the database based on the data model and the current data model;

[0150] According to the preset migration strategy corresponding to the database, obtain the migration script generation function corresponding to the database migration requirement;

[0151] Based on the migration script generation function, a Dart migration script for the database is generated according to the model differences as the migration operation code for the database;

[0152] The operation code includes a management operation code and / or a migration operation code.

[0153] It should be noted that the SQL in the embodiment of the present invention is a structured query language (Structured Query Language), which is used to access data and query, update and manage relational database systems.

[0154] Optionally, the code optimization strategy may include a combination of one or more of an SQL statement rewriting strategy, an SQL statement optimization strategy, and a multi-table connection optimization strategy, which is not limited in the embodiment of the present invention.

[0155] Optionally, for each database, based on the data model of the database and the business logic corresponding to the database, generate Dart management code for the data management requirements of the database, which may include the following operations:

[0156] Obtain a pre-built build management code generator; wherein the management code generator is built based on a Dart preset function; based on the management code generator, generate Dart code that meets the data management requirements of the database according to the data model of the database and the business logic corresponding to the database; based on the asynchronous operation object of the Dart asynchronous programming model, optimize the above Dart code to obtain the Dart management code.

[0157] For example, taking the data management requirement as the data query requirement, a query builder is built based on functions such as select(), where(), orderBy(), etc., and then based on the query builder, Dart code for data query requirements is generated according to the data model and query logic, and then based on the Future in the Dart asynchronous programming model <t>or Stream <t>, optimize the above Dart code to obtain the Dart query code, which is not limited in the embodiment of the present invention.

[0158] It can be seen that this optional embodiment can also generate Dart management code for data management requirements according to the data model and business logic of the database when the management requirements include data management requirements, and then generate corresponding SQL management code according to the Dart management code, and optimize the SQL management code based on the code optimization strategy to obtain the management operation code, which can improve the generation accuracy of the Dart management code, thereby improving the writing accuracy of the SQL management code, and then improve the code optimization accuracy, so as to obtain management operation code with higher execution efficiency, thereby further improving the accuracy and efficiency of database management; when the management requirements include database migration requirements, first determine the model difference between the data model and the current data model, and then obtain the migration script generation function corresponding to the database migration requirement according to the preset migration strategy, so as to generate a Dart migration script for the database based on the migration script generation function and the model difference, as the migration operation code for the database, which can improve the generation efficiency and generation accuracy of the migration script, thereby facilitating improving the determination accuracy of the migration operation code, thereby facilitating improving the efficiency and accuracy of database migration.

[0159] In another optional embodiment, before asynchronously calling the operation code and executing the database management operation based on the asynchronous operation object of the Dart asynchronous programming model and / or the pre-set concurrent operation strategy, the method may further include the following operations:

[0160] Determine whether the operation code for each database meets the pre-set type safety conditions;

[0161] When it is determined that the operation code for each database meets the type safety conditions, the asynchronous operation object based on the Dart asynchronous programming model and / or the pre-set concurrent operation strategy is triggered to execute the operation code asynchronously and perform the database management operation.

[0162] It can be seen that this optional embodiment can call the operation code to perform database management operations only when it is determined that all operation codes meet the type safety conditions, and can realize type-safe intelligent detection of the operation code, improve the accuracy of the operation code and the analysis accuracy of the matching degree with the database, thereby helping to reduce the error risk of database management operations, and further help to improve the execution efficiency and execution accuracy of database management operations, and further help to improve the reliability and security of the database.

[0163] In this optional embodiment, optionally, determining whether the operation code for each database satisfies a preset type safety condition may include the following operations:

[0164] For each database, determining whether a first data type defined by the database matches a second data type required to be operated by the operation code;

[0165] For each database, when it is determined that the first data type defined by the database matches the second data type required to be operated by the operation code, it is determined that the operation code meets the preset type safety condition.

[0166] Optionally, for each database, based on a preset type check class, it can be determined whether the first data type defined by the database matches the second data type required to be operated by the operation code, which is not limited in the embodiment of the present invention.

[0167] Wherein, for each database, the first data type defined by the database may be the data type stored in the target database table of the database, wherein the target database table is the database table to be operated. Optionally, when the operation code is a query operation code, the second data type required to be operated by the operation code may be the data type of the data returned by the query operation code; when the operation code is an insert operation code, the second data type required to be operated by the operation code may be the data type of the data inserted by the insert operation code; when the operation code is an update operation code, the second data type required to be operated by the operation code may be the data type of the data updated by the update operation code; when the operation code is a delete operation code, the second data type required to be operated by the operation code may be the data type of the data deleted by the delete operation code, which is not limited in the embodiment of the present invention.

[0168] Exemplarily, when the operation code includes an insert operation code, it is determined whether the first data type stored in the target database table matches the second data type of the data to be inserted. If they match, it is determined that the insert operation code meets the type safety condition to perform the data insertion operation.

[0169] It can be seen that this optional embodiment can also determine, for each database, that the operation code meets the preset type safety conditions when it is determined that the first data type defined by the database matches the second data type required for the operation code to operate, thereby improving the accuracy of the analysis of the operation data type, thereby improving the accuracy of the judgment of whether the operation code meets the type safety conditions, and further improving the accuracy of the operation code and the accuracy of the analysis of the degree of matching with the database.

[0170] In yet another optional embodiment, the concurrent operation strategy may include at least one of a transaction management mechanism, a lock mechanism, an optimistic concurrency control mechanism, a queue management mechanism, and a transaction retry mechanism.

[0171] Optionally, the asynchronous operation object may include Future and / or Stream, which is not limited in the embodiment of the present invention.

[0172] It should be noted that a transaction is a collection of multiple database management operations corresponding to an operation code, and a transaction management mechanism can asynchronously execute transactions and control the uniformity of the execution status of multiple database management operations included in a transaction (that is, control whether all the multiple operations included in a transaction are successfully executed or all fail to execute); a lock mechanism may include a row-level lock and / or a table-level lock, wherein a row-level lock is used to lock a specific row in a database, and a table-level lock is used to lock a database table in a database to prevent concurrent operations from modifying the same data; an optimistic concurrency control mechanism adds a version number field to a database table, updates the version number each time a record is updated, and checks whether the version number matches when executing a database management operation; a queue management mechanism is used to manage the order of concurrent database management operations; a transaction retry mechanism is used to attempt to re-execute a corresponding database management operation in the event of a conflict or exception in a concurrent operation, which is not limited in the embodiments of the present invention.

[0173] Optionally, the method may further include: after executing the data query operation, caching the query result corresponding to the data query operation based on a preset cache mechanism. This can improve the efficiency and performance of the query operation while reducing repeated access to the database when the data query operation is required to be performed later.

[0174] Optionally, during the execution of database management operations, data corresponding to the database management operations can be loaded based on a lazy loading mechanism. This allows data to be loaded only when it is actually needed, which can reduce the amount of data loaded and data processing overhead, and improve database management performance.

[0175] It can be seen that this optional embodiment can asynchronously call the operation code and perform database management operations based on the asynchronous operation objects and / or pre-set concurrent operation strategies of the Dart asynchronous programming model. It can maintain high responsiveness and performance when performing database management operations on multiple databases or multiple platforms, thereby ensuring the execution security, execution orderliness and execution efficiency of database management operations in large-scale database management operations, which is conducive to improving the reliability of database operations, and further improving the management efficiency and convenience of the database.

[0176] Embodiment 3

[0177] See also Figure 3 , Figure 3 1 is a schematic diagram of the structure of a database automation management device disclosed in an embodiment of the present invention. Figure 3 The described database automation management device may include one of an automation management device, an automation management terminal, an automation management system and a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiments of the present invention; the device may also be applied to electronic devices with different operating systems, further, the electronic device may be connected to a NAS (Network Attached Storage), and further, the electronic device may access the network attached storage device through a preset application, which is not limited in the embodiments of the present invention. Figure 3 As shown, the database automatic management device may include:

[0178] The acquisition module 301 is used to acquire predefined information corresponding to at least one database; the predefined information corresponding to each database includes a data model of the database and / or a business logic corresponding to the database;

[0179] The determination module 302 is used to determine, for each database, a management requirement for the database based on predefined information corresponding to the database; the management requirement includes a data management requirement and / or a database migration requirement;

[0180] A generating module 303 is used to generate an operation code for each database according to the management requirements for the database;

[0181] The calling module 304 is used to asynchronously call the operation code based on the asynchronous operation object of the Dart asynchronous programming model and / or the pre-set concurrent operation strategy to perform the database management operation.

[0182] It can be seen that the device described in the embodiment of the present invention can first obtain the predefined information corresponding to at least one database, and then generate an operation code for each database based on the predefined information, and then call the above operation code based on the preset asynchronous operation strategy to perform database management operations. It can intelligently generate database operation codes based on the data model and / or business logic of the database, without the need for developers to manually write code, thereby improving the efficiency of database development while reducing the complexity and error possibility of writing database operation codes, thereby improving the accuracy and efficiency of writing database operation codes while improving the execution accuracy of database management operations, thereby improving the management efficiency, convenience and accuracy of the database, which is conducive to simplifying the management and maintenance process of the database, and is conducive to reducing the management and maintenance costs of the database.

[0183] In an optional embodiment, for each database, the specific manner in which the determination module 302 determines the management requirement for the database based on the predefined information corresponding to the database may include:

[0184] When it is detected that there is a data management request for the database, determining, according to predefined information corresponding to the database, that the management demand for the database includes a data management demand regarding the data management request; wherein the data management demand includes a combination of one or more of a data query demand, a data insertion demand, a data update demand and a data deletion demand; and / or,

[0185] When the predefined information includes a data model, obtaining a preset migration strategy corresponding to the database, and monitoring a current data model of the database;

[0186] According to the data model and the current data model, determine whether the database meets the migration conditions corresponding to the preset migration strategy;

[0187] When it is determined that the database meets the migration condition corresponding to the preset migration policy, it is determined that the management requirement for the database includes a database migration requirement.

[0188] It can be seen that the device described in the implementation of this optional embodiment can also, for each database, determine, when a data management request is detected, based on predefined information, whether there is a data management requirement for the database, and / or, based on the data model of the database and the monitored current data model, determine whether the database meets the migration conditions corresponding to the preset migration strategy; if so, it is determined that there is a database migration requirement for the database, and can intelligently determine the different management requirements of the database in different ways, improve the accuracy and comprehensiveness of the analysis of the predefined information of the database, thereby further improving the accuracy and flexibility of determining the database management requirements, which is conducive to further improving the accuracy and intelligence of database management.

[0189] In this optional embodiment, optionally, for each database, the specific manner in which the determination module 302 determines whether the database satisfies the migration condition corresponding to the preset migration strategy according to the data model and the current data model may include:

[0190] Compare the data model with the current data model to obtain the model comparison result;

[0191] When the model comparison result indicates that the data model does not match the current data model, it is determined that the database meets the migration condition corresponding to the preset migration strategy; or

[0192] Check whether the version corresponding to the current data model is higher than the version corresponding to the data model;

[0193] When it is detected that the version corresponding to the current data model is higher than the version corresponding to the data model, it is determined that the database meets the migration condition corresponding to the preset migration strategy.

[0194] It can be seen that the device described in the implementation of this optional embodiment can also determine that the database meets the migration conditions corresponding to the preset migration strategy when it is found that the data model does not match the current data model; or, when it is detected that the version corresponding to the current data model is higher than the version corresponding to the data model, determine that the database meets the migration conditions corresponding to the preset migration strategy, which can improve the accuracy and flexibility of judging whether the database meets the migration conditions corresponding to the preset migration strategy, thereby facilitating improving the accuracy of determining whether the database has a migration demand, and further facilitating improving the accuracy and flexibility of determining the database management demand, and further facilitating further improving the accuracy and intelligence of database management.

[0195] In this optional embodiment, optionally, for each database, the specific manner in which the generating module 303 generates the operation code for the database according to the management requirements for the database may include:

[0196] When the management requirements include data management requirements, generate Dart management code for the data management requirements of the database according to the data model of the database and the business logic corresponding to the database;

[0197] Generate SQL management code for the database based on the Dart management code;

[0198] Based on the pre-set code optimization strategy, optimize the SQL management code to obtain the management operation code for the database;

[0199] When the management requirements include database migration requirements, determine the model differences corresponding to the database based on the data model and the current data model;

[0200] According to the preset migration strategy corresponding to the database, obtain the migration script generation function corresponding to the database migration requirement;

[0201] Based on the migration script generation function, a Dart migration script for the database is generated according to the model differences as the migration operation code for the database;

[0202] The operation code includes a management operation code and / or a migration operation code.

[0203] It can be seen that the device described in the implementation of this optional embodiment can also generate Dart management code for data management requirements according to the data model and business logic of the database when the management requirements include data management requirements, and then generate corresponding SQL management code according to the Dart management code, and optimize the SQL management code based on the code optimization strategy to obtain the management operation code, which can improve the generation accuracy of the Dart management code, thereby improving the writing accuracy of the SQL management code, and then improve the code optimization accuracy, so as to obtain management operation code with higher execution efficiency, thereby further improving the accuracy and efficiency of database management; when the management requirements include database migration requirements, first determine the model difference between the data model and the current data model, and then obtain the migration script generation function corresponding to the database migration requirement according to the preset migration strategy, so as to generate a Dart migration script for the database based on the migration script generation function and the model difference, as the migration operation code for the database, which can improve the generation efficiency and generation accuracy of the migration script, thereby facilitating improving the determination accuracy of the migration operation code, and thereby facilitating improving the efficiency and accuracy of database migration.

[0204] In this optional embodiment, optionally, for each database, the generation module 303 generates a Dart management code for the data management requirements of the database according to the data model of the database and the business logic corresponding to the database. The specific manner includes:

[0205] Get the pre-built build management code generator; the management code generator is built based on Dart preset functions;

[0206] Based on the management code generator, generate Dart code that meets the data management requirements of the database according to the data model of the database and the business logic corresponding to the database;

[0207] Based on the asynchronous operation object of the Dart asynchronous programming model, the Dart code is optimized to obtain the Dart management code.

[0208] In another optional embodiment, Figure 4 As shown, the device may also include:

[0209] The judgment module 305 is used to judge whether the operation code for each database meets the preset type safety condition before the calling module 304 asynchronously calls the operation code based on the asynchronous operation object of the Dart asynchronous programming model and / or the preset concurrent operation strategy to perform the database management operation; when it is judged that the operation code for each database meets the type safety condition, the calling module 304 is triggered to execute the asynchronous operation object based on the Dart asynchronous programming model and / or the preset concurrent operation strategy, asynchronously call the operation code, and perform the database management operation;

[0210] The specific manner in which the judgment module 305 judges whether the operation code for each database satisfies the preset type safety condition may include:

[0211] For each database, determining whether a first data type defined by the database matches a second data type required to be operated by the operation code;

[0212] For each database, when it is determined that the first data type defined by the database matches the second data type required to be operated by the operation code, it is determined that the operation code meets the preset type safety condition.

[0213] It can be seen that the device described in the implementation of this optional embodiment can call the operation code to perform the database management operation only when it is determined that all operation codes meet the type safety conditions, and can realize type safety intelligent detection of the operation code, improve the accuracy of the operation code and the analysis accuracy of the matching degree with the database, which is conducive to reducing the error risk of database management operations, and further helps to improve the execution efficiency and execution accuracy of database management operations, and further helps to improve the reliability and security of the database; and, it can also determine for each database that the operation code meets the preset type safety conditions when it is determined that the first data type defined by the database matches the second data type required by the operation code, which can improve the analysis accuracy of the operation data type, thereby improving the accuracy of the judgment of whether the operation code meets the type safety conditions, and further improve the accuracy of the operation code and the analysis accuracy of the matching degree with the database.

[0214] In yet another optional embodiment, the concurrent operation strategy includes at least one of a transaction management mechanism, a lock mechanism, an optimistic concurrency control mechanism, a queue management mechanism, and a transaction retry mechanism.

[0215] It can be seen that the device described in the implementation of this optional embodiment can asynchronously call the operation code and perform database management operations based on the asynchronous operation objects and / or pre-set concurrent operation strategies of the Dart asynchronous programming model. It can maintain high responsiveness and performance when performing database management operations on multiple databases or multiple platforms, thereby ensuring the execution security, execution orderliness and execution efficiency of database management operations in large-scale database management operations, which is conducive to improving the reliability of database operations, and further improving the management efficiency and convenience of the database.

[0216] Embodiment 4

[0217] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of the structure of another database automation management device disclosed in an embodiment of the present invention. Figure 5 As shown, the database automatic management device may include:

[0218] A memory 401 storing executable program codes;

[0219] a processor 402 coupled to the memory 401;

[0220] The processor 402 calls the executable program code stored in the memory 401 to execute part or all of the steps in the database automatic management method described in the first embodiment of the present invention or the second embodiment of the present invention.

[0221] Embodiment 5

[0222] See also Figure 6 , Figure 6 Schematic diagram of a database automation management system disclosed in an embodiment of the present invention. Figure 6 As shown, the system includes an electronic device 50 and a network attached storage device 60. The electronic device is communicatively connected to the network attached storage device, and the electronic device accesses the network attached storage device through a preset application. The preset application is used to execute part or all of the steps in the database automation management method described in Embodiment 1 or Embodiment 2 of the present invention.

[0223] Embodiment 5

[0224] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute some or all steps of the database automatic management method described in Embodiment 1 or Embodiment 2 of the present invention.

[0225] Embodiment 6

[0226] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute part or all of the steps in the database automation management method described in Embodiment 1 or Embodiment 2.

[0227] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0228] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, a magnetic disk storage, a magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0229] Finally, it should be noted that the database automation management method, device and system disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.< / t> < / t>

Claims

1. A method for automatic database management, characterized in that: The method comprises: Acquire predefined information corresponding to at least one database; the predefined information corresponding to each database includes a data model of the database and / or a business logic corresponding to the database; For each of the databases, based on predefined information corresponding to the database, determine management requirements for the database; the management requirements include data management requirements and / or database migration requirements; For each of the databases, generating an operation code for the database according to management requirements for the database; Based on the asynchronous operation object of the Dart asynchronous programming model and / or a pre-set concurrent operation strategy, the operation code is asynchronously called to perform the database management operation.

2. The database automation management method according to claim 1, characterized in that: For each of the databases, determining the management requirements for the database based on the predefined information corresponding to the database includes: When it is detected that there is a data management request for the database, determining, according to predefined information corresponding to the database, that the management demand for the database includes a data management demand regarding the data management request; wherein the data management demand includes a combination of one or more of a data query demand, a data insertion demand, a data update demand and a data deletion demand; and / or, When the predefined information includes the data model, obtaining a preset migration strategy corresponding to the database, and monitoring the current data model of the database; According to the data model and the current data model, determining whether the database meets the migration condition corresponding to the preset migration strategy; When it is determined that the database meets the migration condition corresponding to the preset migration strategy, it is determined that the management requirement for the database includes a database migration requirement.

3. The database automation management method according to claim 2, characterized in that: For each of the databases, judging whether the database satisfies a migration condition corresponding to the preset migration strategy according to the data model and the current data model includes: Comparing the data model with the current data model to obtain a model comparison result; When the model comparison result indicates that the data model does not match the current data model, determining that the database satisfies the migration condition corresponding to the preset migration strategy; or Detecting whether the version corresponding to the current data model is higher than the version corresponding to the data model; When it is detected that the version corresponding to the current data model is higher than the version corresponding to the data model, it is determined that the database meets the migration condition corresponding to the preset migration strategy.

4. The database automation management method according to claim 3, characterized in that: For each of the databases, generating an operation code for the database according to the management requirements for the database includes: When the management requirements include the data management requirements, generating Dart management code for the data management requirements of the database according to the data model of the database and the business logic corresponding to the database; Generate SQL management code for the database according to the Dart management code; Based on a preset code optimization strategy, the SQL management code is optimized to obtain a management operation code for the database; When the management requirement includes the database migration requirement, determining a model difference corresponding to the database according to the data model and the current data model; According to the preset migration strategy corresponding to the database, a migration script generation function corresponding to the database migration requirement is obtained; Based on the migration script generation function, a Dart migration script for the database is generated according to the model differences as the migration operation code for the database; The operation code includes the management operation code and / or the migration operation code.

5. The method for automatic database management according to claim 4, characterized in that: For each of the databases, generating Dart management code for the data management requirements of the database according to the data model of the database and the business logic corresponding to the database includes: Obtain a pre-built build management code generator; wherein the management code generator is built based on a Dart preset function; Based on the management code generator, Dart code that meets the data management requirements of the database is generated according to the data model of the database and the business logic corresponding to the database; Based on the asynchronous operation object of the Dart asynchronous programming model, the Dart code is optimized to obtain the Dart management code.

6. The method for automatic database management according to any one of claims 1 to 5, characterized in that: Before the asynchronous operation object based on the Dart asynchronous programming model and / or the pre-set concurrent operation strategy asynchronously calls the operation code to perform the database management operation, the method further includes: Determining whether the operation code for each of the databases satisfies a preset type safety condition; When it is determined that the operation code for each of the databases meets the type safety condition, triggering the execution of the asynchronous operation object based on the Dart asynchronous programming model and / or the pre-set concurrent operation strategy, asynchronously calling the operation code, and performing the database management operation; The step of determining whether the operation code for each database satisfies a preset type safety condition includes: For each of the databases, determining whether a first data type defined by the database matches a second data type required to be operated by the operation code; For each of the databases, when it is determined that the first data type defined by the database matches the second data type required to be operated by the operation code, it is determined that the operation code meets a preset type safety condition.

7. The method for automatic database management according to any one of claims 1 to 5, characterized in that: The concurrent operation strategy includes at least one of a transaction management mechanism, a lock mechanism, an optimistic concurrency control mechanism, a queue management mechanism and a transaction retry mechanism.

8. A database automation management device, characterized in that: The device comprises: An acquisition module, used to acquire predefined information corresponding to at least one database; the predefined information corresponding to each database includes a data model of the database and / or a business logic corresponding to the database; A determination module, configured to determine, for each of the databases, a management requirement for the database based on predefined information corresponding to the database; the management requirement includes a data management requirement and / or a database migration requirement; A generating module, used for generating, for each of the databases, an operation code for the database according to the management requirements for the database; The calling module is used to asynchronously call the operation code based on the asynchronous operation object of the Dart asynchronous programming model and / or a pre-set concurrent operation strategy to perform database management operations.

9. A database automation management device, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the database automatic management method according to any one of claims 1 to 7.

10. A database automation management system, characterized in that: The system includes a network attached storage device and an electronic device, wherein the electronic device is communicatively connected to the network attached storage device, and the electronic device accesses the network attached storage device through a preset application, and the preset application is used to execute the database automation management method described in any one of claims 1-7.

11. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the database automatic management method according to any one of claims 1 to 7.