CN112860778B - Database management method, device, equipment and medium for desktop application program - Google Patents

Database management method, device, equipment and medium for desktop application program Download PDF

Info

Publication number
CN112860778B
CN112860778B CN202110303463.5A CN202110303463A CN112860778B CN 112860778 B CN112860778 B CN 112860778B CN 202110303463 A CN202110303463 A CN 202110303463A CN 112860778 B CN112860778 B CN 112860778B
Authority
CN
China
Prior art keywords
database
file
drive
user
driving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110303463.5A
Other languages
Chinese (zh)
Other versions
CN112860778A (en
Inventor
韩兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Commercial Factoring Co ltd
Original Assignee
Ping An Commercial Factoring Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Commercial Factoring Co ltd filed Critical Ping An Commercial Factoring Co ltd
Priority to CN202110303463.5A priority Critical patent/CN112860778B/en
Publication of CN112860778A publication Critical patent/CN112860778A/en
Application granted granted Critical
Publication of CN112860778B publication Critical patent/CN112860778B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases

Abstract

The present application relates to the field of big data technologies, and in particular, to a method, an apparatus, a device, and a medium for managing a database of a desktop application, where the method includes: acquiring a database connection request, wherein the request carries version information and a data source of a database to be connected of desktop application degree; acquiring a database driving file corresponding to a database to be connected, and storing the database driving file into a driving management directory; based on the database driving files in the driving management directory, establishing a corresponding relation between the target driving files and the database driving files; receiving a drive selection instruction; and acquiring connection login information according to the selected target drive, and establishing connection with a data source of the database to be connected. By adopting the method, the operation access efficiency of the database can be improved. The application also relates to the technical field of blockchains, and a database connection request, a database driving file, a driving selection instruction, a corresponding relation, a driving selection instruction, connection login information and the like can be uploaded to the blockchain.

Description

Database management method, device, equipment and medium for desktop application program
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a method, an apparatus, a device, and a medium for managing a database of a desktop application.
Background
With the development of computer technology, various desktop applications are applied to the daily life of people, and the application of enterprises to various desktop applications is also becoming wider and wider.
In the conventional manner, a company isolates a local environment from a testing and generating environment for safety, and cannot be directly connected to a database, and at this time, the database needs to be logged in to a corresponding fort machine, and a corresponding database connection tool, such as pls ql development, navicat, etc., is opened to connect the database. The database connection process is complex and not convenient enough.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a database management method, apparatus, device, and medium for a desktop application that can improve the operation access efficiency of a database.
A method of database management for desktop applications, the method comprising:
acquiring a database connection request, wherein the database connection request carries version information and a data source of a database to be connected, which correspond to the desktop application degree;
Based on the version information, acquiring a database driving file corresponding to the database to be connected, and storing the database driving file into a driving management directory;
based on the database drive files in the drive management directory, establishing a corresponding relation between the target drive and the database drive files in the alternative drive list;
receiving a drive selection instruction, wherein the drive selection instruction is generated when a target drive is selected from an alternative drive list;
and acquiring connection login information according to the selected target drive, and establishing connection with a data source of the database to be connected based on the connection login information.
In one embodiment, establishing a correspondence between a target drive and a database drive file in an alternative drive list based on the database drive file in the drive management directory includes:
analyzing the database driving file under the driving management directory based on a preset analysis mode to obtain file information of the database driving file;
and adding the file information into the static object file, and establishing a corresponding relation between the target drive and the database drive file in the alternative drive list.
In one embodiment, the connection login information includes a drive identification and a data source address of the data source;
Establishing a connection with a data source of the database to be configured based on the connection login information, including:
acquiring file information of a corresponding database driving file from the static object file according to the driving identification;
acquiring a corresponding database starting file based on the file information;
loading a database driving file to obtain a driving object instance corresponding to the target driving;
based on the data source address, a connection between the drive object instance and the data source is established.
In one embodiment, the connection login information further includes user information of a login user;
the method further comprises the following steps:
acquiring user rights of a login user based on user information;
judging whether the login user has a target authority for operating the data source according to the user authority;
when the login user is judged to have the target right for operating the data source, corresponding operation is carried out on the data source according to the received user instruction.
In one embodiment, before obtaining the database connection request, the method further includes:
receiving a user login request, wherein the user login request comprises user information of a user to be logged in;
and sending the user information to a unified authentication platform and receiving the authentication result fed back by the unified authentication platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for authenticating the user information.
In one embodiment, the method further comprises:
and uploading at least one of the database connection request, the database driving file, the driving selection instruction, the corresponding relation, the driving selection instruction and the connection login information to the blockchain node for storage.
A database management apparatus for a desktop application, the apparatus comprising:
the request acquisition module is used for acquiring a database connection request, wherein the database connection request carries version information of a database to be connected and a data source, which correspond to the desktop application degree;
the drive file acquisition module is used for acquiring a database drive file corresponding to the database to be connected based on the version information and storing the database drive file into the drive management directory;
the corresponding relation establishing module is used for establishing a corresponding relation between the target drive and the database drive file in the alternative drive list based on the database drive file in the drive management directory;
the instruction receiving module is used for receiving a drive selection instruction, and the drive selection instruction is generated when a target drive is selected from the alternative drive list;
and the connection establishment module is used for acquiring connection login information according to the selected target driver and establishing connection with a data source of the database to be connected based on the connection login information.
In one embodiment, the correspondence establishing module includes:
the analysis sub-module is used for analyzing the database driving file under the driving management directory based on a preset analysis mode to obtain file information of the database driving file;
and the corresponding relation establishing sub-module is used for adding the file information into the static object file and establishing the corresponding relation between the target drive and the database drive file in the alternative drive list.
A computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods of the embodiments described above when the processor executes the computer program.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the embodiments described above.
According to the database management method, device, equipment and medium of the desktop application program, the database connection request is obtained, version information and a data source of a to-be-connected database corresponding to the desktop application degree are carried in the database connection request, a database driving file of the version information corresponding to the to-be-connected database is obtained based on the version information, and the database driving file is stored in the driving management directory. And then based on the database drive file in the drive management directory, the corresponding relation between the target drive in the alternative drive list and the database drive file. And further receiving a drive selection instruction, wherein the drive selection instruction is generated by selecting a target drive from an alternative drive list, acquiring connection login information according to the drive selection instruction, and establishing connection with a data source of a database to be connected based on the connection login information. Therefore, compared with the traditional mode that a database connection tool is required to be opened through a fort machine and then the database is connected, the connection processing flow of the database is simplified, and the operation access efficiency of the database can be improved.
Drawings
FIG. 1 is an application scenario diagram of a database management method for a desktop application in one embodiment;
FIG. 2 is a flow diagram of a method of database management for a desktop application, in one embodiment;
FIG. 3 is a block diagram of a database management device of a desktop application in one embodiment;
fig. 4 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The database management method of the desktop application program can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The user may input version information and data source information of the database to be connected through the terminal 102, then generate a database connection request, and send the database connection request to the server 104, where the database connection request carries version information and data source of the database to be connected corresponding to the desktop application degree. After obtaining the database connection request, the server 104 may obtain a database driver file corresponding to the database to be connected based on the version information, and store the database driver file in the driver management directory. Then, the server 104 may establish a correspondence between the target drive in the candidate drive list and the database drive file based on the database drive file in the drive management directory, and receive a drive selection instruction, which is generated when the target drive is selected from the candidate drive list. Further, the server 104 may obtain connection login information according to the drive selection instruction, and establish a connection with a data source of the database to be connected based on the connection login information. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 104 may be implemented by a stand-alone server or a server cluster composed of a plurality of servers.
In one embodiment, as shown in fig. 2, a database management method for a desktop application is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
step S202, a database connection request is obtained, wherein the database connection request carries version information of a database to be connected and a data source, which correspond to the desktop application degree.
The database connection request refers to a request for requesting to connect a database of the desktop application, and the request may carry version information and a data source of the database to be connected corresponding to the desktop application.
In this embodiment, the version information is used to indicate the version of the database, for example, version V1 or version V2, or may also refer to the database type of a different database.
In this embodiment, the user may input information corresponding to the database, such as version information, name, data source address, etc., through the terminal interface, generate a database connection request, and then send the database connection request to the server, so that the server performs subsequent processing.
Step S204, based on the version information, obtaining a database driving file corresponding to the database to be connected, and storing the database driving file into a driving management directory.
The drive management directory refers to a specific directory for storing database drive files.
In this embodiment, the user may upload the database driver file to the server through the terminal, so that the server may obtain the database driver file.
In this embodiment, the server may select a database driver file of a corresponding version according to the obtained version information, and store the database driver file in a fixed driver management directory. For example, consider the addition of mysql version 5.1.46 database drivers. Firstly, a server locally prepares a database driving file with a corresponding version, such as mysql-connector-java-5.1.46.Jar, and then the server receives the database driving file uploaded by a user on a database driving management page and stores the database driving file under a specific driving management directory.
Step S206, based on the database drive files in the drive management directory, establishing a corresponding relation between the target drive and the database drive files in the alternative drive list.
In this embodiment, the server may parse the database driver file in the driver management directory to obtain file data corresponding to the database driver file.
Further, the server may add the file data to a specified mapping table to establish a target drive in the alternative drive table and establish a correspondence between the target drive and a corresponding database drive file.
Step S208, a drive selection instruction is received, wherein the drive selection instruction is generated when a target drive is selected from the candidate drive list.
Specifically, the server may render and display the candidate driver list in the terminal interface, and the user generates a corresponding driver selection instruction through selecting the target driver on the terminal page and sends the driver selection instruction to the server.
Specifically, the user selects the database driver by pulling down on the terminal interface, and the options are a list of driver names of various drivers that have been added, that is, an alternative driver list, in which the driver names of the target drivers may be included.
Further, the user can select the target driver through the terminal, so that a driver selection instruction is generated and sent to the server.
Step S210, obtaining connection login information according to the selected target drive, and establishing connection with a data source of the database to be connected based on the connection login information.
In this embodiment, when the server receives the drive selection instruction, the server may obtain the connection login information selection template corresponding to the database connection according to the target drive carried in the instruction, and send the connection login information selection template to the terminal interface for display, so that the user may input the connection login information through the terminal interface.
Furthermore, the user can input connection login information through the terminal interface, and the input connection input information is sent to the server through triggering a confirmation control or a sending control on the terminal page, so that the server can acquire the connection input information input by the user.
In this embodiment, the connection login information may include information such as data source address information, a user name, a password, and the like, and may also include information such as a drive name or a drive ID.
In this embodiment, after obtaining the connection login information, the server may obtain the corresponding relationship between the target driver and the database driver file according to the driver ID or the driver identifier in the connection login information, and then obtain the database driver file, so as to establish connection with the database to be connected through the database driver file.
In this embodiment, after the terminal connects to the database, the terminal may perform corresponding processing operations, for example, writing, changing, deleting, etc. the database.
In the database management method of the desktop application program, the database connection request is obtained, version information and a data source of a to-be-connected database corresponding to the desktop application degree are carried in the database connection request, a database driving file of the version information corresponding to the to-be-connected database is obtained based on the version information, and the database driving file is stored in the driving management directory. And then based on the database drive file in the drive management directory, the corresponding relation between the target drive in the alternative drive list and the database drive file. And further receiving a drive selection instruction, wherein the drive selection instruction is generated when a target drive is selected from the alternative drive list, acquiring connection login information according to the selected target drive, and establishing connection with a data source of a database to be connected based on the connection login information. Therefore, compared with the traditional mode that a database connection tool is required to be opened through a fort machine and then the database is connected, the connection processing flow of the database is simplified, and the operation access efficiency of the database can be improved.
In one embodiment, based on the database driver file in the driver management directory, establishing the correspondence between the target driver and the database driver file in the candidate driver list may include: analyzing the database driving file under the driving management directory based on a preset analysis mode to obtain file information of the database driving file; and adding the file information into the static object file, and establishing a corresponding relation between the target drive and the database drive file in the alternative drive list.
In this embodiment, the server may obtain, by means of file parsing, a drive class file name and a physical address of a file included in the drive file, that is, file information of the database drive file. In this embodiment, the server may use the java's file processing class to access an internal file, so as to achieve the purpose of parsing, and obtain the file information of the database driving file.
Further, the server may add the file information to the static object file to obtain the target drive added to the candidate drive list, for example, add the drive class file name and the physical address of the file to the static map object to obtain the target drive added to the candidate drive list, thereby establishing a correspondence between the target drive in the candidate drive list and the database drive file.
In one embodiment, the connection login information may include a drive identification and a data source address of the data source.
In this embodiment, establishing a connection with a data source of the database to be configured based on the connection login information may include: acquiring file information of a corresponding database driving file from the static object file according to the driving identification; acquiring a corresponding database starting file based on the file information; loading a database driving file to obtain a driving object instance corresponding to the target driving; based on the data source address, a connection between the drive object instance and the data source is established.
The drive identifier is an identifier indicating the drive uniqueness, and may be referred to as a drive ID. The data source address is a storage address or location address of the data source.
In this embodiment, after obtaining the connection login information, the server may find file information of the corresponding drive file, that is, a drive class file name, a physical address of the file, and the like, from the static object file, that is, the static map object, in a key search manner according to the drive ID, according to the drive identifier in the connection login information.
Further, the server can dynamically load the queried database driving file by using the class loading function of java. After the drive loading is completed, a corresponding drive object instance can be obtained.
Further, the server may create a database connection according to a data source address, that is, a data source URL (Uniform Resource Locator ), establish a connection between the driving object instance and the data source, and execute a simple query statement, if the connection is successful and the query is successful, the database is configured successfully, and if the connection is failed, a corresponding error reporting prompt is generated, and the error reporting prompt may include an error reporting cause, and the server may perform a problem inspection according to the error reporting cause and perform a problem solving.
In this embodiment, the loading driver is a java-based dynamic class loading mechanism, so that the loading driver can be realized by only providing the loaded class name and the corresponding jar packet file without restarting.
In this embodiment, for a plurality of data sources, different driving instances corresponding to different driving instances can be obtained based on different database driving, and then connection of the data sources can be completed according to corresponding data source addresses, so as to complete configuration of the database.
In one embodiment, the connection login information may also include user information of the logged-in user.
The user information may refer to information such as a user name and a password of the user.
In this embodiment, the method may further include: acquiring user rights of a login user based on user information; judging whether the login user has a target authority for operating the data source according to the user authority; when the login user is judged to have the target right for operating the data source, corresponding operation is carried out on the data source according to the received user instruction.
In this embodiment, the server may query and acquire user rights of the user, such as deletion rights, addition rights, update rights, search rights, and the like, based on the user information.
Further, the server can judge whether the login user operates the target authority of the data source according to the inquired user authority. Specifically, when the user has the target authority to add the data source, the user can perform addition, modification, and the like of the data source.
In this embodiment, when the server determines that the login user does not have the target authority for operating the data source, the server may generate a prompt message and send the prompt message to the terminal to issue a case, so as to prompt the current login user that the login user does not have the corresponding authority.
In this embodiment, when the server determines that the login user has the target right to add the data source, the server may perform a corresponding operation on the data source according to the received user instruction.
In this embodiment, the server may perform the assignment of rights by authorizing the administrator, for example, the data sources may be added, edited, authorized, etc. by the administrator.
In this embodiment, the authorization manner may be divided into group authorization and user authorization. Group authorization refers to grouping certain users into a group, and directly giving the group the right to add a data source, so that all users under the group can have the right to add the data source. User authorization refers to the direct assignment of rights to add a data source to a particular user.
In this embodiment, the authorization scope may include adding (Create), e.g., adding table structure, adding table data, retrieving (Retrieve), e.g., table data querying, filtering operation, updating (Update), e.g., updating table structure, updating table data, and deleting (Delete), e.g., deleting table structure, deleting table data, etc.
In this embodiment, after the administrator authorization, the authorized user can use the data source to perform operations within the rights, but cannot add and modify the data source. When a user needs to newly establish a data table or insert data into the table, the user needs to have an increasing authority; when a user needs to inquire data in a table, the user needs to have retrieval authority; when a user needs to update a table structure (including but not limited to adding a table field, modifying a table field type, deleting a table field) or updating data in a table, the user needs to have update authority; when a user needs to delete a table or delete data in a table, deletion authority is required.
In the above embodiment, the user permission of the login user is obtained based on the user information, and then, according to the user permission, it is determined whether the login user has the target permission to operate the data source, and when it is determined that the login user has the target permission to operate the data source, the corresponding operation is performed on the data source according to the received user instruction. Therefore, the management of the database can be enhanced, connection errors and the like caused by random addition of data sources, modification of the data sources and the like by a user are avoided, and the stability of the management system is ensured.
In one embodiment, before acquiring the database connection request, the method may further include: receiving a user login request, wherein the user login request comprises user information of a user to be logged in; and sending the user information to a unified authentication platform and receiving the authentication result fed back by the unified authentication platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for authenticating the user information.
The user login request refers to a request for logging in the database management system of the application, and the request may include user information of a user to be logged in, for example, a user name, a user password, a graphic verification code, and the like.
The unified authentication platform is a platform which is in butt joint with a plurality of management systems, and can verify user information of the plurality of management systems so as to realize single sign-on of a user to be logged in the plurality of management systems. The unified authentication platform may be a central authentication service (Central Authentication Service, CAS) or the like.
In this embodiment, the user may input user information such as a user name, a password, and a corresponding image verification code on a terminal display interface of the management system, generate a user login request, and then send the user login request to the server by calling a user authentication interface.
In this embodiment, after receiving the user login request, the server may analyze the user login request to analyze the user information, for example, obtain the user name and password of the user requesting login, the graphical verification code input by the user, and the actual graphical verification code.
Further, the server may send the user information obtained by the analysis to a unified authentication platform, and verify the user information through the unified authentication platform.
In this embodiment, after receiving the user information, the unified authentication platform may verify the graphic verification code input by the user and the actual graphic verification code to determine whether the user information is consistent with the actual graphic verification code.
In this embodiment, when the unified authentication platform determines that the graphic verification code input by the user is inconsistent with the actual graphic verification code, an error prompt message may be generated and fed back to the server, and then fed back to the terminal interface, so as to prompt the user to input an error. And when the server determines that the graphic verification code input by the user is consistent with the actual graphic verification code, verifying the user name and the password.
In this embodiment, the unified authentication platform verifies the user according to the received user name and password, and authenticates whether the user name and password are paired. When the unified authentication platform determines that the user name and the password are matched, the user information can be determined to be successfully verified, and the unified authentication platform can bind the user according to the user name of the current login user.
In this embodiment, if a user corresponding to the user name exists in the unified authentication platform, a valid login token is created for the user, and the token is considered to be logged in if valid, so that automatic login of the user in a plurality of different management systems is realized. If the unified authentication platform does not have the user corresponding to the user name, the unified authentication platform can add a piece of information for the user and return an effective login token to finish the verification of the user.
In this embodiment, after the user to be logged in completes verification through the unified authentication platform, the user login is completed, and then subsequent processing can be performed.
In this embodiment, by receiving a user login request and sending user information carried in the user request to the unified authentication platform, and verifying by the unified authentication platform, single sign-on to multiple management platforms can be achieved, and efficiency of sign-on verification is improved.
In one embodiment, the method may further include: and uploading at least one of the database connection request, the database driving file, the driving selection instruction, the corresponding relation, the driving selection instruction and the connection login information to the blockchain node for storage.
The blockchain refers to a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The Block chain is essentially a decentralised database, and is a series of data blocks which are generated by correlation using a cryptography method, and each data Block contains information of a batch of network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating a next Block.
Specifically, the blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
In this embodiment, the server may upload and store one or more data of the database connection request, the database driver file, the driver selection instruction, the correspondence, the driver selection instruction, and the connection login information in a node of the blockchain, so as to ensure privacy and security of the data.
In the above embodiment, at least one of the database connection request, the database driving file, the driving selection instruction, the correspondence, the driving selection instruction and the connection login information is uploaded to the blockchain and stored in the node of the blockchain, so that the privacy of the data stored in the blockchain link point can be ensured, and the security of the data can be improved.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
In one embodiment, as shown in fig. 3, there is provided a database management apparatus of a desktop application, including: the device comprises a request acquisition module 100, a driving file acquisition module 200, a corresponding relation establishment module 300, an instruction receiving module 400 and a connection establishment module 500, wherein:
the request obtaining module 100 is configured to obtain a database connection request, where the database connection request carries version information of a database to be connected and a data source corresponding to the desktop application degree.
The driving file obtaining module 200 is configured to obtain a database driving file corresponding to the database to be connected based on the version information, and store the database driving file in the driving management directory.
The correspondence establishing module 300 is configured to establish a correspondence between the target driver and the database driver file in the candidate driver list based on the database driver file in the driver management directory.
The instruction receiving module 400 is configured to receive a drive selection instruction, where the drive selection instruction is generated when a target drive is selected from the candidate drive list.
The connection establishment module 500 is configured to obtain connection login information according to the selected target driver, and establish connection with a data source of the database to be connected based on the connection login information.
In one embodiment, the correspondence establishing module 300 may include:
and the analysis sub-module is used for analyzing the database driving file under the driving management directory based on a preset analysis mode to obtain the file information of the database driving file.
And the corresponding relation establishing sub-module is used for adding the file information into the static object file and establishing the corresponding relation between the target drive and the database drive file in the alternative drive list.
In one embodiment, the connection login information may include a drive identification and a data source address of the data source.
In this embodiment, the connection establishment module 500 may include:
and the file information acquisition sub-module is used for acquiring file information of the corresponding database driving file from the static object file according to the driving identification.
And the database starting file acquisition sub-module is used for acquiring the corresponding database starting file based on the file information.
And the loading sub-module is used for loading the database driving file to obtain a driving object instance corresponding to the target driving.
And the connection establishment sub-module is used for establishing connection between the driving object instance and the data source based on the data source address.
In one embodiment, the connection login information may also include user information of the logged-in user.
In this embodiment, the apparatus may further include:
and the user right acquisition module is used for acquiring the user right of the login user based on the user information.
The judging module is used for judging whether the login user has the target authority for operating the data source according to the user authority; when the login user is judged to have the target right for operating the data source, corresponding operation is carried out on the data source according to the received user instruction.
In one embodiment, the apparatus may further include:
and the user login request receiving module is used for receiving a user login request before acquiring the database connection request, wherein the user login request comprises user information of a user to be logged in.
And the authentication module is used for sending the user information to the unified authentication platform and receiving the authentication result fed back by the unified authentication platform, the unified authentication platform is used for being connected with a plurality of management systems, and the unified authentication platform is used for authenticating the user information.
In one embodiment, the apparatus may further include:
and the storage module is used for uploading at least one of the database connection request, the database driving file, the driving selection instruction, the corresponding relation, the driving selection instruction and the connection login information to the blockchain node for storage.
For specific limitations of the database management apparatus of the desktop application, reference may be made to the above limitation of the database management method of the desktop application, and no further description is given here. The various modules in the database management device of the desktop application described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing database connection requests, database driving files, driving selection instructions, corresponding relations, driving selection instructions, connection login information and other data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a database management method for desktop applications.
Those skilled in the art will appreciate that the structures shown in FIG. 4 are block diagrams only and do not constitute a limitation of the computer device on which the present aspects apply, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory storing a computer program and a processor that when executing the computer program performs the steps of: acquiring a database connection request, wherein the database connection request carries version information and a data source of a database to be connected, which correspond to the desktop application degree; based on the version information, acquiring a database driving file corresponding to the database to be connected, and storing the database driving file into a driving management directory; based on the database drive files in the drive management directory, establishing a corresponding relation between the target drive and the database drive files in the alternative drive list; receiving a drive selection instruction, wherein the drive selection instruction is generated when a target drive is selected from an alternative drive list; and acquiring connection login information according to the selected target drive, and establishing connection with a data source of the database to be connected based on the connection login information.
In one embodiment, the processor when executing the computer program realizes that the corresponding relationship between the target drive and the database drive file in the candidate drive list is established based on the database drive file in the drive management directory, and may include: analyzing the database driving file under the driving management directory based on a preset analysis mode to obtain file information of the database driving file; and adding the file information into the static object file, and establishing a corresponding relation between the target drive and the database drive file in the alternative drive list.
In one embodiment, the connection login information may include a drive identification and a data source address of the data source.
In this embodiment, the implementation of establishing a connection with a data source of a database to be configured based on connection login information when the processor executes the computer program may include: acquiring file information of a corresponding database driving file from the static object file according to the driving identification; acquiring a corresponding database starting file based on the file information; loading a database driving file to obtain a driving object instance corresponding to the target driving; based on the data source address, a connection between the drive object instance and the data source is established.
In one embodiment, the connection login information may also include user information of the logged-in user.
In this embodiment, the following steps may also be implemented when the processor executes the computer program: acquiring user rights of a login user based on user information; judging whether the login user has a target authority for operating the data source according to the user authority; when the login user is judged to have the target right for operating the data source, corresponding operation is carried out on the data source according to the received user instruction.
In one embodiment, before the processor executes the computer program to obtain the database connection request, the following steps may be further implemented: receiving a user login request, wherein the user login request comprises user information of a user to be logged in; and sending the user information to a unified authentication platform and receiving the authentication result fed back by the unified authentication platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for authenticating the user information.
In one embodiment, the following steps may also be implemented when the processor executes the computer program: and uploading at least one of the database connection request, the database driving file, the driving selection instruction, the corresponding relation, the driving selection instruction and the connection login information to the blockchain node for storage.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a database connection request, wherein the database connection request carries version information and a data source of a database to be connected, which correspond to the desktop application degree; based on the version information, acquiring a database driving file corresponding to the database to be connected, and storing the database driving file into a driving management directory; based on the database drive files in the drive management directory, establishing a corresponding relation between the target drive and the database drive files in the alternative drive list; receiving a drive selection instruction, wherein the drive selection instruction is generated when a target drive is selected from an alternative drive list; and acquiring connection login information according to the selected target drive, and establishing connection with a data source of the database to be connected based on the connection login information.
In one embodiment, the computer program when executed by the processor implements establishing a correspondence between the target driver and the database driver file in the candidate driver list based on the database driver file in the driver management directory, and may include: analyzing the database driving file under the driving management directory based on a preset analysis mode to obtain file information of the database driving file; and adding the file information into the static object file, and establishing a corresponding relation between the target drive and the database drive file in the alternative drive list.
In one embodiment, the connection login information may include a drive identification and a data source address of the data source.
In this embodiment, the computer program when executed by the processor realizes establishing a connection with a data source of the database to be configured based on the connection login information, and may include: acquiring file information of a corresponding database driving file from the static object file according to the driving identification; acquiring a corresponding database starting file based on the file information; loading a database driving file to obtain a driving object instance corresponding to the target driving; based on the data source address, a connection between the drive object instance and the data source is established.
In one embodiment, the connection login information may also include user information of the logged-in user.
In this embodiment, the computer program may further implement the following steps when executed by a processor: acquiring user rights of a login user based on user information; judging whether the login user has a target authority for operating the data source according to the user authority; when the login user is judged to have the target right for operating the data source, corresponding operation is carried out on the data source according to the received user instruction.
In one embodiment, the following steps may also be implemented before the computer program when executed by the processor implements the obtaining of the database connection request: receiving a user login request, wherein the user login request comprises user information of a user to be logged in; and sending the user information to a unified authentication platform and receiving the authentication result fed back by the unified authentication platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for authenticating the user information.
In one embodiment, the computer program when executed by the processor may further implement the steps of: and uploading at least one of the database connection request, the database driving file, the driving selection instruction, the corresponding relation, the driving selection instruction and the connection login information to the blockchain node for storage.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method for database management of desktop applications, the method comprising:
acquiring a database connection request, wherein the database connection request carries version information of a database to be connected and a data source, which correspond to the desktop application degree;
based on the version information, acquiring a database driving file corresponding to the database to be connected, and storing the database driving file into a driving management directory;
Based on the database drive file in the drive management directory, establishing a corresponding relation between a target drive in an alternative drive list and the database drive file;
receiving a drive selection instruction, wherein the drive selection instruction is generated when the target drive is selected from the alternative drive list;
acquiring connection login information according to the selected target drive, and establishing connection with a data source of the database to be connected based on the connection login information;
the establishing a corresponding relation between the target drive in the candidate drive list and the database drive file based on the database drive file in the drive management directory comprises the following steps:
analyzing the database driving file under the driving management directory based on a preset analysis mode to obtain file information of the database driving file;
and adding the file information into a static object file, and establishing a corresponding relation between a target drive in an alternative drive list and the database drive file.
2. The method of claim 1, wherein the connection login information includes a drive identification and a data source address of the data source;
The establishing connection with the data source of the database to be connected based on the connection login information comprises the following steps:
acquiring file information of a corresponding database driving file from the static object file according to the driving identification;
acquiring a corresponding database starting file based on the file information;
loading the database driving file to obtain a driving object instance corresponding to the target driving;
based on the data source address, a connection between the driving object instance and the data source is established.
3. The method of claim 2, wherein the connection login information further includes user information of a login user;
the method further comprises the steps of:
acquiring user rights of the login user based on the user information;
judging whether the login user has a target authority for operating a data source according to the user authority;
and when the login user is judged to have the target right for operating the data source, corresponding operation is carried out on the data source according to the received user instruction.
4. The method of claim 1, wherein prior to the obtaining the database connection request, further comprising:
Receiving a user login request, wherein the user login request comprises user information of a user to be logged in;
and sending the user information to a unified authentication platform and receiving a verification result fed back by the unified authentication platform, wherein the unified authentication platform is used for being connected with a plurality of management systems, and the unified authentication platform is used for verifying the user information.
5. The method according to any one of claims 1 to 4, further comprising:
and uploading at least one of the database connection request, the database driving file, the driving selection instruction, the corresponding relation, the driving selection instruction and the connection login information to a blockchain node for storage.
6. A database management apparatus for a desktop application, the apparatus comprising:
the request acquisition module is used for acquiring a database connection request, wherein the database connection request carries version information of a database to be connected and a data source, which correspond to the application degree of the desktop;
the drive file acquisition module is used for acquiring a database drive file corresponding to the database to be connected based on the version information and storing the database drive file into a drive management directory;
The corresponding relation establishing module is used for establishing a corresponding relation between a target drive in the alternative drive list and the database drive file based on the database drive file in the drive management directory;
the instruction receiving module is used for receiving a drive selection instruction, and the drive selection instruction is generated when the target drive is selected from the alternative drive list;
the connection establishment module is used for acquiring connection login information according to the selected target drive and establishing connection with a data source of the database to be connected based on the connection login information;
the corresponding relation establishing module comprises:
the analysis sub-module is used for analyzing the database driving file under the driving management directory based on a preset analysis mode to obtain file information of the database driving file;
and the corresponding relation establishing sub-module is used for adding the file information into a static object file and establishing a corresponding relation between a target drive in the alternative drive list and the database drive file.
7. The apparatus of claim 6, wherein the connection login information includes a drive identification and a data source address of the data source;
The connection establishment module comprises:
the file information acquisition sub-module is used for acquiring file information of a corresponding database driving file from the static object file according to the driving identification;
the database starting file acquisition sub-module is used for acquiring a corresponding database starting file based on the file information;
the loading sub-module is used for loading the database driving file to obtain a driving object instance corresponding to the target driving;
and the connection establishment sub-module is used for establishing connection between the driving object instance and the data source based on the data source address.
8. The apparatus of claim 7, wherein the connection login information further includes user information of a login user;
the apparatus further comprises:
the user right acquisition module is used for acquiring the user right of the login user based on the user information;
the judging module is used for judging whether the login user has a target authority for operating a data source according to the user authority; and when the login user is judged to have the target right for operating the data source, corresponding operation is carried out on the data source according to the received user instruction.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 5 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
CN202110303463.5A 2021-03-22 2021-03-22 Database management method, device, equipment and medium for desktop application program Active CN112860778B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110303463.5A CN112860778B (en) 2021-03-22 2021-03-22 Database management method, device, equipment and medium for desktop application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110303463.5A CN112860778B (en) 2021-03-22 2021-03-22 Database management method, device, equipment and medium for desktop application program

Publications (2)

Publication Number Publication Date
CN112860778A CN112860778A (en) 2021-05-28
CN112860778B true CN112860778B (en) 2024-04-05

Family

ID=75991864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110303463.5A Active CN112860778B (en) 2021-03-22 2021-03-22 Database management method, device, equipment and medium for desktop application program

Country Status (1)

Country Link
CN (1) CN112860778B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113468380A (en) * 2021-06-30 2021-10-01 杭州玳数科技有限公司 Data export method
CN114253480A (en) * 2021-12-21 2022-03-29 北京云迹科技股份有限公司 Data storage method and device, electronic equipment and storage medium
CN114979117A (en) * 2022-05-17 2022-08-30 中国银行股份有限公司 Data transmission method and related equipment
CN115809102A (en) * 2022-12-22 2023-03-17 北京航星永志科技有限公司 Data source configuration device, method and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357848A (en) * 2017-06-27 2017-11-17 中国电子科技集团公司第二十八研究所 Database synchronization method based on driving encapsulation
CN109997126A (en) * 2016-11-27 2019-07-09 亚马逊科技公司 Event-driven is extracted, transformation, loads (ETL) processing
CN112131590A (en) * 2020-09-28 2020-12-25 平安国际智慧城市科技股份有限公司 Database connection establishing method and device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109997126A (en) * 2016-11-27 2019-07-09 亚马逊科技公司 Event-driven is extracted, transformation, loads (ETL) processing
CN107357848A (en) * 2017-06-27 2017-11-17 中国电子科技集团公司第二十八研究所 Database synchronization method based on driving encapsulation
CN112131590A (en) * 2020-09-28 2020-12-25 平安国际智慧城市科技股份有限公司 Database connection establishing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112860778A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN112860778B (en) Database management method, device, equipment and medium for desktop application program
CN110365670B (en) Blacklist sharing method and device, computer equipment and storage medium
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN111428263B (en) Work order processing method, device, computer equipment and storage medium
WO2021003977A1 (en) Default information query method and apparatus, and computer device and storage medium
CN111563365B (en) Method and device for processing modification information of test standard worksheet and computer equipment
CN109831435B (en) Database operation method, system, proxy server and storage medium
CN109460252B (en) Configuration file processing method and device based on git and computer equipment
CN110647540A (en) Business data query method and device, computer equipment and storage medium
US10650153B2 (en) Electronic document access validation
CN111898102A (en) Authority configuration method and device, computer equipment and storage medium
CN113872990B (en) VPN network certificate authentication method and device based on SSL protocol and computer equipment
WO2021169469A1 (en) Voiceprint data processing method and apparatus, computer device, and storage medium
CN110597820A (en) Block chain based information processing method and device, storage medium and equipment
CN111339551A (en) Data verification method and related device and equipment
CN112685077A (en) Data modification method, system, computer device and computer readable storage medium
CN115004666A (en) Registration method, device, equipment and storage medium of Internet of things equipment
US9866537B2 (en) Systems and methods for long universal resource locator compression
CN112583890B (en) Message pushing method and device based on enterprise office system and computer equipment
CN116010926A (en) Login authentication method, login authentication device, computer equipment and storage medium
CN112597118B (en) Shared file adding method and device
CN111143399B (en) Data processing method, device, storage medium and computer equipment
CN114461912A (en) Information processing method and device, electronic equipment and storage medium
CN113360868A (en) Application program login method and device, computer equipment and storage medium
CN111552551A (en) User management method and device based on master-slave system, computer equipment and medium

Legal Events

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