Database management method and related equipment
The database management method automates the update process by establishing a connection through a configuration file, determining driver package paths, and sending management codes to create record tables, effectively reducing errors and ensuring accurate data management.
Patent Information
- Application Number
- CN202310679071.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2024-12-10
AI Technical Summary
Manual database updating leads to issues such as omissions and duplications, which are inevitable in existing systems.
A database management method that establishes a connection through a configuration file, determines the driver package path, modifies the resource address, and sends management codes to create a record table for updating the database.
Automates the database update process, reducing errors and ensuring accurate data management by establishing a connection, creating record tables, and executing SQL statements to address the issues of manual updates.
Smart Images

Figure CN119106037A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and communication technology, and in particular to a database management method and related equipment. Background Art
[0002] In the prior art, the management and updating of domestic databases requires manual data updating due to the lack of support from corresponding applications. However, manual updating will inevitably lead to problems such as omissions and duplications. Summary of the invention
[0003] The embodiments of the present application provide a database management method and related equipment, which can at least to some extent overcome the problems of omissions, duplications, etc. that are inevitable in manual updates of the prior art.
[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 management method is provided, comprising: establishing a connection with a database through a configuration file; calling a corresponding driver according to the configuration file, sending a management code to the database so that the database establishes a record table; and updating the database according to the record table.
[0006] In some embodiments of the present application, the configuration file includes an original resource address, and establishing a connection with a database through the configuration file specifically includes: determining a path of a corresponding driver package according to the original resource address; modifying the original resource address to obtain a modified resource address; and according to the driver package path, driving the driver package to use the modified resource address to establish a connection with the database.
[0007] In some embodiments of the present application, determining the path of the corresponding driver package according to the original resource address specifically includes: calling the corresponding code package according to the original resource address; and determining the path of the driver package according to the code package.
[0008] In some embodiments of the present application, the modifying the original resource address to obtain the modified resource address specifically includes: modifying the package name of the target driver package in the original resource address according to a predetermined code to obtain a predetermined modified resource address.
[0009] In some embodiments of the present application, driving the driver package to establish a connection with the database using the modified resource address according to the driver package path specifically includes: calling the corresponding driver package according to the path of the driver package; driving the driver package to establish a connection with the database using the modified resource address.
[0010] In some embodiments of the present application, the management code includes a check code and an establishment code. Calling the corresponding driver according to the configuration file and sending the management code to the database so that the database establishes a record table specifically includes: calling the corresponding driver according to the configuration file, sending a check code to the database to determine whether the record table exists in the database; if the record table does not exist in the database, sending an establishment code to the database so that the database establishes the record table according to the establishment code.
[0011] In some embodiments of the present application, updating the database according to the record table specifically includes: determining a target file according to the record table; and executing the target file to update the database.
[0012] In some embodiments of the present application, before establishing a connection with the database through the configuration file, the method further includes: pre-connecting with the database through an extended interface; acquiring initial data returned by the database; and configuring the configuration file according to the initial data.
[0013] In some embodiments of the present application, the initial data includes a database version and error information. After obtaining the initial data returned by the database, the method further includes: obtaining a driver address according to the database version polling adaptation information; and obtaining a management code according to the error information and the driver address.
[0014] In some embodiments of the present application, the initial data includes a database version and error information. After obtaining the initial data returned by the database, the method further includes: modifying the source code according to the error information; and modifying the package name of the driver package according to the database version.
[0015] In some embodiments of the present application, the initial data includes a database version and a database type, and the configuration file is configured according to the initial data, specifically including: determining the original resource address according to the database version and the database type; and generating the configuration file according to the original resource address.
[0016] According to one aspect of an embodiment of the present application, a database management device is provided, which includes: a connection establishment module, used to establish a connection with a database through a configuration file; a code sending module, used to call a corresponding driver according to the configuration file and send a management code to the database so that the database establishes a record table; a data update module, used to update the database according to the record table.
[0017] In some embodiments of the present application, the configuration file includes the original resource address, and the connection establishment module specifically includes: a path determination submodule, used to determine the path of the corresponding driver package according to the original resource address; an address modification submodule, used to modify the original resource address to obtain a modified resource address; a database connection submodule, used to drive the driver package to use the modified resource address to establish a connection with the database according to the driver package path.
[0018] In some embodiments of the present application, the path determination submodule specifically includes: a code package calling unit, used to call the corresponding code package according to the original resource address; and a driver package positioning unit, used to determine the path of the driver package according to the code package.
[0019] In some embodiments of the present application, the address modification submodule specifically includes: an address modification unit, which is used to modify the package name of the target driver package in the original resource address according to a predetermined code to obtain a predetermined modified resource address.
[0020] In some embodiments of the present application, the database connection submodule specifically includes: a driver package calling unit, used to call the corresponding driver package according to the path of the driver package; and a driver package driving unit, used to drive the driver package to use the modified resource address to establish a connection with the database.
[0021] In some embodiments of the present application, the management code includes a check code and an establishment code, and the code sending module specifically includes: a check code sending sub-module, which is used to call the corresponding driver according to the configuration file, send a check code to the database, and determine whether the record table exists in the database; and an establishment code sending sub-module, which is used to send an establishment code to the database if the record table does not exist in the database, so that the database can establish the record table according to the establishment code.
[0022] In some embodiments of the present application, the data update module specifically includes: a file determination submodule, used to determine the target file according to the record table; and a file execution submodule, used to execute the target file to update the database.
[0023] In some embodiments of the present application, the database management device also includes: a pre-connection module, used to pre-connect with the database through an extension interface; a data acquisition module, used to obtain the initial data returned by the database; and a file configuration module, used to configure the configuration file according to the initial data.
[0024] In some embodiments of the present application, the database management device further includes: an information polling module, used to obtain a driver address according to the database version polling adaptation information; and a code modification module, used to obtain a management code according to the error information and the driver address.
[0025] In some embodiments of the present application, the database management device further includes: a source code modification module, used to modify the source code according to the error information; and a package name modification module, used to modify the package name of the driver package according to the database version.
[0026] In some embodiments of the present application, the initial data includes a database version and a database type, and the file configuration module specifically includes: an address determination submodule, used to determine the original resource address according to the database version and the database type; and a file generation submodule, used to generate the configuration file according to the original resource address.
[0027] 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 management method as described in the above embodiment is implemented.
[0028] 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 management method as described in the above embodiments.
[0029] In the technical solutions provided in some embodiments of the present application, a connection is established between a configuration file and a database, a management code is sent to the database, a record table is established in the database, and finally, according to the content in the record table, the corresponding SQL statement is executed to update the database, thereby solving the problem of omissions, duplications, etc. that are inevitable in manual updates of the prior art.
[0030] 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
[0031] 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:
[0032] Figure 1A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.
[0033] Figure 2 A flowchart of a database management method provided in an embodiment of the present application is shown.
[0034] Figure 3 Shown according to Figure 2 A specific implementation flow chart of step S100 in the database management method shown in the corresponding embodiment.
[0035] Figure 4 A flow chart of another database management method provided in an embodiment of the present application is shown.
[0036] Figure 5 A schematic diagram of the structure of a database management device provided in an embodiment of the present application.
[0037] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many 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 example embodiments to those skilled in the art.
[0039] 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 present application.
[0040] 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.
[0041] 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.
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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 establish a connection with the database of the server 105 through the configuration file, and sends a management code to the database of the server 105. The server 105 can establish a record table according to the management code. The terminal device 103 (or the terminal device 101 or 102) updates the database according to the record table.
[0046] It should be noted that the database management method provided in the embodiment of the present application is generally executed by the terminal device 103 (or the terminal device 101 or 102), and accordingly, the database management device is generally set in the terminal device 103 (or the terminal device 101 or 102). However, in other embodiments of the present application, the server may also have similar functions to the terminal device, so as to execute the database management solution provided in the embodiment of the present application.
[0047] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0048] Figure 2A flowchart of a database management method according to an embodiment of the present application is shown. The database management method can be executed by a terminal device. The server can be Figure 1 The terminal equipment shown in . Figure 2 As shown, the database management method at least includes:
[0049] Step S100, establishing a connection with a database through a configuration file.
[0050] Step S200, calling the corresponding driver according to the configuration file, and sending the management code to the database so that the database can establish a record table.
[0051] Step S300: updating the database according to the record table.
[0052] In an embodiment of the present application, a connection is first established with a database through a configuration file, and then a corresponding driver is called according to the configuration file, and a management code is sent to the database. After a record table is established in the database, the database is updated according to the record table.
[0053] In step S100, a connection is established by configuring a configuration file and setting basic parameters that match a database.
[0054] Specifically, in some embodiments, the specific implementation of step S100 can be found in Figure 3 . Figure 3 is based on Figure 2 The detailed description of step S100 in the database management method shown in the corresponding embodiment, in the database management method, the configuration file includes the original resource address, and step S100 may include the following steps:
[0055] Step S110, determining the path of the corresponding driver package according to the original resource address.
[0056] Step S120, modify the original resource address to obtain a modified resource address.
[0057] Step S130: According to the driver package path, the driver package is driven to establish a connection with the database using the modified resource address.
[0058] In the embodiment of the present application, the path of the corresponding driver package is first determined according to the original resource address in the configuration file, and then the original resource address is modified to become a modified resource address so that it is compatible with the database and can be read normally by the database. Finally, according to the driver package path, the driver package corresponding to the driver sends the modified resource address to the database to successfully establish a connection with the database.
[0059] In step S110, a corresponding driver package can be found according to the original resource address. The driver package can be used to establish a connection with a database. The specific method for finding the driver package can refer to the following embodiment.
[0060] Specifically, in some embodiments, the specific implementation of step S110 can refer to the following embodiments. Figure 3 The detailed description of step S110 in the database management method shown in the corresponding embodiment, in the database management method, step S110 may include the following steps:
[0061] According to the original resource address, the corresponding code package is called.
[0062] According to the code package, a path of the driver package is determined.
[0063] In the embodiment of the present application, the corresponding code package is first located according to the original resource address, and then the code package is called to obtain the path of the driver package returned by the code package. Then, the driver package can be located according to the driver package path returned by the code package, and the driver package can be called.
[0064] In the embodiment of the present application, the database has different versions, so its corresponding code package, driver package, etc. also have multiple versions to adapt to different versions of the database. However, in the prior art, the code packages and driver packages of different versions are all the same name, and the versions cannot be distinguished. Therefore, in the embodiment of the present application, before the configuration file is written, the name of the plug-in with multiple versions of the code package, driver package, etc. will be modified first, so that it can distinguish the version number corresponding to the code package, driver package, etc. For example, postgresql8 is modified to kbr3 or kbr6 according to the version. Then when configuring the configuration file, for the original resource address, it is also necessary to modify it accordingly to ensure that it can correctly point to the corresponding code package. Then before information exchange occurs with the database, it is necessary to perform step S120 first, and the package name pointed to by the path of the original resource address is modified, that is, according to the predetermined code, the package name of the target driver package in the original resource address is modified to obtain a predetermined modified resource address. For example, the above-mentioned kbr3 or kbr6 is modified back to postgresql8 to ensure that the database can read normally after the modified resource address is sent to the database.
[0065] After the original resource address is modified, step S130 may be executed to drive the driver package to establish a connection with the database using the modified resource address. The specific method of establishing a connection with the database may refer to the following embodiment.
[0066] Specifically, in some embodiments, the specific implementation of step S130 can refer to the following embodiments. Figure 3The detailed description of step S130 in the database management method shown in the corresponding embodiment, in the database management method, according to the driver package path, step S130 may include the following steps:
[0067] According to the path of the driver package, the corresponding driver package is called.
[0068] The driver package is driven to establish a connection with the database using the modified resource address.
[0069] In an embodiment of the present application, the driver package is first located according to the path of the driver package determined in step S110, and the driver package is called to drive it to send a modified resource address to the database to successfully connect to the database.
[0070] In step S200, the above-mentioned driver package is called to send a management code to the database. After receiving the management code, the database creates a record table according to the management code.
[0071] 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 management method shown in the corresponding embodiment, in the database management method, the management code includes a check code and an establishment code, and step S200 may include the following steps:
[0072] The corresponding driver is called according to the configuration file, and a check code is sent to the database to determine whether the record table exists in the database.
[0073] If the record table does not exist in the database, a creation code is sent to the database so that the database creates the record table according to the creation code.
[0074] In an embodiment of the present application, the management code includes a check code and an establishment code. First, a check code is sent to the database to check whether a record table exists in the database. If a record table does not exist, it is necessary to establish the record table first. If a record table exists, it is not necessary to establish the record table.
[0075] The method of establishing a record table is to send an establishment code to the database, and the database establishes a record table based on the establishment code. The record table contains execution records of multiple SQL files, each SQL file contains corresponding SQL statements, and the database can be updated accordingly through the aforementioned SQL statements.
[0076] In step S300, the SQL file to be executed, ie, the target file, can be determined according to the above-mentioned record table. The target file is executed, and the database can be updated through the SQL statements in the target file.
[0077] 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 management method shown in the corresponding embodiment, in the database management method, step S300 may include the following steps:
[0078] According to the record table, a target file is determined.
[0079] The target file is executed to update the database.
[0080] In an embodiment of the present application, based on the established record table, SQL files that have not been executed in the record table are determined. These SQL files that have not been executed are the target files. All SQL statements in the target files are executed to complete the update of the database.
[0081] like Figure 4 As shown, in some embodiments of the present application, before step S100, the method further includes:
[0082] Step S400: pre-connecting with the database via an extended interface.
[0083] Step S500: acquiring the initial data returned by the database.
[0084] Step S600: configuring the configuration file according to the initial data.
[0085] In the embodiment of the present application, before performing database management, some development operations need to be performed to modify the database and the client so that they can be more suitable for communication. Specifically, the database can be pre-connected through an extended interface. The pre-connection is a preliminary connection. In the pre-connected state, the client cannot access all the data in the database through the extended interface, but the database can return some basic data and error information to the client. At this time, the basic data and error information returned by the database, that is, the initial data, are obtained. Finally, according to these initial data, the configuration file in step S100 is configured so that a formal connection can be established with the database through the configuration file during the management process.
[0086] Specifically, in some embodiments, the specific implementation of step S600 can refer to the following embodiments. Figure 4 The detailed description of step S600 in the database management method shown in the corresponding embodiment, in the database management method, the initial data includes the database version and the database type, and step S600 may include the following steps:
[0087] The original resource address is determined according to the database version and database type.
[0088] The configuration file is generated according to the original resource address.
[0089] In an embodiment of the present application, the specific method of generating the configuration file is to first determine the version of the code package and driver package required for this update based on initial information such as the database version and database type, and then determine information such as the original resource address, and finally generate the configuration file.
[0090] In an embodiment of the present application, the preprocessing step not only includes configuring the configuration file, but also includes renaming the management code, program source code and driver package.
[0091] In some embodiments, the initial data includes a database version and error information. After the step S500 of obtaining the initial data returned by the database, the method further includes:
[0092] The driver address is obtained by polling the adaptation information according to the database version.
[0093] A management code is obtained according to the error message and the driver address.
[0094] In this embodiment, the management code is also modified. According to the database version and the error information returned by the database, the code for managing the database in the program itself is modified to adapt it to the database and can be executed normally in the database.
[0095] Specifically, the adaptation information of the database is first polled according to the data version to obtain the corresponding driver address, and then the code for managing the database in the program itself is modified according to the driver address and the error information returned by the database to obtain the management code.
[0096] In some embodiments, the initial data includes a database version and error information. After step S500, the method further includes:
[0097] Modify the source code according to the error information.
[0098] Modify the package name of the driver package according to the database version.
[0099] In this embodiment, the program source code and the package name of the driver package will also be modified. The package name of the driver package can be modified according to the database version, and the source code can be modified according to the error information.
[0100] The following describes an apparatus embodiment of the present application, which can be used to execute the database management 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 management method of the present application.
[0101] Figure 5 A block diagram of a database management device according to an embodiment of the present application is shown.
[0102] Reference Figure 5 As shown, according to an embodiment of the present application, a database management device 500 includes:
[0103] The connection establishment module 510 is used to establish a connection with the database through a configuration file; the code sending module 520 is used to call the corresponding driver according to the configuration file and send a management code to the database so that the database can establish a record table; the data update module 530 is used to update the database according to the record table.
[0104] In some embodiments of the present application, the configuration file includes the original resource address, and the connection establishment module specifically includes: a path determination submodule, used to determine the path of the corresponding driver package according to the original resource address; an address modification submodule, used to modify the original resource address to obtain a modified resource address; a database connection submodule, used to drive the driver package to use the modified resource address to establish a connection with the database according to the driver package path.
[0105] In some embodiments of the present application, the path determination submodule specifically includes: a code package calling unit, used to call the corresponding code package according to the original resource address; and a driver package positioning unit, used to determine the path of the driver package according to the code package.
[0106] In some embodiments of the present application, the address modification submodule specifically includes: an address modification unit, which is used to modify the package name of the target driver package in the original resource address according to a predetermined code to obtain a predetermined modified resource address.
[0107] In some embodiments of the present application, the database connection submodule specifically includes: a driver package calling unit, used to call the corresponding driver package according to the path of the driver package; and a driver package driving unit, used to drive the driver package to use the modified resource address to establish a connection with the database.
[0108] In some embodiments of the present application, the management code includes a check code and an establishment code, and the code sending module specifically includes: a check code sending sub-module, which is used to call the corresponding driver according to the configuration file, send a check code to the database, and determine whether the record table exists in the database; and an establishment code sending sub-module, which is used to send an establishment code to the database if the record table does not exist in the database, so that the database can establish the record table according to the establishment code.
[0109] In some embodiments of the present application, the data update module specifically includes: a file determination submodule, used to determine the target file according to the record table; and a file execution submodule, used to execute the target file to update the database.
[0110] In some embodiments of the present application, the database management device also includes: a pre-connection module, used to pre-connect with the database through an extension interface; a data acquisition module, used to obtain the initial data returned by the database; and a file configuration module, used to configure the configuration file according to the initial data.
[0111] In some embodiments of the present application, the database management device further includes: an information polling module, used to obtain a driver address according to the database version polling adaptation information; and a code modification module, used to obtain a management code according to the error information and the driver address.
[0112] In some embodiments of the present application, the database management device further includes: a source code modification module, used to modify the source code according to the error information; and a package name modification module, used to modify the package name of the driver package according to the database version.
[0113] In some embodiments of the present application, the initial data includes a database version and a database type, and the file configuration module specifically includes: an address determination submodule, used to determine the original resource address according to the database version and the database type; and a file generation submodule, used to generate the configuration file according to the original resource address.
[0114] In an embodiment of the present application, a connection is first established with a database through a configuration file, and then a corresponding driver is called according to the configuration file, and a management code is sent to the database. After a record table is established in the database, the database is updated according to the record table.
[0115] 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.
[0116] 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.
[0117] like Figure 6As 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.
[0118] 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.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] 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 management method, characterized in that: The database management method comprises: Establish a connection with the database through the configuration file; Calling a corresponding driver according to the configuration file, and sending a management code to the database so that the database can establish a record table; The database is updated according to the record table.
2. The database management method according to claim 1, characterized in that: The configuration file includes the original resource address, and the connection with the database is established through the configuration file, specifically including: Determine the path of the corresponding driver package according to the original resource address; Modifying the original resource address to obtain a modified resource address; According to the driver package path, the driver package is driven to establish a connection with the database using the modified resource address.
3. The database management method according to claim 2, characterized in that: Determining the path of the corresponding driver package according to the original resource address specifically includes: According to the original resource address, calling the corresponding code package; According to the code package, a path of the driver package is determined.
4. The database management method according to claim 2, characterized in that: The step of driving the driver package to establish a connection with the database using the modified resource address according to the driver package path specifically includes: According to the path of the driver package, calling the corresponding driver package; The driver package is driven to establish a connection with the database using the modified resource address.
5. The database management method according to claim 1, characterized in that: The management code includes a check code and a creation code. The calling of the corresponding driver according to the configuration file and sending the management code to the database so that the database can create a record table specifically includes: Calling the corresponding driver according to the configuration file, sending a check code to the database to determine whether the record table exists in the database; If the record table does not exist in the database, a creation code is sent to the database so that the database creates the record table according to the creation code.
6. The database management method according to claim 1, characterized in that: The updating of the database according to the record table specifically includes: According to the record table, determining the target file; The target file is executed to update the database.
7. The database management method according to claim 1, characterized in that: Before establishing a connection with the database through the configuration file, the method further includes: Pre-connecting with the database via an extended interface; Obtaining initial data returned by the database; The configuration file is configured according to the initial data.
8. A database management device, characterized in that: The database management device comprises: A connection establishment module is used to establish a connection with a database through a configuration file; A code sending module, used for calling a corresponding driver according to the configuration file, and sending a management code to the database so that the database can establish a record table; A data updating module is used to update the database according to the record table.
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 management 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 management method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Database high availability solution method, connection control device and system
CN104462514A
Application database updating method and device
CN106844772A
Backup method and device for multi-type database data, equipment and storage medium
CN110825802A
Fault processing method and device, server and storage medium
CN112199356A
Method and device for automatically updating data table structure
CN113204558A
