Database account hosting method, device, computer equipment and storage medium
By introducing the mapping relationship between virtual accounts and real database accounts in database account management, and using dynamic codes for verification and replacement, the problems of cumbersome account management, abuse of sharing and low security in the existing technology are solved, and account reconciliation is achieved Accurate positioning and security management by users.
Patent Information
- Application Number
- CN202310781454.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2043-06-29
AI Technical Summary
The existing database account management solution has problems such as cumbersome account management, abuse of sharing, low security, and the inability to accurately locate the real user of the account.
By setting the mapping relationship between the virtual account and the real database account, log in to the database using the virtual account and dynamic code, and after verification, replace the virtual account with the real account to achieve access to the database.
It effectively solves the problems of difficulty in managing passwords, abuse of sharing and security of database accounts, and can accurately locate the real users of the account.
Smart Images

Figure CN116522308B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and more specifically to a database account hosting method, device, computer equipment and storage medium. Background Art
[0002] With the popularization and development of the Internet, more and more companies and organizations use databases to manage and store important data. Database administrators are responsible for managing and maintaining databases, including user account management. In order to avoid the tediousness of account management and the problem of account abuse and sharing, database account hosting technology came into being. By storing database account information on the account hosting system and monitoring the real user operations of the database account, it not only improves efficiency but also ensures data security.
[0003] The original solution for managing database accounts and passwords requires manual SQL execution to create database accounts, passwords, and related permissions; the account needs to be manually destroyed by the database administrator after use; when temporarily accessing the database, the database administrator needs to create a temporary account, which is inconvenient to manage; when managing multiple databases, the complexity of account and permission management increases. In summary, when the database administrator manages operation and maintenance accounts, such as creating an operation and maintenance account, he still needs to create a user account directly in the database through the command line. When there are many types of databases, the workload is very large. Secondly, the permissions of the created account need to be assigned again in the database, which involves switching between multiple systems. The subsequent maintenance cost is high, and the real user of the account cannot be located. When multiple people use the same account, the related operations cannot be located.
[0004] Therefore, it is necessary to design a new method to effectively solve the problems of difficult database account and password management, abuse and sharing, and security issues, and to accurately locate the real user of the account. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a database account hosting method, device, computer equipment and storage medium.
[0006] To achieve the above purpose, the present invention adopts the following technical solution: a database account hosting method, comprising:
[0007] Set up a virtual account and bind the virtual account to the real account in the database to obtain a mapping relationship between the virtual account and the real account in the database;
[0008] Performing authority control on the virtual account to generate a dynamic code;
[0009] Log into a database using the virtual account number and the dynamic code to verify the virtual account number and the dynamic code;
[0010] When the virtual account number and the dynamic code are verified, the virtual account number is replaced with the real account number in the database, so as to access the database using the real account number in the database.
[0011] A further technical solution is: the virtual account is set and the virtual account is bound to the real account in the database to obtain a mapping relationship between the virtual account and the real account in the database, including:
[0012] Set up a virtual account that is bound to the identity of the operation and maintenance personnel;
[0013] Add the real database account of the operation and maintenance personnel;
[0014] Bind the virtual account to the real account in the database to obtain a mapping relationship between the virtual account and the real account in the database.
[0015] A further technical solution is: using the virtual account and the dynamic code to log into the database to verify the virtual account and the dynamic code includes:
[0016] Get the user name and dynamic code entered into the database;
[0017] Parsing the database type and SQL execution instructions to determine whether the database supports the permission operation corresponding to the user name;
[0018] When the database supports the permission operation corresponding to the user name, searching for a virtual account related to the user name;
[0019] When a virtual account associated with the user name exists, obtaining a dynamic code associated with the virtual account;
[0020] When the hashed encrypted ciphertext of the dynamic code associated with the virtual account is consistent with the hashed encrypted ciphertext of the dynamic code corresponding to the user name, it is determined that the virtual account and the dynamic code have passed the verification.
[0021] A further technical solution is: when the virtual account and the dynamic code pass verification, the virtual account is replaced with the real account in the database, so as to access the database using the real account in the database, including:
[0022] When the virtual account number and the dynamic code pass verification, searching the database for a real account number related to the virtual account number;
[0023] Replace the virtual account and the hashed encrypted ciphertext of the dynamic code related to the virtual account with the real account and password in the database;
[0024] The data stream related to the real account number and password of the database is packaged and forwarded to the database.
[0025] Its further technical solution is: when the virtual account and the dynamic code are verified, the virtual account is replaced with the real account in the database, so as to access the database using the real account in the database, and further includes:
[0026] Recording operations in the virtual account into a log;
[0027] Determine whether the virtual account has relevant SQL operation permissions;
[0028] When the virtual account does not have relevant SQL operation authority, the relevant content of the virtual account is determined from the log and located to the real account in the database.
[0029] A further technical solution is: replacing the virtual account and the hashed encrypted ciphertext of the dynamic code related to the virtual account with the real account and password in the database includes:
[0030] Encrypt the password of the real account in the database using a hash algorithm to obtain an encryption result;
[0031] Replace the virtual account with the real account in the database;
[0032] The hash encrypted ciphertext of the dynamic code associated with the virtual account is replaced with the encryption result.
[0033] The present invention also provides a database account hosting device, including:
[0034] A mapping unit, used to set a virtual account and bind the virtual account to a real account in the database to obtain a mapping relationship between the virtual account and the real account in the database;
[0035] A dynamic code generation unit, used to perform authority control on the virtual account to generate a dynamic code;
[0036] A login unit, used to log into a database using the virtual account number and the dynamic code to verify the virtual account number and the dynamic code;
[0037] A replacement unit is used to replace the virtual account with the real account in the database when the virtual account and the dynamic code are verified, so as to access the database using the real account in the database.
[0038] Its further technical solution is: the mapping unit includes:
[0039] The setting subunit is used to set up a virtual account bound to the identity of the operation and maintenance personnel;
[0040] An adding subunit is used to add the real database account of the operation and maintenance personnel;
[0041] The binding subunit is used to bind the virtual account to the real account in the database to obtain a mapping relationship between the virtual account and the real account in the database.
[0042] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.
[0043] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0044] Compared with the prior art, the beneficial effect of the present invention is as follows: the present invention adopts a mapping relationship between a virtual account and a real account in a database, logs in to the database using a virtual account and a dynamic code, verifies the virtual account and the dynamic code, and then accesses the database using the real account in the database corresponding to the virtual account. The real account in the database can be truly bound to the identity of the person, effectively solving the problems of difficult database account and password management, abuse and sharing, and security, and can accurately locate the real user of the account.
[0045] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0047] Figure 1 A schematic diagram of an application scenario of the database account hosting method provided by an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of a process flow of a database account hosting method provided by an embodiment of the present invention;
[0049] Figure 3 A schematic diagram of a sub-process of a database account hosting method provided by an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of a sub-process of a database account hosting method provided by an embodiment of the present invention;
[0051] Figure 5 A schematic diagram of a sub-process of a database account hosting method provided by an embodiment of the present invention;
[0052] Figure 6 A schematic diagram of a sub-process of a database account hosting method provided by an embodiment of the present invention;
[0053] Figure 7 A schematic diagram of a flow chart of a database account hosting method provided by another embodiment of the present invention;
[0054] Figure 8 A schematic diagram of a database accessed by multiple accounts provided in an embodiment of the present invention;
[0055] Fig. 9 A schematic block diagram of a database account hosting device provided by an embodiment of the present invention;
[0056] Fig.10 A schematic block diagram of a mapping unit of a database account hosting device provided in an embodiment of the present invention;
[0057] Fig.11 A schematic block diagram of a login unit of a database account hosting device provided in an embodiment of the present invention;
[0058] Fig.12 A schematic block diagram of a replacement unit of a database account hosting device provided in an embodiment of the present invention;
[0059] Fig.13 A schematic block diagram of a content replacement subunit of a database account hosting device provided in an embodiment of the present invention;
[0060] Fig.14 A schematic block diagram of a database account hosting device provided by another embodiment of the present invention;
[0061] Fig.15 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0064] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0065] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0066] See also Figure 1 and Figure 2 , Figure 1 A schematic diagram of an application scenario of the database account hosting method provided in an embodiment of the present invention. Figure 2 A schematic flow chart of a database account hosting method provided in an embodiment of the present invention. The database account hosting method is applied in a server. The server interacts with the terminal for data, and uses an operation and maintenance tool to access the database through a virtual account and a dynamic code. After receiving the access request, the server successfully passes various security policy audits (including access, permission control, etc.), locates the real user and records the behavior operations, can control specific SQL permission operations, replace the virtual account with a real database account to access the database, and the user successfully accesses the database, effectively solving the difficult management of database account passwords, abuse and sharing, and security issues, and can accurately locate the real user of the account.
[0067] Figure 2 FIG. 1 is a flow chart of a database account hosting method provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S140.
[0068] S110: Set a virtual account, and bind the virtual account to a real account in a database to obtain a mapping relationship between the virtual account and the real account in the database.
[0069] In this embodiment, a virtual account refers to an account that only allows itself to log in, and is assigned to obtain the user role and related permissions of the corresponding product. For example, the account is zhangsan, mobile phone number: 130XXXXXXXX, email: testXXX@126.com, and the permission is database user. The account hosting system uses SMS verification code, or email verification code, or passkey-based password-free login technology to enhance account security.
[0070] In one embodiment, see Figure 3 The above-mentioned step S110 may include steps S111~S113.
[0071] S111. Set a virtual account bound to the identity of the operation and maintenance personnel.
[0072] In this embodiment, a virtual account is first set up, bound to the identity of the operation and maintenance personnel, and then bound and mapped to the real account of the database.
[0073] S112: Add the real database account of the operation and maintenance personnel.
[0074] In this embodiment, a real database account, that is, a real database account, is added to the server, for example, the real database account is: mysql_test, and the password is: test_123456.
[0075] S113: Bind the virtual account to the real account in the database to obtain a mapping relationship between the virtual account and the real account in the database.
[0076] In this embodiment, the virtual account and the real account in the database are bound to form a mapping relationship, for example, the account zhangsan is bound to the real account in the database mysql_test / test_12345.
[0077] The setting of virtual accounts can solve account management problems and set permissions for permission management of different accounts.
[0078] S120: Perform authority control on the virtual account to generate a dynamic code.
[0079] In this embodiment, the dynamic code refers to the login password of the virtual account.
[0080] Specifically, the authority of the virtual account zhangsan is controlled, and a time-limited dynamic code is generated as the login password. For example, the select authority of the account is opened, and the insert and delete authorities are closed, and a dynamic code for temporary login is generated: se3hd4#d@df.
[0081] S130: Log into a database using the virtual account number and the dynamic code to verify the virtual account number and the dynamic code.
[0082] In this embodiment, a virtual account is used and a dynamic code is input to log into the database, but the virtual account and the dynamic code still need to be verified.
[0083] In one embodiment, see Figure 4 The above-mentioned step S130 may include steps S131~S135.
[0084] S131, obtaining the user name and dynamic code input into the database;
[0085] S132, parsing the database type and SQL execution instruction to determine whether the database supports the permission operation corresponding to the user name;
[0086] S133, when the database supports the permission operation corresponding to the user name, searching for a virtual account related to the user name;
[0087] S134. When a virtual account associated with the user name exists, obtaining a dynamic code associated with the virtual account;
[0088] S135. When the hashed encrypted ciphertext of the dynamic code associated with the virtual account is consistent with the hashed encrypted ciphertext of the dynamic code corresponding to the user name, it is determined that the virtual account and the dynamic code have passed verification.
[0089] In this embodiment, the data flow is analyzed to obtain relevant data, such as database type, account password, SQL operation type, etc., to control whether the real user has the permission to operate.
[0090] Specifically, use the SQL client to log in to the database (for example, log in to the Mysql database): enter the virtual account: zhangsan, dynamic code: se3hd4#d@df, the dynamic code is calculated as the hash ciphertext xxxxxxxxxxxx by the agreed hash algorithm. The login data stream passes through the server and parses the database type; determines whether the database type is supported, returns failure if not supported, and continues the process if supported; parses the virtual account and password in the data stream, that is, the hash ciphertext of the input dynamic code, zhangsan / xxxxxxxxxxxx. Use the virtual account zhangsan to find out whether there is a related account in the account hosting system. If it cannot be found, it returns failure. If it is successful, the process continues. After the virtual account zhangsan is successfully found, the dynamic code generated by the virtual account is obtained, and the dynamic code hash ciphertext is calculated using the agreed hash algorithm of the same type (such as mysql, oracle and other different databases use different hash algorithms): yyyyyyyyyyyyy. Compare the hash ciphertext yyyyyyyyyyy and the hash ciphertext xxxxxxxxxxxx in the login data stream to see if they are consistent. If they are inconsistent, it returns failure. If they are consistent, execute step S140.
[0091] S140. When the virtual account and the dynamic code pass verification, the virtual account is replaced with the real account in the database, so as to access the database using the real account in the database.
[0092] In this embodiment, a real database account and password are used to access the database.
[0093] In one embodiment, see Figure 5 , the above-mentioned step S140 may include steps S141~S143.
[0094] S141. When the virtual account and the dynamic code pass verification, search the database for a real account related to the virtual account.
[0095] In this embodiment, the real account and password of the database bound to the account zhangsan, mysql_test / test_12345, are searched, and the hash ciphertext of the password test_12345 is calculated using the agreed hash algorithm: zzzzzzzzzz.
[0096] S142. Replace the virtual account and the hashed encrypted ciphertext of the dynamic code related to the virtual account with the real account and password in the database.
[0097] In one embodiment, see Figure 6 , the above-mentioned step S142 may include steps S1421~S1423.
[0098] S1421. Encrypt the password of the real account in the database using a hash algorithm to obtain an encryption result.
[0099] In this embodiment, the encryption result refers to the ciphertext formed by encrypting the password of the real account in the database using a hash algorithm.
[0100] S1422, replacing the virtual account with the real account in the database;
[0101] S1423. Replace the hash encrypted ciphertext of the dynamic code related to the virtual account with the encryption result.
[0102] S143. Pack the data stream related to the real account number and password of the database and forward it to the database.
[0103] In this embodiment, the hashed account number and password are used to replace the virtual account number and the dynamic code, and the packaged data stream is forwarded to the real database.
[0104] The method of this embodiment does not require installation of plug-ins or complicated configuration.
[0105] The above-mentioned database account hosting method adopts the mapping relationship between the virtual account and the real account of the database. After logging in to the database using the virtual account and the dynamic code and verifying the virtual account and the dynamic code, the real account of the database corresponding to the virtual account is used to access the database. The real account of the database can be truly bound to the identity of the person, thereby effectively solving the problems of difficult database account password management, abuse and sharing, and security, and can accurately locate the real user of the account.
[0106] Figure 7FIG. 1 is a flow chart of a database account hosting method provided by another embodiment of the present invention. Figure 7 As shown, the database account hosting method of this embodiment includes steps S210-S270. Steps S210-S240 are similar to steps S110-S140 in the above embodiment and are not described here. The following is a detailed description of steps S250-S270 added in this embodiment.
[0107] S250, recording the operations in the virtual account into a log;
[0108] S260, determining whether the virtual account has relevant SQL operation authority;
[0109] S270: When the virtual account does not have relevant SQL operation authority, relevant content of the virtual account is determined from the log and located to the real account in the database.
[0110] If the virtual account has relevant SQL operation permissions, proceed to the end step.
[0111] In this embodiment, after the login access is completed, the terminal executes the SQL statement, and the server performs a permission check to determine whether there is relevant operation permission, such as Figure 8 As shown in the figure, virtual account A, virtual account B, virtual account C, and virtual account D have different SQL operation permissions. If they fail the permission test, they are directly returned to the terminal. If they pass the permission test, they are sent to the target database. The operation of terminal login or executing SQL statements will be recorded in the system log. If virtual account A performs a malicious delete operation on the table user, the virtual account, dynamic code and other information will be recorded to locate the specific operator, and the individual can be accurately located.
[0112] Fig. 9 is a schematic block diagram of a database account hosting device 300 provided in an embodiment of the present invention. Fig. 9 As shown, corresponding to the above database account hosting method, the present invention also provides a database account hosting device 300. The database account hosting device 300 includes a unit for executing the above database account hosting method, and the device can be configured in a server. Fig. 9 The database account hosting device 300 includes a mapping unit 301, a dynamic code generating unit 302, a login unit 303 and a replacement unit 304.
[0113] A mapping unit 301 is used to set a virtual account and bind the virtual account to a real account in a database to obtain a mapping relationship between the virtual account and the real account in the database; a dynamic code generation unit 302 is used to perform permission control on the virtual account to generate a dynamic code; a login unit 303 is used to use the virtual account and the dynamic code to log in to the database to verify the virtual account and the dynamic code; a replacement unit 304 is used to replace the virtual account with the real account in the database when the virtual account and the dynamic code are verified, so as to access the database using the real account in the database.
[0114] In one embodiment, if Fig.10 As shown, the mapping unit 301 includes a setting subunit 3011 , an adding subunit 3012 and a binding subunit 3013 .
[0115] The setting subunit 3011 is used to set a virtual account bound to the identity of the operation and maintenance personnel; the adding subunit 3012 is used to add the real database account of the operation and maintenance personnel; the binding subunit 3013 is used to bind the virtual account to the real database account to obtain a mapping relationship between the virtual account and the real database account.
[0116] In one embodiment, if Fig.11 As shown, the login unit 303 includes a login acquisition subunit 3031 , a parsing subunit 3032 , a first search subunit 3033 , a first acquisition subunit 3034 and a determination subunit 3035 .
[0117] The login acquisition subunit 3031 is used to obtain the user name and dynamic code input into the database; the parsing subunit 3032 is used to parse the database type and SQL execution instructions to determine whether the database supports the permission operations corresponding to the user name; the first search subunit 3033 is used to search for the virtual account related to the user name when the database supports the permission operations corresponding to the user name; the first acquisition subunit 3034 is used to obtain the dynamic code related to the virtual account when the virtual account related to the user name exists; the determination subunit 3035 is used to determine that the virtual account and the dynamic code verification have passed when the hash encrypted ciphertext of the dynamic code related to the virtual account is consistent with the hash encrypted ciphertext of the dynamic code corresponding to the user name.
[0118] In one embodiment, if Fig.12 As shown, the replacement unit 304 includes a second search subunit 3041 , a content replacement subunit 3042 , and a packaging subunit 3043 .
[0119] The second search sub-unit 3041 is used to search for the real account in the database related to the virtual account when the virtual account and the dynamic code are verified; the content replacement sub-unit 3042 is used to replace the hash encrypted ciphertext of the virtual account and the dynamic code related to the virtual account with the real account and password in the database; the packaging sub-unit 3043 is used to package the data stream related to the real account and password in the database and forward it to the database.
[0120] In one embodiment, if Fig.13 As shown, the content replacement subunit 3042 includes an encryption module 30421, an account replacement module 30422 and a ciphertext replacement module 30423.
[0121] The encryption module 30421 is used to encrypt the password of the real account in the database using a hash algorithm to obtain an encryption result; the account replacement module 30422 is used to replace the virtual account with the real account in the database; the ciphertext replacement module 30423 is used to replace the hash encrypted ciphertext of the dynamic code related to the virtual account with the encryption result.
[0122] Fig.14 FIG. 3 is a schematic block diagram of a database account hosting device 300 provided in another embodiment of the present invention. Fig.14 As shown, the database account hosting device 300 of this embodiment is based on the above embodiment and adds a recording unit 305, a judgment unit 306 and a positioning unit 307.
[0123] The recording unit 305 is used to record the operations in the virtual account into a log; the judging unit 306 is used to judge whether the virtual account has relevant SQL operation permissions; the positioning unit 307 is used to determine the relevant content of the virtual account from the log when the virtual account does not have relevant SQL operation permissions, and locate the real account in the database.
[0124] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned database account hosting device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.
[0125] The above-mentioned database account hosting device 300 can be implemented in the form of a computer program. The computer program can be Fig.15 Runs on the computer device shown.
[0126] See also Fig.15 , Fig.155 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.
[0127] See also Fig.15 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0128] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a database account trusteeship method.
[0129] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0130] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a database account trusteeship method.
[0131] The network interface 505 is used to communicate with other devices over the network. Fig.15 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0132] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:
[0133] A virtual account is set up, and the virtual account is bound to a real account in a database to obtain a mapping relationship between the virtual account and the real account in the database; permission control is performed on the virtual account to generate a dynamic code; the virtual account and the dynamic code are used to log in to the database to verify the virtual account and the dynamic code; when the virtual account and the dynamic code pass the verification, the virtual account is replaced with the real account in the database to access the database using the real account in the database.
[0134] In one embodiment, when the processor 502 implements the step of using the virtual account and the dynamic code to log in to the database to perform the verification step of the virtual account and the dynamic code, the processor 502 specifically implements the following steps:
[0135] Obtain the user name and dynamic code input into the database; parse the database type and SQL execution instructions to determine whether the database supports the permission operation corresponding to the user name; when the database supports the permission operation corresponding to the user name, search for the virtual account associated with the user name; when the virtual account associated with the user name exists, obtain the dynamic code associated with the virtual account; when the hash encrypted ciphertext of the dynamic code associated with the virtual account is consistent with the hash encrypted ciphertext of the dynamic code corresponding to the user name, determine that the virtual account and the dynamic code verification have passed.
[0136] In one embodiment, when the processor 502 implements the step of replacing the virtual account with the real account in the database when the virtual account and the dynamic code are verified, so as to access the database using the real account in the database, the processor 502 specifically implements the following steps:
[0137] When the virtual account and the dynamic code pass the verification, search the database for a real account related to the virtual account; replace the hashed encrypted ciphertext of the virtual account and the dynamic code related to the virtual account with the database real account and password; package the data stream related to the database real account and password and forward it to the database.
[0138] In one embodiment, after implementing the step of replacing the virtual account with the real account in the database when the virtual account and the dynamic code are verified, so as to access the database using the real account in the database, the processor 502 further implements the following steps:
[0139] Record the operations in the virtual account in the log; determine whether the virtual account has relevant SQL operation permissions; when the virtual account does not have relevant SQL operation permissions, determine the relevant content of the virtual account from the log and locate it to the real account in the database.
[0140] In one embodiment, when the processor 502 implements the step of replacing the virtual account and the hashed encrypted ciphertext of the dynamic code related to the virtual account with the real account and password in the database, the processor 502 specifically implements the following steps:
[0141] The password of the real account in the database is encrypted using a hash algorithm to obtain an encryption result; the virtual account is replaced with the real account in the database; and the hash encrypted ciphertext of the dynamic code related to the virtual account is replaced with the encryption result.
[0142] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0143] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0144] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:
[0145] A virtual account is set up, and the virtual account is bound to a real account in a database to obtain a mapping relationship between the virtual account and the real account in the database; permission control is performed on the virtual account to generate a dynamic code; the virtual account and the dynamic code are used to log in to the database to verify the virtual account and the dynamic code; when the virtual account and the dynamic code pass the verification, the virtual account is replaced with the real account in the database to access the database using the real account in the database.
[0146] In one embodiment, when the processor executes the computer program to implement the step of setting a virtual account and binding the virtual account to a real account in the database to obtain a mapping relationship between the virtual account and the real account in the database, the processor specifically implements the following steps:
[0147] A virtual account bound to the identity of the operation and maintenance personnel is set; the real database account of the operation and maintenance personnel is added; and the virtual account is bound to the real database account to obtain a mapping relationship between the virtual account and the real database account.
[0148] In one embodiment, when the processor executes the computer program to implement the step of using the virtual account and the dynamic code to log in to the database to perform the verification step of the virtual account and the dynamic code, the processor specifically implements the following steps:
[0149] Obtain the user name and dynamic code input into the database; parse the database type and SQL execution instructions to determine whether the database supports the permission operation corresponding to the user name; when the database supports the permission operation corresponding to the user name, search for the virtual account associated with the user name; when the virtual account associated with the user name exists, obtain the dynamic code associated with the virtual account; when the hash encrypted ciphertext of the dynamic code associated with the virtual account is consistent with the hash encrypted ciphertext of the dynamic code corresponding to the user name, determine that the virtual account and the dynamic code verification have passed.
[0150] In one embodiment, when the processor executes the computer program to implement the step of replacing the virtual account with the real account in the database when the virtual account and the dynamic code are verified, so as to access the database using the real account in the database, the processor specifically implements the following steps:
[0151] When the virtual account and the dynamic code pass the verification, search the database for a real account related to the virtual account; replace the hashed encrypted ciphertext of the virtual account and the dynamic code related to the virtual account with the database real account and password; package the data stream related to the database real account and password and forward it to the database.
[0152] In one embodiment, after the processor executes the computer program to implement the step of replacing the virtual account with the real account in the database when the virtual account and the dynamic code are verified, so as to access the database using the real account in the database, the processor further implements the following steps:
[0153] Record the operations in the virtual account in the log; determine whether the virtual account has relevant SQL operation permissions; when the virtual account does not have relevant SQL operation permissions, determine the relevant content of the virtual account from the log and locate it to the real account in the database.
[0154] In one embodiment, when the processor executes the computer program to implement the step of replacing the virtual account and the hashed encrypted ciphertext of the dynamic code related to the virtual account with the real account and password in the database, the processor specifically implements the following steps:
[0155] The password of the real account in the database is encrypted using a hash algorithm to obtain an encryption result; the virtual account is replaced with the real account in the database; and the hash encrypted ciphertext of the dynamic code related to the virtual account is replaced with the encryption result.
[0156] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0157] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0158] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0159] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0160] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0161] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A database account hosting method, characterized in that: include: Set up a virtual account and bind the virtual account to the real account in the database to obtain the mapping relationship between the virtual account and the real account in the database; Performing authority control on the virtual account to generate a dynamic code; Using the virtual account number and the dynamic code to log in to the database to verify the virtual account number and the dynamic code; When the virtual account number and the dynamic code are verified, the virtual account number is replaced with the real account number in the database, so as to access the database using the real account number in the database; The setting of the virtual account and binding the virtual account with the real account in the database to obtain a mapping relationship between the virtual account and the real account in the database includes: setting a virtual account bound to the identity of the operation and maintenance personnel; adding the real account in the database of the operation and maintenance personnel; binding the virtual account with the real account in the database to obtain a mapping relationship between the virtual account and the real account in the database; The method of using the virtual account and the dynamic code to log in to the database to verify the virtual account and the dynamic code includes: obtaining the user name and the dynamic code input into the database; parsing the database type and the SQL execution instruction to determine whether the database supports the permission operation corresponding to the user name; when the database supports the permission operation corresponding to the user name, searching for the virtual account associated with the user name; when the virtual account associated with the user name exists, obtaining the dynamic code associated with the virtual account; when the hash encrypted ciphertext of the dynamic code associated with the virtual account is consistent with the hash encrypted ciphertext of the dynamic code corresponding to the user name, determining that the virtual account and the dynamic code have passed the verification; When the virtual account number and the dynamic code pass the verification, the virtual account number is replaced with the real account number in the database, so as to access the database using the real account number in the database, including: when the virtual account number and the dynamic code pass the verification, searching for the real account number in the database related to the virtual account number; replacing the hash encrypted ciphertext of the virtual account number and the dynamic code related to the virtual account number with the real account number and password in the database; packaging the data stream related to the real account number and password in the database and forwarding it to the database; When the virtual account and the dynamic code pass the verification, the virtual account is replaced with the real account in the database to access the database using the real account in the database, and the method further includes: recording the operations in the virtual account in a log; determining whether the virtual account has relevant SQL operation permissions; when the virtual account does not have relevant SQL operation permissions, determining the relevant content of the virtual account from the log and locating it to the real account in the database; The replacing the virtual account and the hash encrypted ciphertext of the dynamic code related to the virtual account with the real account and password in the database includes: encrypting the password of the real account in the database using a hash algorithm to obtain an encryption result; replacing the virtual account with the real account in the database; and replacing the hash encrypted ciphertext of the dynamic code related to the virtual account with the encryption result.
2. A database account hosting device, characterized in that: include: A mapping unit, used to set a virtual account and bind the virtual account to a real account in the database to obtain a mapping relationship between the virtual account and the real account in the database; A dynamic code generation unit, used to perform authority control on the virtual account to generate a dynamic code; A login unit, used to log into a database using the virtual account number and the dynamic code to verify the virtual account number and the dynamic code; A replacement unit, configured to replace the virtual account with the real account in the database when the virtual account and the dynamic code pass verification, so as to access the database using the real account in the database; The step of setting a virtual account and binding the virtual account to a real account in the database to obtain a mapping relationship between the virtual account and the real account in the database includes: setting a virtual account bound to the identity of an operation and maintenance personnel; adding the real account in the database of the operation and maintenance personnel; binding the virtual account to the real account in the database to obtain a mapping relationship between the virtual account and the real account in the database; The step of using the virtual account and the dynamic code to log into the database to verify the virtual account and the dynamic code includes: obtaining the user name and the dynamic code input into the database; Parsing the database type and SQL execution instructions to determine whether the database supports the permission operation corresponding to the user name; When the database supports the permission operation corresponding to the user name, searching for a virtual account related to the user name; When a virtual account associated with the user name exists, obtaining a dynamic code associated with the virtual account; When the hashed encrypted ciphertext of the dynamic code associated with the virtual account is consistent with the hashed encrypted ciphertext of the dynamic code corresponding to the user name, it is determined that the virtual account and the dynamic code have passed verification; When the virtual account number and the dynamic code are verified, the virtual account number is replaced with the real account number in the database so as to access the database using the real account number in the database, including: when the virtual account number and the dynamic code are verified, searching for the real account number in the database related to the virtual account number; Replace the virtual account and the hashed encrypted ciphertext of the dynamic code related to the virtual account with the real account and password in the database; Packing the data stream related to the real account number and password of the database and forwarding it to the database; When the virtual account and the dynamic code pass verification, the virtual account is replaced with the real account in the database to access the database using the real account in the database, and the method further includes: recording the operation in the virtual account in a log; Determine whether the virtual account has relevant SQL operation permissions; When the virtual account does not have relevant SQL operation authority, the relevant content of the virtual account is determined from the log and located to the real account in the database.
3. The database account hosting device according to claim 2, characterized in that: The mapping unit includes: a setting subunit, used to set a virtual account bound to the identity of the operation and maintenance personnel; an adding subunit, used to add the real database account of the operation and maintenance personnel; and a binding subunit, used to bind the virtual account with the real database account to obtain a mapping relationship between the virtual account and the real database account.
4. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to claim 1 when executing the computer program.
5. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to claim 1 is implemented.
Citation Information
Patent Citations
Abstract database management device and method based on virtual account and access control model
WO2022211233A1