CN112860778A - 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
CN112860778A
CN112860778A CN202110303463.5A CN202110303463A CN112860778A CN 112860778 A CN112860778 A CN 112860778A CN 202110303463 A CN202110303463 A CN 202110303463A CN 112860778 A CN112860778 A CN 112860778A
Authority
CN
China
Prior art keywords
database
drive
file
user
connection
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.)
Granted
Application number
CN202110303463.5A
Other languages
Chinese (zh)
Other versions
CN112860778B (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

Images

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

Landscapes

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

Abstract

The application relates to the technical field of big data, in particular to a database management method, a device, equipment and a medium for desktop application programs, which comprises the following steps: acquiring a database connection request, wherein the request carries version information and a data source of a database to be connected of the desktop application degree; acquiring a database drive file corresponding to a database to be connected, and storing the database drive file into a drive management directory; establishing a corresponding relation between a target drive and a database drive file based on the database drive file in the drive management directory; receiving a drive selection instruction; and acquiring connection login information according to the selected target driver, 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 block chains, and the database connection request, the database drive file, the drive selection instruction, the corresponding relation, the drive selection instruction, the connection login information and the like can be uploaded to the block chain.

Description

Database management method, device, equipment and medium for desktop application program
Technical Field
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.
Background
With the development of computer technology, various desktop applications are applied to life practices of people, and enterprises apply various desktop applications more and more widely.
In the conventional method, a company isolates a local environment from a test and generation environment for safety and cannot directly connect to a database, and at this time, an operation database needs to log in a corresponding bastion machine and open a corresponding database connection tool, such as PLSQL Developer, navicat, and the like, so as to connect to the database. The database connection process is auxiliary and not convenient enough.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a device, and a medium for managing a database of a desktop application, which can improve the operation access efficiency of the database.
A method of database management of a desktop application, 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 corresponding to the desktop application degree;
based on the version information, acquiring a database drive file corresponding to the database to be connected, and storing the database drive file into a drive management directory;
establishing a corresponding relation 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;
receiving a drive selection instruction, wherein the drive selection instruction is generated when a target drive is selected from the alternative drive list;
and 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, establishing a correspondence between a target drive in an alternative drive list and a database drive file based on the database drive file in the drive management directory includes:
analyzing the database drive file under the drive management directory based on a preset analysis mode to obtain file information of the database drive 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 connection with a data source of the database to be configured based on the connection login information, wherein the connection comprises the following steps:
acquiring file information corresponding to the database drive file from the static object file according to the drive identifier;
acquiring a corresponding database starting file based on the file information;
loading a database drive file to obtain a drive object example corresponding to a target drive;
and establishing connection between the driving object instance and the data source based on the data source address.
In one embodiment, the connection login information further includes user information of the login user;
the method further comprises the following steps:
acquiring user authority of a login user based on user information;
judging whether a login user has a target authority for operating a data source or not according to the user authority;
and when the login user is judged to have the target right of operating the data source, performing corresponding operation on the data source according to the received user instruction.
In one embodiment, before acquiring 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 the unified authentication platform and receiving a verification result fed back by the unified verification platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for verifying the user information.
In one embodiment, the method further includes:
and uploading at least one of the database connection request, the database drive file, the drive selection instruction, the corresponding relation, the drive selection instruction and the connection login information to the block chain node for storage.
A database management apparatus of a desktop application, the apparatus comprising:
the system comprises a request acquisition module, a database connection request processing module and a data source acquisition module, wherein the request acquisition module is used for acquiring a database connection request which carries version information of a to-be-connected database corresponding to the desktop application degree and the data source;
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 the 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 command receiving module is used for receiving a drive selection command, and the drive selection command is generated when a target drive is selected from the alternative drive list;
and the connection establishing module is used for acquiring the connection login information according to the selected target driver and establishing connection with the data source of the database to be connected based on the connection login information.
In one embodiment, the correspondence relationship establishing module includes:
the analysis submodule is used for analyzing the database drive file under the drive management directory based on a preset analysis mode to obtain file information of the database drive file;
and the corresponding relation establishing submodule 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 the method of any of the above embodiments when the processor executes the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any of the above embodiments.
According to the method, the device, the equipment and the medium for managing the database of the desktop application program, the database connection request is obtained, the database connection request carries the version information of the database to be connected and the data source corresponding to the desktop application degree, the database driving file of the version information corresponding to the database to be connected is obtained based on the version information, and the database driving file is stored into the driving management directory. And then, based on the database drive file in the drive management directory, the corresponding relation between the target drive and the database drive file in the alternative drive list. And further receiving a drive selection instruction, wherein the drive selection instruction is generated by selecting a target drive from the alternative drive list, acquiring connection login information according to the drive selection instruction, and establishing connection with a data source of the database to be connected based on the connection login information. Therefore, compared with the traditional mode that a database connection tool needs to be opened through a bastion 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 a diagram illustrating an example of an application scenario of a database management method for desktop applications in one embodiment;
FIG. 2 is a flow diagram that illustrates a methodology for database management of a desktop application in one embodiment;
FIG. 3 is a block diagram of a database management apparatus of a desktop application in one embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The database management method of the desktop application program can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. A user can input version information and data source information of a to-be-connected database 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 the version information and the data source of the to-be-connected database 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 corresponding relationship between the target driver in the candidate driver list and the database driver file based on the database driver file in the driver management directory, and receive a driver selection instruction, where the driver selection instruction is generated when the target driver is selected from the candidate driver list. Further, the server 104 may obtain the connection login information according to the driving selection instruction, and establish a connection with the 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, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a database management method for desktop applications is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
step S202, a database connection request is obtained, wherein the database connection request carries version information of a to-be-connected database corresponding to the desktop application degree and a data source.
The database connection request refers to a request for connecting 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 the present embodiment, the version information is used to indicate the database version, for example, V1 version or V2 version, or may also refer to the database type of different databases.
In this embodiment, a user may input information corresponding to the database, such as version information, name, data source address, and the like, 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.
And step S204, acquiring a database driving file corresponding to the database to be connected based on the version information, and storing the database driving file into a driving management directory.
The drive management directory refers to a directory for storing a specific database drive file.
In this embodiment, a user may upload a database driver file to a server through a terminal, so that the server may obtain the database driver file.
In this embodiment, the server may select a database drive file of a corresponding version according to the acquired version information, and store the database drive file in the fixed drive management directory. For example, take the example of adding mysql5.1.46 version database drivers. Firstly, the server prepares a database drive file with a corresponding version locally, such as mysql-connector-java-5.1.46.jar ", and then the server receives the database drive file uploaded by a user on a database drive management page and stores the database drive file in a specific drive management directory.
Step S206, based on the database driver file in the driver management directory, a corresponding relationship between the target driver and the database driver file in the candidate driver list is established.
In this embodiment, the server may analyze 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, receiving a drive selection instruction, where the drive selection instruction is generated when the target drive is selected from the candidate drive list.
Specifically, the server may render and display the candidate drive list in the terminal interface, and the user generates a corresponding drive selection instruction by selecting a target drive on the terminal page and sends the drive selection instruction to the server.
Specifically, the user selects a database driver by pulling down and pulling up on the terminal interface, and the option is a list of driver names of various drivers that have been added, that is, a list of alternative drivers, and the list of alternative drivers may include the driver name of the target driver.
Further, the user can select the target driver through the terminal, so that a driver selection instruction is generated and sent to the server.
And step S210, 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 this embodiment, when receiving the drive selection instruction, the server may obtain a connection login information selection template corresponding to the database connection according to the target drive of the sole 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.
Further, a user can input connection login information through a terminal interface, and the input connection input information is sent to the server through triggering of a confirmation control or a sending control on a terminal page, so that the server can obtain 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 further include information such as a drive name or a drive ID.
In this embodiment, after acquiring the connection login information, the server may acquire a 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, then acquire the database driver file, and further establish a connection with the database to be connected through the database driver file.
In this embodiment, after the terminal is connected to the database, corresponding processing operations, such as writing, changing, deleting, etc., may be performed on the database.
In the database management method of the desktop application program, the database connection request is acquired, the database connection request carries the version information and the data source of the database to be connected corresponding to the desktop application degree, the database drive file of the version information corresponding to the database to be connected is acquired based on the version information, and the database drive file is stored in the drive management directory. And then, based on the database drive file in the drive management directory, the corresponding relation between the target drive and the database drive file in the alternative drive list. 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 the database to be connected based on the connection login information. Therefore, compared with the traditional mode that a database connection tool needs to be opened through a bastion 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, establishing a correspondence between a target drive in the candidate drive list and a database drive file based on the database drive file in the drive management directory may include: analyzing the database drive file under the drive management directory based on a preset analysis mode to obtain file information of the database drive 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, in a file parsing manner, a drive class file name and a physical address of the file included in the drive file, that is, file information of the database drive file. In this embodiment, the server may access the internal file using java's file processing class to achieve the purpose of parsing, so as to obtain the file information of the database driver 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, so as to establish a corresponding relationship 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 a database to be configured based on the connection login information may include: acquiring file information corresponding to the database drive file from the static object file according to the drive identifier; acquiring a corresponding database starting file based on the file information; loading a database drive file to obtain a drive object example corresponding to a target drive; and establishing connection between the driving object instance and the data source based on the data source address.
The drive identifier is an identifier indicating uniqueness of the drive, and may be a drive ID. The data source address refers to the storage address or the location address of the data source.
In this embodiment, after acquiring the connection login information, the server may find, in a key lookup manner, file information, that is, a drive class file name and a physical address of the file, of the corresponding drive file according to the drive ID from the static object file, that is, the static map object, according to the drive identifier in the connection login information.
Further, the server can use the class loading function of java to realize dynamic loading of the queried database drive file. And acquiring a corresponding drive object instance after the drive loading is finished.
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 configuration is successful, if the connection is failed, a corresponding error notification is generated, the error notification may include an error notification reason, and the server may perform a problem check according to the error notification reason and perform a problem solution.
In this embodiment, the loading driver is a java-based dynamic class loading mechanism, so that the loading driver can be implemented by only providing a loaded class name and a corresponding jar package file without restarting.
In this embodiment, for multiple data sources, different corresponding driver instances may be obtained based on different database drivers, and then the connection of the data sources may be completed according to the corresponding data source address, thereby completing the configuration of the database.
In one embodiment, the connection login information may further include user information of the login 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 authority of a login user based on user information; judging whether a login user has a target authority for operating a data source or not according to the user authority; and when the login user is judged to have the target right of operating the data source, performing corresponding operation on the data source according to the received user instruction.
In this embodiment, the server may query and obtain the user rights of the user, for example, the deletion rights, the addition rights, the update rights, the retrieval rights, and the like, based on the user information.
Further, the server can judge whether the login user has the target authority for operating 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 add, modify, etc. the data source.
In this embodiment, when the server determines that the login user does not have the target authority to operate the data source, the server may generate a prompt message and send the prompt message to the terminal to end a plan to prompt the current login user that the current 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 corresponding operation on the data source according to the received user instruction.
In this embodiment, the server may perform the assignment of the authority by authorizing the administrator, for example, the data sources are uniformly added, edited, authorized, and the like by the administrator.
In this embodiment, the authorization manner may be divided into group authorization and user authorization. The group authorization means that some users are classified into a group, and the right of adding the data source is directly given to the group, so that all users under the group have the right of adding the data source. User authorization refers to directly granting the right to add a data source to a particular user.
In this embodiment, the authorization scope may include addition (Create), for example, adding table structure, adding table data, retrieval (Retrieve), for example, table data query, filtering operation, Update (Update), for example, updating table structure, updating table data, and deletion (Delete), for example, deleting table structure, deleting table data, and other operation rights.
In this embodiment, after the administrator authorizes, the authorized user may use the data source to perform operations within the authority, but cannot add or modify the data source. When a user needs to create a new 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 and deleting a field) or update data in a table, an update right is needed; when a user needs to delete a table or delete data in a table, the user needs to have deletion authority.
In the embodiment, the user right of the login user is obtained based on the user information, then whether the login user has the target right for operating the data source is judged according to the user right, and when the login user is judged to have the target right for operating the data source, corresponding operation is performed on the data source according to the received user instruction. Therefore, management of the database can be enhanced, connection error reporting and the like caused by random addition of data sources, modification of the data sources and the like by a user are avoided, and stability of the management system is guaranteed.
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 the unified authentication platform and receiving a verification result fed back by the unified verification platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for verifying the user information.
The user login request refers to a request for requesting to login the database management system of the application, and the request may include user information of a user to be logged in, such as a user name, a user password, a graphical verification code, and the like.
The unified authentication platform is a platform which is in butt joint with a plurality of management systems, and the unified authentication platform can verify the 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 (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 invoking the user authentication interface.
In this embodiment, after receiving the user login request, the server may parse the user login request to parse the user information, for example, to obtain a user name and a password of the user requesting login, a graphical verification code input by the user, an actual graphical verification code, and the like.
Further, the server can send the analyzed user information to the unified authentication platform, and the user information is verified through the unified authentication platform.
In this embodiment, after receiving the user information, the unified authentication platform may first verify the graphical verification code input by the user and the actual graphical verification code to determine whether the two codes are consistent.
In this embodiment, when the unified authentication platform determines that the graphical verification code input by the user is not consistent with the actual graphical verification code, an error prompt message may be generated and fed back to the server, and further fed back to the terminal interface, so as to prompt the user to input an error. And when the server determines that the graphical verification code input by the user is consistent with the actual graphical 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 the password are paired. When the unified authentication platform determines that the user name and the password are paired, it can be determined that the user information is successfully verified, and the unified authentication platform can perform user binding 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 valid and is regarded as logged in, so that the user can log in automatically in a plurality of different management systems. If the unified authentication platform does not correspond to the user with the user name, the unified authentication platform can add a piece of information for the user and return a valid login token to complete 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 the subsequent processing can be performed.
In this embodiment, the user login request is received, the user information carried in the user request is sent to the unified authentication platform, and the user information is verified through the unified authentication platform, so that single sign-on of a plurality of management platforms can be realized, and the login verification efficiency is improved.
In one embodiment, the method may further include: and uploading at least one of the database connection request, the database drive file, the drive selection instruction, the corresponding relation, the drive selection instruction and the connection login information to the block chain 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. A Block chain (Block chain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data Block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next Block.
Specifically, the blockchain may include a blockchain underlying platform, a platform product service layer, an application service 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 relationship, the driver selection instruction, and the connection login information in the node of the block chain, so as to ensure privacy and security of the data.
In the above embodiment, at least one of the database connection request, the database drive file, the drive selection instruction, the corresponding relationship, the drive selection instruction, and the connection login information is uploaded to the block chain and stored in the node of the block chain, so that the privacy of data stored in the link node of the block chain can be guaranteed, 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 order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 3, there is provided a database management apparatus of a desktop application, including: a request obtaining module 100, a driver file obtaining module 200, a corresponding relationship establishing module 300, an instruction receiving module 400, and a connection establishing 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 to-be-connected database corresponding to the desktop application degree and a data source.
The driver file obtaining module 200 is configured to 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.
The corresponding relationship establishing module 300 is configured to establish a corresponding relationship between a target driver and a database driver file in an alternative 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.
And the connection establishing module 500 is configured to obtain connection login information according to the selected target driver, and establish a connection with a data source of the database to be connected based on the connection login information.
In one embodiment, the correspondence relationship establishing module 300 may include:
and the analysis submodule is used for analyzing the database drive file under the drive management directory based on a preset analysis mode to obtain the file information of the database drive file.
And the corresponding relation establishing submodule 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 establishing module 500 may include:
and the file information acquisition submodule is used for acquiring the file information of the corresponding database drive file from the static object file according to the drive identification.
And the database starting file acquisition submodule is used for acquiring the corresponding database starting file based on the file information.
And the loading submodule is used for loading the database drive file to obtain a drive object instance corresponding to the target drive.
And the connection establishing submodule is used for establishing the connection between the driving object instance and the data source based on the data source address.
In one embodiment, the connection login information may further include user information of the login user.
In this embodiment, the apparatus may further include:
and the user authority acquisition module is used for acquiring the user authority 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 the data source or not according to the user authority; and when the login user is judged to have the target right of operating the data source, performing corresponding operation 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 the user information of the user to be logged in.
And the authentication module is used for sending the user information to the unified authentication platform and receiving a verification result fed back by the unified verification platform, the unified authentication platform is used for being connected with the plurality of management systems, and the unified authentication platform is used for verifying 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 drive file, the drive selection instruction, the corresponding relation, the drive selection instruction and the connection login information to the block chain node for storage.
Specific limitations regarding the database management apparatus of the desktop application can be found in the above limitations regarding the database management method of the desktop application, and will not be described herein again. The modules in the database management device of the desktop application can be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the 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 comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used for storing data such as database connection requests, database drive files, drive selection instructions, corresponding relations, drive selection instructions, connection login information and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a database management method for a desktop application.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program: acquiring a database connection request, wherein the database connection request carries version information of a database to be connected and a data source corresponding to the desktop application degree; based on the version information, acquiring a database drive file corresponding to the database to be connected, and storing the database drive file into a drive management directory; establishing a corresponding relation 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; receiving a drive selection instruction, wherein the drive selection instruction is generated when a target drive is selected from the alternative drive list; and 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, when the processor executes the computer program, the establishing a corresponding relationship between the target driver in the candidate driver list and the database driver file based on the database driver file in the driver management directory may include: analyzing the database drive file under the drive management directory based on a preset analysis mode to obtain file information of the database drive 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 corresponding to the database drive file from the static object file according to the drive identifier; acquiring a corresponding database starting file based on the file information; loading a database drive file to obtain a drive object example corresponding to a target drive; and 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 further include user information of the login user.
In this embodiment, the processor, when executing the computer program, may further implement the following steps: acquiring user authority of a login user based on user information; judging whether a login user has a target authority for operating a data source or not according to the user authority; and when the login user is judged to have the target right of operating the data source, performing corresponding operation 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 the unified authentication platform and receiving a verification result fed back by the unified verification platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for verifying the user information.
In one embodiment, the processor, when executing the computer program, may further implement the following steps: and uploading at least one of the database connection request, the database drive file, the drive selection instruction, the corresponding relation, the drive selection instruction and the connection login information to the block chain 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 of a database to be connected and a data source corresponding to the desktop application degree; based on the version information, acquiring a database drive file corresponding to the database to be connected, and storing the database drive file into a drive management directory; establishing a corresponding relation 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; receiving a drive selection instruction, wherein the drive selection instruction is generated when a target drive is selected from the alternative drive list; and 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, when executed by the processor, the implementing, based on the database driver file in the driver management directory, a correspondence relationship between the target driver in the candidate driver list and the database driver file may include: analyzing the database drive file under the drive management directory based on a preset analysis mode to obtain file information of the database drive 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, for establishing a connection with a data source of the database to be configured based on the connection login information, may include: acquiring file information corresponding to the database drive file from the static object file according to the drive identifier; acquiring a corresponding database starting file based on the file information; loading a database drive file to obtain a drive object example corresponding to a target drive; and 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 further include user information of the login user.
In this embodiment, the computer program when executed by the processor may further implement the steps of: acquiring user authority of a login user based on user information; judging whether a login user has a target authority for operating a data source or not according to the user authority; and when the login user is judged to have the target right of operating the data source, performing corresponding operation on the data source according to the received user instruction.
In one embodiment, before the computer program is executed by the processor 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 the unified authentication platform and receiving a verification result fed back by the unified verification platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for verifying 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 drive file, the drive selection instruction, the corresponding relation, the drive selection instruction and the connection login information to the block chain node for storage.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile 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), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for database management of a desktop application, 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 corresponding to the desktop application degree;
acquiring a database driving file corresponding to the database to be connected based on the version information, and storing the database driving file into a driving management directory;
establishing a corresponding relation between a target drive in an alternative drive list and a database drive file based on the database drive file in the drive management directory;
receiving a drive selection instruction, wherein the drive selection instruction is generated when the target drive is selected from the alternative drive list;
and 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.
2. The method according to claim 1, wherein the establishing a correspondence between the target driver in the candidate driver list and the database driver file based on the database driver file in the driver management directory comprises:
analyzing the database drive file under the drive management directory based on a preset analysis mode to obtain file information of the database drive 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.
3. The method of claim 2, wherein the connection login information includes a driver identification and a data source address of the data source;
establishing connection with the data source of the database to be configured based on the connection login information, wherein the connection comprises the following steps:
acquiring file information corresponding to the database drive file from the static object file according to the drive identifier;
acquiring a corresponding database starting file based on the file information;
loading the database drive file to obtain a drive object instance corresponding to the target drive;
and establishing connection between the driving object instance and the data source based on the data source address.
4. The method of claim 3, wherein the connection login information further comprises user information of a login user;
the method further comprises the following steps:
acquiring the user authority of the login user based on the user information;
judging whether the login user has a target authority for operating a data source or not according to the user authority;
and when the login user is judged to have the target authority for operating the data source, performing corresponding operation on the data source according to the received user instruction.
5. The method of claim 1, wherein prior to 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 verification platform, wherein the unified authentication platform is used for being connected with a plurality of management systems and is used for verifying the user information.
6. The method according to any one of claims 1 to 5, further comprising:
and uploading at least one of the database connection request, the database drive file, the drive selection instruction, the corresponding relation, the drive selection instruction and the connection login information to a block chain node for storage.
7. A database management apparatus for a desktop application, the apparatus comprising:
the system comprises a request acquisition module, a database connection request processing module and a database connection processing module, wherein the request acquisition module is used for acquiring a database connection request which carries version information of a to-be-connected database corresponding to the desktop application degree and a data source;
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;
an instruction receiving module, configured to receive a drive selection instruction, where the drive selection instruction is generated when the target drive is selected from the candidate drive list;
and the connection establishing module is used for acquiring connection login information according to the selected target driver and establishing connection with the data source of the database to be connected based on the connection login information.
8. The apparatus according to claim 7, wherein the correspondence establishing module comprises:
the analysis submodule is used for analyzing the database drive file under the drive management directory based on a preset analysis mode to obtain file information of the database drive file;
and the corresponding relation establishing submodule is used for adding the file information into a static object file and establishing a corresponding relation between the target drive in the alternative drive list and the database drive file.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
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 true CN112860778A (en) 2021-05-28
CN112860778B 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)

Cited By (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

Cited By (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

Also Published As

Publication number Publication date
CN112860778B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN110365670B (en) Blacklist sharing method and device, computer equipment and storage medium
CN112860778B (en) Database management method, device, equipment and medium for desktop application program
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN108573371B (en) Data approval method, device, computer equipment and storage medium
CN110912712B (en) Service operation risk authentication method and system based on block chain
CN110781509B (en) Data verification method and device, storage medium and computer equipment
CN109308285A (en) Database script management method, device, computer equipment and storage medium
CN110083384B (en) Application programming interface creating method and device
CN111191221A (en) Method and device for configuring authority resources and computer readable storage medium
CN108763888B (en) User profile processing method and device, computer equipment and storage medium
CN109831435B (en) Database operation method, system, proxy server and storage medium
CN110647540A (en) Business data query method and device, computer equipment and storage medium
CN113360868A (en) Application program login method and device, computer equipment and storage medium
CN113114674A (en) Service access method, device, equipment and storage medium
CN113742023A (en) Authority configuration method and device, computer equipment and storage medium
WO2021169469A1 (en) Voiceprint data processing method and apparatus, computer device, and storage medium
CN113849798A (en) Secure login authentication method, system, computer equipment and storage medium
CN111143399B (en) Data processing method, device, storage medium and computer equipment
CN112559352A (en) Interface test method, device, equipment and storage medium
CN108965335B (en) Method for preventing malicious access to login interface, electronic device and computer medium
CN110597843A (en) Waybill query method and device, computer equipment and storage medium
CN113742681B (en) Account management method and device, computer equipment and storage medium
CN112583890B (en) Message pushing method and device based on enterprise office system and computer equipment
CN111310141B (en) Authentication management method, device, computer equipment and storage medium
CN111597573B (en) Page embedding method and device, computer equipment and storage 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