CN116010382A - Operation and maintenance method, device and equipment of database and storage medium - Google Patents

Operation and maintenance method, device and equipment of database and storage medium Download PDF

Info

Publication number
CN116010382A
CN116010382A CN202310163922.3A CN202310163922A CN116010382A CN 116010382 A CN116010382 A CN 116010382A CN 202310163922 A CN202310163922 A CN 202310163922A CN 116010382 A CN116010382 A CN 116010382A
Authority
CN
China
Prior art keywords
browser
database
operation command
control end
user
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.)
Pending
Application number
CN202310163922.3A
Other languages
Chinese (zh)
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.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology 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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202310163922.3A priority Critical patent/CN116010382A/en
Publication of CN116010382A publication Critical patent/CN116010382A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application relates to the technical field of databases, in particular to an operation and maintenance method, device, equipment and storage medium of a database, aiming at carrying out efficient operation and maintenance on the database. The method comprises the following steps: the method comprises the steps of sending database parameters of a target database input by a user at a browser end to a control end; establishing session connection between the browser end and a proxy server end corresponding to the target database according to the database parameters through the control end; through the session connection, an operation command input by the user at the browser end is sent to a client corresponding to the target database, so that the client executes the operation command; and returning the execution result of the operation command from the client to the browser.

Description

Operation and maintenance method, device and equipment of database and storage medium
Technical Field
The embodiment of the application relates to the technical field of databases, in particular to an operation and maintenance method, device and equipment of a database and a storage medium.
Background
The databases are databases which are organized, stored and managed according to the data structures, are generally deployed on high-performance servers, and are widely deployed on cloud servers along with the wide application of cloud environments, and are different from the traditional large-scale databases, the databases deployed on the cloud are often numerous in quantity and small in capacity. After the database is deployed, operation and maintenance are required during daily use so as to ensure the normal use of the database. The traditional large database is responsible for daily operation and maintenance by a special team, and the team has enough hands to track each index of the database.
The existing operation and maintenance method of the large database needs to consume a large amount of manpower and material resources, and is not suitable for operation and maintenance of a large amount of miniaturized databases in a cloud environment.
Disclosure of Invention
The embodiment of the application provides an operation and maintenance method, device, equipment and storage medium of a database, aiming at carrying out efficient operation and maintenance on the database.
An embodiment of the present application provides a method for operating and maintaining a database, where the method includes:
the method comprises the steps of sending database parameters of a target database input by a user at a browser end to a control end;
establishing session connection between the browser end and a proxy server end corresponding to the target database according to the database parameters through the control end;
through the session connection, an operation command input by the user at the browser end is sent to a client corresponding to the target database, so that the client executes the operation command;
and returning the execution result of the operation command from the client to the browser.
Optionally, before the database parameters of the target database input by the user at the browser end are sent to the control end, the method further includes:
Responding to the login operation of the user on the browser side, and carrying out account verification on the user;
when the account information of the user account passes the verification, confirming whether the user has the operation and maintenance authority of the target database;
when the user is determined to have the operation and maintenance rights of the target database, receiving the database parameters of the target database input by the user at the browser end;
and when the user is determined to not have the operation and maintenance right of the target database, sending a prompt through the browser end and exiting the operation interface.
Optionally, the method further comprises:
and closing the session connection and cleaning the related session information of the session connection in response to the disconnection operation initiated by the user at the browser end.
Optionally, the sending the database parameters of the target database input by the user at the browser end to the control end includes:
the browser end sends a connection request to the control end;
the control end establishes data connection between the control end and the browser end according to the connection request;
and the browser end sends the received database parameters of the target database to the control end through the data connection.
Optionally, the controlling end establishes session connection between the browser end and the proxy server corresponding to the target database according to the database parameters, including:
the control end determines a proxy server of a database corresponding to the database parameters according to the database parameters;
the control end sends an encryption request to the proxy server;
the proxy server searches an engine corresponding to the target database from a database engine factory according to the encryption request;
connecting a data interface of the control end with the input and output of the engine, and establishing session connection between the control end and the proxy server;
and the browser end promotes the data connection between the control end and the browser end to be session connection, and establishes session connection between the browser end and the proxy server end.
Optionally, the sending, through the session connection, an operation command input by the user at the browser end to a client corresponding to the target database, so that the client executes the operation command includes:
the browser end sends the operation command to the control end;
The control end generates an encryption request according to the operation command and sends the encryption request to the proxy server;
the proxy server analyzes the encryption request to obtain the operation command, and sends the operation command to an engine corresponding to the target database;
and the engine calls a client corresponding to the target database, and the operation command is executed through the client.
Optionally, the method returns the execution result of the operation command by the client to the browser, and the method further includes:
rendering the execution result through the browser end;
and displaying the rendered execution result in a visual interface of the browser end.
Optionally, the responding to the disconnection operation initiated by the user at the browser end closes the session connection and cleans up the related session information of the session connection, including:
responding to a disconnection request initiated by a user at the browser end, and sending the disconnection request to the control end by the browser end;
after the control end receives the disconnection request, sending a disconnection notification to the proxy server;
After receiving the disconnection notification, the proxy server initializes an engine corresponding to the target database and notifies the control end that the connection is disconnected;
the control end cleans up the relevant session information of the session connection in the control end and informs the browser end that the connection is disconnected;
and the browser end cleans up the relevant session information of the session connection at the browser end and resets the visual interface of the browser end.
Optionally, the method further comprises:
and when the control end detects that the parameters of the target database are abnormal parameters, stopping receiving the data sent by the browser end, and returning a corresponding prompt to the browser end.
Optionally, the method further comprises:
and when the proxy server detects that the encryption request is an abnormal request, refusing to establish connection and returning a corresponding prompt to the control end.
Optionally, the method further comprises:
when the browser end sends the operation command to the control end through the session connection, filtering and classifying the operation command;
when the type of the operation command is not supporting operation, intercepting the operation command and sending a corresponding prompt to the browser end;
When the type of the operation command is operation requiring work order approval, initiating a work order flow, and after the work order flow is executed, generating a corresponding encryption request according to the operation command;
and when the type of the operation command is a releasable operation, generating a corresponding encryption request according to the operation command.
Optionally, the method further comprises:
and the control end records all the operations performed on the operation command in an operation audit log.
A second aspect of an embodiment of the present application provides an operation and maintenance device for a database, where the device includes:
the database parameter sending module is used for sending the database parameters of the target database input by the user at the browser end to the control end;
the session connection creation module is used for establishing session connection between the browser end and the proxy server end corresponding to the target database according to the database parameters through the control end;
the operation command execution module is used for sending the operation command input by the user at the browser to the client corresponding to the target database through the session connection so that the client executes the operation command;
And the command execution result returning module is used for returning the execution result of the operation command by the client to the browser.
Optionally, the apparatus further comprises:
the account verification module is used for responding to the login operation of the user on the browser end and carrying out account verification on the user;
the operation and maintenance right judging module is used for confirming whether the user has the operation and maintenance right of the target database or not when the account information of the user account passes the verification;
the database parameter receiving module is used for receiving the database parameters of the target database input by the user at the browser end when the user is determined to have the operation and maintenance rights of the target database;
and the database parameter rejecting module is used for sending out a prompt through the browser end and exiting the operation interface when the user is determined to not have the operation and maintenance right of the target database.
Optionally, the apparatus further comprises:
and the connection disconnection module is used for closing the session connection and cleaning the related session information of the session connection in response to the disconnection operation initiated by the user at the browser end.
Optionally, the database parameter sending module includes:
The first connection request sending submodule is used for sending a connection request to the control end by the browser end;
the data connection establishment sub-module is used for the control end to establish data connection between the control end and the browser end according to the connection request;
and the database parameter sending sub-module is used for sending the received database parameters of the target database to the control end through the data connection by the browser end.
Optionally, the session connection creation module includes:
the proxy server determining submodule is used for determining a proxy server of a database corresponding to the database parameters according to the database parameters by the control end;
the first encryption request sending submodule is used for sending an encryption request to the proxy server by the control end;
the engine searching sub-module is used for searching an engine corresponding to the target database from a database engine factory according to the encryption request by the proxy server;
a first session connection creation sub-module, configured to connect a data interface of the control end with an input/output of the engine, and establish session connection between the control end and the proxy server;
And the second session connection creation sub-module is used for the browser end to promote the data connection between the control end and the browser end to session connection and establish the session connection between the browser end and the proxy server end.
Optionally, the operation command execution module includes:
an operation command sending sub-module, configured to send the operation command to the control end by using the browser end;
the second encryption request sending submodule is used for generating an encryption request by the control end according to the operation command and sending the encryption request to the proxy server;
the operation instruction forwarding sub-module is used for analyzing the encryption request by the proxy server to obtain the operation command and sending the operation command to an engine corresponding to the target database;
and the operation command execution sub-module is used for calling a client corresponding to the target database by the engine and executing the operation command through the client.
Optionally, the apparatus further comprises:
the execution result rendering module is used for rendering the execution result through the browser end;
and the execution result display module is used for displaying the rendered execution result in the visual interface of the browser end.
Optionally, the connection disconnection module includes:
the disconnection request sending submodule is used for responding to a disconnection request initiated by a user at the browser end, and the browser end sends the disconnection request to the control end;
the disconnection notification sub-module is used for sending a disconnection notification to the proxy server after the control end receives the disconnection request;
the engine initialization sub-module is used for initializing the engine corresponding to the target database after the proxy server receives the disconnection notification and notifying the control end that the connection is disconnected;
the control end cleaning submodule is used for cleaning related session information of the session connection in the control end by the control end and notifying the browser end that the connection is disconnected;
and the browser end cleaning submodule is used for cleaning the related session information of the session connection at the browser end by the browser end and resetting the visual interface of the browser end.
Optionally, the apparatus further comprises:
and the control end parameter rejecting sub-module is used for stopping receiving the data sent by the browser end and returning a corresponding prompt to the browser end when the control end detects that the parameter of the target database is an abnormal parameter.
Optionally, the method further comprises:
the proxy server refuses to establish the connection sub-module, which is used for refusing to establish the connection and returning a corresponding prompt to the control terminal when the proxy server detects that the encryption request is an abnormal request.
Optionally, the apparatus further comprises:
an operation command classification sub-module, configured to filter and classify the operation command when the browser end sends the operation command to the control end through the session connection;
an operation command interception sub-module, configured to intercept the operation command and send a corresponding prompt to the browser end when the type of the operation command is not supporting operation;
the work order flow starting module is used for starting a work order flow when the type of the operation command is the operation requiring work order approval, and generating a corresponding encryption request according to the operation command after the work order flow is executed;
and the encryption request generation sub-module is used for generating a corresponding encryption request according to the operation command when the type of the operation command is a releasable operation.
Optionally, the apparatus further comprises:
And the operation record sub-module is used for recording the operation command and all operations carried out on the operation command in an operation audit log by the control end.
A third aspect of the embodiments of the present application provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as described in the first aspect of the present application.
A fourth aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the method described in the first aspect of the present application when the processor executes the computer program.
By adopting the operation and maintenance method of the database, the database parameters of the target database input by the user at the browser end are sent to the control end; establishing session connection between the browser end and a proxy server end corresponding to the target database according to the database parameters through the control end; through the session connection, an operation command input by the user at the browser end is sent to a client corresponding to the target database, so that the client executes the operation command; and returning the execution result of the operation command from the client to the browser. In the application, a user can input parameters of a database needing operation and maintenance at a browser end, a control end establishes a session between the browser end and a proxy server end of a target database according to the parameters input by the user, after the session is established, the user can operate the target database at the browser end, the user can input an operation command to control a client end of the target database to execute corresponding operation, and after the client end executes the operation command input by the user, an operation command execution result is returned to the browser end. The user can operate any target database only at the browser end, so that daily operation and maintenance are carried out on the database, and the method is particularly suitable for carrying out efficient operation and maintenance on a large number of databases in a cloud environment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an operation and maintenance system of a database according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of operating and maintaining a database according to an embodiment of the present application;
fig. 3 is a schematic diagram of an operation and maintenance device of a database according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without undue burden, are within the scope of the present application.
In this embodiment of the present application, referring to fig. 1, fig. 1 is a schematic structural diagram of an operation and maintenance system of a database according to an embodiment of the present application, as shown in fig. 1, the operation and maintenance system of the entire database is composed of three layers of service ends: browser end, control end (server end), proxy server end (agent end). The browser end provides a browser webpage interface, and operation and maintenance personnel can log in on any user terminal through the browser end to perform visual interaction. The browser end is provided with a connection management unit and a visualization unit, wherein the connection management unit is responsible for establishing connection with the control end, managing the connection state and being responsible for reconnecting when the line is disconnected; the visualization unit is responsible for interacting with the operation command line client of the database, formatting the content output by the browser and further displaying the content on a visualization interface of a user. The control end is a server, provides management support for a plurality of database examples to the outside, establishes session connection between the browser and the proxy server of the corresponding database example, provides security management capability, manages authority of the user, and avoids unauthorized operation. The control end comprises a session management unit and a security management unit, the session management unit is responsible for monitoring access of the browser, forwarding the proxy server according to a database selected by the browser end, and managing session life cycle; the safety management unit is responsible for ensuring safety, and executing functions such as operation audit, work order approval, operation command filtering and the like. The proxy server is responsible for providing encapsulation of the corresponding database client session, connecting the input and output of the database client session with the control end, and each set of database is provided with a set of corresponding proxy server which supports encapsulation of a plurality of database clients and supports simultaneous access of a plurality of sessions. The proxy server comprises an engine unit and a connection forwarding unit, wherein the engine unit is responsible for packaging the operation command line client into a script engine, and exposing the output and input endpoints of the client for forwarding an operation request; the connection forwarding unit is responsible for monitoring the access of the control end, establishing an encryption session with the control end, and accessing the session to the input and output endpoints of the engine unit.
Referring to fig. 2, fig. 2 is a flowchart of a method for operating and maintaining a database according to an embodiment of the present application. As shown in fig. 2, the method comprises the steps of:
s11: and sending the database parameters of the target database input by the user at the browser end to the control end.
In this embodiment, the target database is a database that needs to be operated by an operator, and the database parameters are parameters, such as a name, a network address, etc., of the database, which are used for searching the database in the cloud environment, and are also called as database instance information.
In this embodiment, when an operation and maintenance person wants to perform operation and maintenance on a certain database through an operation and maintenance system of the database, a browser end is opened by using any terminal device, a network address of the operation and maintenance system is input, the database is operated after the network address is entered, the operation and maintenance person, that is, a user, can manually input parameters of a target database at the browser end, and after the browser end receives the database parameters of the target database, the database parameters of the target database are sent to a control end. The operation and maintenance system also collects various databases, displays the names of the databases in the visual interface, and the user can directly click on the names of the databases in the visual interface in the browser to directly enter the operation interface of the databases.
In this embodiment, the specific step of sending the database parameters of the target database input by the user at the browser end to the control end includes:
s11-1: and the browser end sends a connection request to the control end.
In this embodiment, when the browser end needs to send data to the control end, a connection request is sent to the control end through a connection management unit on the browser end, where the connection request includes verification information such as a network address of the browser end and account information of the user.
S11-2: and the control end establishes data connection between the control end and the browser end according to the connection request.
In this embodiment, after receiving the connection request, the control end establishes a data connection with the browser end through the session management unit, and after the data connection is established, the browser end may transmit data to the control end.
S11-3: and the browser end sends the received database parameters of the target database to the control end through the data connection.
In this embodiment, the browser sends the database parameters of the target database input by the user to the browser to the control terminal through the established data connection.
In another embodiment of the present application, the method further comprises:
S11-4: and when the control end detects that the parameters of the target database are abnormal parameters, stopping receiving the data sent by the browser end, and returning a corresponding prompt to the browser end.
In this embodiment, the abnormal parameter is a parameter that does not conform to a preset rule, when the control end receives the database parameter of the target database, the parameter is detected, and when the parameter is found to be incomplete or does not conform to the preset rule, the data sent by the browser end is stopped being received, and a corresponding prompt is returned to the browser end.
For example, when the user inputs few digits or letters while inputting the parameters, the browser returns the parameter incompleteness to the user, please check the prompt of the input parameters.
S12: and establishing session connection between the browser end and the proxy server end corresponding to the target database according to the database parameters through the control end.
In this embodiment, the session management unit of the control end establishes session connection between the browser end and the proxy server end corresponding to the target database according to the database parameters.
In this embodiment, the specific step of establishing, by the control end, session connection between the browser end and the proxy server end corresponding to the target database according to the database parameter includes:
S12-1: and the control end determines the proxy server of the database corresponding to the database parameters according to the database parameters.
In this embodiment, the session management unit on the control end searches the proxy server corresponding to the target database in the cloud environment according to the database parameter of the target database sent by the browser, and because the database parameter includes the name and address of the database, the proxy server corresponding to the database can be determined in the cloud environment according to the name and address of the database.
S12-2: and the control end sends an encryption request to the proxy server.
In this embodiment, the encryption request includes the database parameters of the target database, and the encryption request is used to request connection to the proxy server, and the parameters in the encryption request are encrypted by the session management unit on the control end, so that the security of operation and maintenance operation can be ensured, and the parameters are not easily intercepted and identified by the malicious gateway.
S12-3: and the proxy server searches an engine corresponding to the target database from a database engine factory according to the encryption request.
In this embodiment, the engine corresponding to the database is an interface for data interaction between the database and the outside, the interface of the database is encapsulated by the engine, and the database performs data interaction between the engine and the outside. Each database corresponds to one engine, a large number of engines are stored in an engine factory, and the engines of the databases which need to be accessed can be quickly searched in the engine factory.
In this embodiment, after receiving the confidential request, the proxy server analyzes the encrypted request through a connection forwarding unit on the proxy server to obtain the database parameter of the target database, and then, according to the database parameter of the target database, finds the engine of the target database in the engine factory.
S12-4: and connecting the data interface of the control end with the input and output of the engine to establish session connection between the control end and the proxy server.
In this embodiment, the connection forwarding unit of the control end connects the data interface of the control end with the input and output of the engine, and at this time, the data connection between the control end and the proxy server end is successfully established.
S12-5: and the browser end promotes the data connection between the control end and the browser end to be session connection, and establishes session connection between the browser end and the proxy server end.
In this embodiment, the data connection is a simple data transmission connection, and on the basis of this, the established session connection can enable a session to be generated between the browser end and the control end, and the user can perform interactive communication between the session and the control end.
In this embodiment, after the session connection is established between the control end and the proxy server of the number standard database, the browser end promotes the data connection with the control end to be the session connection, because the session connection is already established between the control end and the proxy server, and further, the session connection is established between the browser end and the proxy server by taking the control end as a bridge.
For example, the browser promotes the data connection to a websocket connection, which is a full duplex communication protocol connection, allowing both parties of the connection to actively transmit data, and the transmission speed is very stable.
In another embodiment of the present application, the method further comprises:
s12-6: and when the proxy server detects that the encryption request is an abnormal request, refusing to establish connection and returning a corresponding prompt to the control end.
In this embodiment, when the proxy server receives an encryption request sent by the control end, the encryption request is determined according to a preset rule, and when the encryption request is detected to be an abnormal request, session connection establishment is refused, and a corresponding prompt is returned to the control end. The preset rules define encryption and decryption rules which are complied with by both parties, and define specifications of the connection request, and when the encryption request does not accord with the preset rules, the encryption request is regarded as an abnormal request.
S13: and sending the operation command input by the user at the browser to the client corresponding to the target database through the session connection, so that the client executes the operation command.
In this embodiment, the operation command is an operation command of the user to the database, and the database client executes corresponding operations on the database according to the operation command of the user, and outside executes various operations on the database through the client corresponding to the database.
In this embodiment, a user inputs an operation command at a browser end, and transmits the operation command of the user to a client of a target database through session connection established between the browser end and the client, and the client executes a corresponding operation after receiving the operation command.
By way of example, the operation command input by the user may be an operation of adding data, deleting data, modifying data, or the like.
In this embodiment, through the session connection, an operation command input by the user at the browser end is sent to a client corresponding to the target database, so that the specific steps of executing the operation command by the client are as follows:
s13-1: and the browser end sends the operation command to the control end through the session connection.
In this embodiment, a user inputs an operation command on a visual window of a browser, and the operation command is sent to a control end through a websocket session link.
S13-2: and the control end generates an encryption request according to the operation command and sends the encryption request to the proxy server.
In this embodiment, the control end generates a corresponding encryption request according to the operation command, where the encryption request includes the encrypted operation command. After generating the encryption request, the encryption request is sent to the proxy server. The encryption mode is not limited herein, and encryption rules can be set according to actual situations.
S13-3: the proxy server analyzes the encryption request to obtain the operation command, and sends the operation command to an engine corresponding to the target database.
In this embodiment, after receiving the encryption request, the proxy server analyzes the encryption request according to encryption rules agreed by both parties, obtains an operation command included in the encryption request, and sends the obtained operation command to the engine unit.
S13-4: and the engine calls a client corresponding to the target database, and the operation command is executed through the client.
In this embodiment, after the engine unit receives the operation command, the client corresponding to the target database is called, and the operation command is executed by the client to obtain the operation result.
In another embodiment of the present application, the method further comprises:
s13-5: and when the browser end sends the operation command to the control end through the session connection, filtering and classifying the operation command.
In this embodiment, when receiving an operation command sent by a browser, a security management unit on a control end filters and classifies the operation command into three types, which are respectively: unsupported operations, operations requiring work order approval, may be released. The unsupported operation is an operation which is carried out by a database unsupported operation and maintenance personnel, the operation requiring work order approval is preset, the operation with higher risk is carried out, the operation requiring relevant personnel to carry out work order approval can be released, and the operation which can be released is an operation which can be directly carried out encryption forwarding.
S13-6: when the type of the operation command is not supporting operation, intercepting the operation command and sending a corresponding prompt to the browser end.
In this embodiment, when the type of the operation command is an operation that is not supported, the security management unit intercepts the operation command and sends a prompt to the browser that the operation command is an operation that is not supported.
S13-7: and when the class of the operation command is operation requiring work order approval, initiating a work order flow, and after the work order flow is executed, generating a corresponding encryption request according to the operation command.
In this embodiment, when the type of the operation command is an operation that needs to be approved according to a work order, the security management unit initiates a work order procedure, notifies related personnel to perform work order approval on the operation, and after the related personnel passes the work order approval, the execution of the work order procedure is completed, and then a corresponding encryption request is generated according to the operation command.
S13-8: and when the type of the operation command is a releasable operation, generating a corresponding encryption request according to the operation command.
In this embodiment, when the type of the operation command is a releasable operation, the corresponding encryption request is directly generated according to the operation command.
In another embodiment of the present application, the method further comprises:
and the control end records all the operations performed on the operation command in an operation audit log.
In this embodiment, the operation audit log is used to record each operation performed by the operation and maintenance personnel when the operation and maintenance personnel perform the operation and maintenance on the database, each operation command issued by the user, the classification result of each operation command by the security management unit, the processing performed by the security management unit on each operation command, and the related operation of each work order approval process initiated by the security management unit are recorded in the operation audit log. The related personnel can call the security audit log at any time to review.
In this embodiment, the security management unit on the control end records various command operations and related data, so that risk operations performed by operation and maintenance personnel are effectively controlled, high-risk operations can be well perceived, and the high-risk operations are prohibited from being directly executed. In the work order approval in the prior art, all the operation commands need to be submitted to the work order approval system, in the embodiment, the operation commands are filtered first, only the work order flow is initiated for high-risk operation, and the database operation and maintenance efficiency is greatly improved.
S14: and returning the execution result of the operation command from the client to the browser.
In this embodiment, after the client executes the operation command input by the user at the browser, the execution result is returned to the browser in real time along the established session link.
For example, when the operation command is a deletion operation of the database, after the deletion of the database deletion data is completed, an execution result of the completion of the database deletion operation is returned to the browser side.
In another embodiment of the present application, the method further comprises:
s21: rendering the execution result through the browser end.
In this embodiment, after receiving the returned execution result, the browser end renders the execution result by the visualization unit of the browser.
For example, if the execution result is that the operation is successful, the text corresponding to the execution result may be rendered green, or the execution result may be rendered as a symbol representing that the operation is successfully executed, such as a hook.
S22: and displaying the rendered execution result in a visual interface of the browser end.
In this embodiment, after the execution result of the operation command is rendered, the visualization unit on the browser end displays the rendered execution result in the visualization interface on the browser end. The user can view the execution result of the operation command in the visual interface.
In another embodiment of the present application, before the database parameters of the target database input by the user at the browser end are sent to the control end, the method further includes:
s31: and responding to the login operation of the user on the browser side, and carrying out account verification on the user.
In this embodiment, when the operation and maintenance personnel, that is, the user performs the operation and maintenance operation on the database at the browser end, the user needs to log in on the operation interface of the database, and log in to the operation interface of the database by inputting the user account of the individual.
In this embodiment, when a user logs in the database operation interface at the browser end, after inputting account information, the browser end performs account verification on the user, when the account information is correct, the login is successful, and if the account information verification fails, the login fails, so that the security of the database is ensured.
S32: and when the account information of the user account passes the verification, confirming whether the user has the operation and maintenance authority of the target database.
In this embodiment, when the account information of the user account passes the verification, the background of the browser end may determine, according to the account information of the user, the authority held by the account information, so as to determine whether the user has the database operation and maintenance authority of the target database.
S33: and when the user is determined to have the operation and maintenance rights of the target database, receiving the database parameters of the target database input by the user at the browser end.
In this embodiment, when it is determined that the user has the database operation and maintenance right, it indicates that the user is an operation and maintenance person of the database, and may perform operation and maintenance operation on the database, and receive the database parameter of the target database input by the user at the browser end.
S34: and when the user is determined to not have the operation and maintenance right of the target database, sending a prompt through the browser end and exiting the operation interface.
In this embodiment, when it is determined that the user does not have the operation and maintenance right, the operation is regarded as illegal operation, and a prompt that the user does not have the operation and maintenance right is sent out through the browser, and the operation interface of the database is exited.
In the embodiment, the browser end is logged in through the user account, the authority of the user account is verified, and the security of database operation and maintenance is ensured.
In another embodiment of the present application, the method further comprises:
s41: and closing the session connection and cleaning the related session information of the session connection in response to the disconnection operation initiated by the user at the browser end.
In this embodiment, the disconnection request is used to disconnect the session between the browser end and the target database. The related session information is related information generated in the session.
In this embodiment, after the user finishes operating the database, that is, after the operation on the database is finished, a disconnection request is sent out at the browser end, and after the operation and maintenance system of the database receives the disconnection request of the user, the session connection is closed and relevant session information of the session connection is cleared.
In this embodiment, the step of closing the session connection and clearing the session information related to the session connection in response to the disconnection operation initiated by the user at the browser end includes:
s41-1: and responding to a disconnection request initiated by a user at the browser end, and sending the disconnection request to the control end by the browser end.
In this embodiment, when a user initiates a disconnection request at a browser end, the browser end sends the disconnection request to a control end when receiving an operation of the user.
S41-2: and after the control end receives the disconnection request, sending a disconnection notification to the proxy server.
In this embodiment, after receiving the disconnection request, the session management unit of the control end sends a disconnection notification to the proxy server, so as to notify the proxy server to disconnect the session established with the control end.
S41-3: after receiving the disconnection notification, the proxy server initializes the engine corresponding to the target database and notifies the control end that the connection is disconnected.
In this embodiment, after receiving the disconnection notification, the proxy server logs off the engine corresponding to the target database, clears the corresponding session information, resets the engine, and reinitializes the engine to an unused state. The connection forwarding unit disconnects with the engine unit and notifies the control terminal that the connection has been disconnected.
S41-4: and the control end cleans up the relevant session information of the session connection in the control end and informs the browser end that the connection is disconnected.
In this embodiment, after receiving the notification that the proxy server has been disconnected, the control end clears the session management unit on the control end and notifies the browser that the connection has been disconnected.
S41-5: and the browser end cleans up the relevant session information of the session connection at the browser end and resets the visual interface of the browser end.
In this embodiment, after receiving the information that the control end has been disconnected, the connection management unit of the browser end cleans up the relevant session information of the session at the browser end, resets the visual interface of the browser, and resets to the unregistered state.
In this embodiment, after the operation and maintenance personnel finishes the operation, a disconnection request can be sent out at the browser end, and after the browser end, the control end and the proxy server end receive the disconnection request, the relevant session information of the session connection stored in each of the control end, the proxy server end and the control end are cleaned, so that the operation safety and privacy of the operation and maintenance personnel are ensured.
In the embodiment, database operation staff can directly manage any database instance in the visual interface of the browser, a host computer where the database is located is not required to be logged in, and a client of the database is opened for operation, so that the method is particularly suitable for managing a large number of database instances in a cloud environment, and the operation and maintenance efficiency of the database in the cloud environment is greatly improved.
Based on the same inventive concept, an embodiment of the present application provides an operation and maintenance device for a database. Referring to fig. 3, fig. 3 is a schematic diagram of an operation and maintenance device of a database according to an embodiment of the present application. As shown in fig. 3, the apparatus includes:
the database parameter sending module 301 is configured to send, to the control end, a database parameter of the target database input by the user at the browser end;
a session connection creation module 302, configured to establish, by using the control end, session connection between the browser end and a proxy server corresponding to the target database according to the database parameters;
an operation command execution module 303, configured to send, through the session connection, an operation command input by the user at the browser end to a client corresponding to the target database, so that the client executes the operation command;
and the command execution result returning module 304 is configured to return an execution result of the operation command by the client to the browser.
Optionally, the apparatus further comprises:
the account verification module is used for responding to the login operation of the user on the browser end and carrying out account verification on the user;
The operation and maintenance right judging module is used for confirming whether the user has the operation and maintenance right of the target database or not when the account information of the user account passes the verification;
the database parameter receiving module is used for receiving the database parameters of the target database input by the user at the browser end when the user is determined to have the operation and maintenance rights of the target database;
and the database parameter rejecting module is used for sending out a prompt through the browser end and exiting the operation interface when the user is determined to not have the operation and maintenance right of the target database.
Optionally, the apparatus further comprises:
and the connection disconnection module is used for closing the session connection and cleaning the related session information of the session connection in response to the disconnection operation initiated by the user at the browser end.
Optionally, the database parameter sending module includes:
the first connection request sending submodule is used for sending a connection request to the control end by the browser end;
the data connection establishment sub-module is used for the control end to establish data connection between the control end and the browser end according to the connection request;
And the database parameter sending sub-module is used for sending the received database parameters of the target database to the control end through the data connection by the browser end.
Optionally, the session connection creation module includes:
the proxy server determining submodule is used for determining a proxy server of a database corresponding to the database parameters according to the database parameters by the control end;
the first encryption request sending submodule is used for sending an encryption request to the proxy server by the control end;
the engine searching sub-module is used for searching an engine corresponding to the target database from a database engine factory according to the encryption request by the proxy server;
a first session connection creation sub-module, configured to connect a data interface of the control end with an input/output of the engine, and establish session connection between the control end and the proxy server;
and the second session connection creation sub-module is used for the browser end to promote the data connection between the control end and the browser end to session connection and establish the session connection between the browser end and the proxy server end.
Optionally, the operation command execution module includes:
An operation command sending sub-module, configured to send the operation command to the control end by using the browser end;
the second encryption request sending submodule is used for generating an encryption request by the control end according to the operation command and sending the encryption request to the proxy server;
the operation instruction forwarding sub-module is used for analyzing the encryption request by the proxy server to obtain the operation command and sending the operation command to an engine corresponding to the target database;
and the operation command execution sub-module is used for calling a client corresponding to the target database by the engine and executing the operation command through the client.
Optionally, the apparatus further comprises:
the execution result rendering module is used for rendering the execution result through the browser end;
and the execution result display module is used for displaying the rendered execution result in the visual interface of the browser end.
Optionally, the connection disconnection module includes:
the disconnection request sending submodule is used for responding to a disconnection request initiated by a user at the browser end, and the browser end sends the disconnection request to the control end;
The disconnection notification sub-module is used for sending a disconnection notification to the proxy server after the control end receives the disconnection request;
the engine initialization sub-module is used for initializing the engine corresponding to the target database after the proxy server receives the disconnection notification and notifying the control end that the connection is disconnected;
the control end cleaning submodule is used for cleaning related session information of the session connection in the control end by the control end and notifying the browser end that the connection is disconnected;
and the browser end cleaning submodule is used for cleaning the related session information of the session connection at the browser end by the browser end and resetting the visual interface of the browser end.
Optionally, the apparatus further comprises:
and the control end parameter rejecting sub-module is used for stopping receiving the data sent by the browser end and returning a corresponding prompt to the browser end when the control end detects that the parameter of the target database is an abnormal parameter.
Optionally, the method further comprises:
the proxy server refuses to establish the connection sub-module, which is used for refusing to establish the connection and returning a corresponding prompt to the control terminal when the proxy server detects that the encryption request is an abnormal request.
Optionally, the apparatus further comprises:
an operation command classification sub-module, configured to filter and classify the operation command when the browser end sends the operation command to the control end through the session connection;
an operation command interception sub-module, configured to intercept the operation command and send a corresponding prompt to the browser end when the type of the operation command is not supporting operation;
the work order flow starting module is used for starting a work order flow when the type of the operation command is the operation requiring work order approval, and generating a corresponding encryption request according to the operation command after the work order flow is executed;
and the encryption request generation sub-module is used for generating a corresponding encryption request according to the operation command when the type of the operation command is a releasable operation.
Optionally, the apparatus further comprises:
and the operation record sub-module is used for recording the operation command and all operations carried out on the operation command in an operation audit log by the control end.
Based on the same inventive concept, another embodiment of the present application provides a readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps in the method for operating and maintaining a database according to any of the embodiments of the present application.
Based on the same inventive concept, another embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor executes the steps in the method for operating and maintaining a database according to any one of the foregoing embodiments of the present application.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present embodiments have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the present application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing has described in detail the methods, apparatuses, devices and storage medium for operation and maintenance of databases provided in the present application, and specific examples have been applied herein to illustrate the principles and embodiments of the present application, and the description of the foregoing examples is only used to help understand the methods and core ideas of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (15)

1. A method of operating and maintaining a database, the method comprising:
the method comprises the steps of sending database parameters of a target database input by a user at a browser end to a control end;
establishing session connection between the browser end and a proxy server end corresponding to the target database according to the database parameters through the control end;
through the session connection, an operation command input by the user at the browser end is sent to a client corresponding to the target database, so that the client executes the operation command;
and returning the execution result of the operation command from the client to the browser.
2. The method of claim 1, wherein before sending the database parameters of the target database input by the user at the browser side to the control side, the method further comprises:
responding to the login operation of the user on the browser side, and carrying out account verification on the user;
when the account information of the user account passes the verification, confirming whether the user has the operation and maintenance authority of the target database;
when the user is determined to have the operation and maintenance rights of the target database, receiving the database parameters of the target database input by the user at the browser end;
and when the user is determined to not have the operation and maintenance right of the target database, sending a prompt through the browser end and exiting the operation interface.
3. The method according to claim 1, wherein the method further comprises:
and closing the session connection and cleaning the related session information of the session connection in response to the disconnection operation initiated by the user at the browser end.
4. The method of claim 1, wherein the sending the database parameters of the target database input by the user at the browser side to the control side includes:
The browser end sends a connection request to the control end;
the control end establishes data connection between the control end and the browser end according to the connection request;
and the browser end sends the received database parameters of the target database to the control end through the data connection.
5. The method according to claim 1, wherein the establishing, by the control terminal, session connection between the browser terminal and the proxy server terminal corresponding to the target database according to the database parameters includes:
the control end determines a proxy server of a database corresponding to the database parameters according to the database parameters;
the control end sends an encryption request to the proxy server;
the proxy server searches an engine corresponding to the target database from a database engine factory according to the encryption request;
connecting a data interface of the control end with the input and output of the engine, and establishing session connection between the control end and the proxy server;
and the browser end promotes the data connection between the control end and the browser end to be session connection, and establishes session connection between the browser end and the proxy server end.
6. The method according to claim 1, wherein the sending, through the session connection, the operation command input by the user at the browser end to the client corresponding to the target database, so that the client executes the operation command includes:
the browser end sends the operation command to the control end;
the control end generates an encryption request according to the operation command and sends the encryption request to the proxy server;
the proxy server analyzes the encryption request to obtain the operation command, and sends the operation command to an engine corresponding to the target database;
and the engine calls a client corresponding to the target database, and the operation command is executed through the client.
7. The method according to claim 1, wherein the result of the execution of the operation command by the client is returned to the browser, and the method further comprises:
rendering the execution result through the browser end;
and displaying the rendered execution result in a visual interface of the browser end.
8. A method according to claim 3, wherein said closing said session connection and cleaning session information associated with said session connection in response to a disconnection operation initiated by said user at said browser side comprises:
responding to the disconnection operation initiated by a user at the browser end, and sending a disconnection request to the control end by the browser end;
after the control end receives the disconnection request, sending a disconnection notification to the proxy server;
after receiving the disconnection notification, the proxy server initializes an engine corresponding to the target database and notifies the control end that the connection is disconnected;
the control end cleans up the relevant session information of the session connection in the control end and informs the browser end that the connection is disconnected;
and the browser end cleans up the relevant session information of the session connection at the browser end and resets the visual interface of the browser end.
9. The method according to claim 4, wherein the method further comprises:
and when the control end detects that the parameters of the target database are abnormal parameters, stopping receiving the data sent by the browser end, and returning a corresponding prompt to the browser end.
10. The method of claim 5, wherein the method further comprises:
and when the proxy server detects that the encryption request is an abnormal request, refusing to establish connection and returning a corresponding prompt to the control end.
11. The method of claim 6, wherein the method further comprises:
when the browser end sends the operation command to the control end through the session connection, filtering and classifying the operation command;
when the type of the operation command is not supporting operation, intercepting the operation command and sending a corresponding prompt to the browser end;
when the type of the operation command is operation requiring work order approval, initiating a work order flow, and after the work order flow is executed, generating a corresponding encryption request according to the operation command;
and when the type of the operation command is a releasable operation, generating a corresponding encryption request according to the operation command.
12. The method of claim 11, wherein the method further comprises:
and the control end records all the operations performed on the operation command in an operation audit log.
13. The database parameter sending module is used for sending the database parameters of the target database input by the user at the browser end to the control end;
the session connection creation module is used for establishing session connection between the browser end and the proxy server end corresponding to the target database according to the database parameters through the control end;
the operation command execution module is used for sending the operation command input by the user at the browser to the client corresponding to the target database through the session connection so that the client executes the operation command;
and the command execution result returning module is used for returning the execution result of the operation command by the client to the browser.
14. 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 according to any of claims 1 to 12.
15. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 12 when executing the computer program.
CN202310163922.3A 2023-02-24 2023-02-24 Operation and maintenance method, device and equipment of database and storage medium Pending CN116010382A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310163922.3A CN116010382A (en) 2023-02-24 2023-02-24 Operation and maintenance method, device and equipment of database and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310163922.3A CN116010382A (en) 2023-02-24 2023-02-24 Operation and maintenance method, device and equipment of database and storage medium

Publications (1)

Publication Number Publication Date
CN116010382A true CN116010382A (en) 2023-04-25

Family

ID=86032130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310163922.3A Pending CN116010382A (en) 2023-02-24 2023-02-24 Operation and maintenance method, device and equipment of database and storage medium

Country Status (1)

Country Link
CN (1) CN116010382A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6038562A (en) * 1996-09-05 2000-03-14 International Business Machines Corporation Interface to support state-dependent web applications accessing a relational database
US20010037331A1 (en) * 2000-04-26 2001-11-01 Lloyd Steven D. Browser-based database-access engine apparatus and method
CN103488765A (en) * 2013-09-28 2014-01-01 雷虹 Access drive and data access method of proxy database
CN109753532A (en) * 2018-12-26 2019-05-14 苏州宏软信息技术有限公司 Interface service system and its implementation method for browser end access database
CN111177112A (en) * 2019-12-06 2020-05-19 陕西上讯信息技术有限公司 Database blocking method and device based on operation and maintenance management system and electronic equipment
CN112131205A (en) * 2020-09-21 2020-12-25 上海上讯信息技术股份有限公司 Database blocking method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6038562A (en) * 1996-09-05 2000-03-14 International Business Machines Corporation Interface to support state-dependent web applications accessing a relational database
US20010037331A1 (en) * 2000-04-26 2001-11-01 Lloyd Steven D. Browser-based database-access engine apparatus and method
CN103488765A (en) * 2013-09-28 2014-01-01 雷虹 Access drive and data access method of proxy database
CN109753532A (en) * 2018-12-26 2019-05-14 苏州宏软信息技术有限公司 Interface service system and its implementation method for browser end access database
CN111177112A (en) * 2019-12-06 2020-05-19 陕西上讯信息技术有限公司 Database blocking method and device based on operation and maintenance management system and electronic equipment
CN112131205A (en) * 2020-09-21 2020-12-25 上海上讯信息技术股份有限公司 Database blocking method and device

Similar Documents

Publication Publication Date Title
US11575736B2 (en) System and method for providing data and application continuity in a computer system
US10356044B2 (en) Security information and event management
CN103391216B (en) A kind of illegal external connection is reported to the police and blocking-up method
CN108712329A (en) A kind of gateway and log recording retrieval device based on Elasticsearch
US11392873B2 (en) Systems and methods for simulating orders and workflows in an order entry and management system to test order scenarios
WO2009046667A1 (en) System, device and method of security management
KR20200102328A (en) Method and device for processing data
CN109922062A (en) Source code reveals monitoring method and relevant device
CN107463839A (en) A kind of system and method for managing application program
CN111382985A (en) To-do message integrated pushing system and working method
CN113794276A (en) Power distribution network terminal safety behavior monitoring system and method based on artificial intelligence
CN112187532A (en) Node control method and system
US9232420B1 (en) Automated network testing using in-progress call detail records
CN105245336B (en) A kind of file encryption management system
CN116010382A (en) Operation and maintenance method, device and equipment of database and storage medium
CN103841120A (en) Data security management method, mobile terminal and system based on digital watermarking
CN114301772A (en) Flow control method and device, electronic equipment and readable medium
CN108566380A (en) A kind of proxy surfing Activity recognition and detection method
CN114465867B (en) Maintenance method and device of server, storage medium and processor
CN116405598B (en) Telephone deployment method and device and electronic equipment
US11546475B2 (en) System and method for dynamic driven context management
CN114254296A (en) Application system management method and device, storage medium and electronic equipment
CN114465867A (en) Server maintenance method and device, storage medium and processor
CN117278232A (en) Method, system, storage medium and computer equipment for discovering terminal asset
CN117176599A (en) Equipment maintenance method, system, electronic 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20230425